summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-05-15 03:01:58 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-05-15 03:01:58 +0000
commit3ed2dd9e99272a21f2764418ddae60252b4516d3 (patch)
treed22d9d982b110d339ec5639abb12b5f58bdc02ee
parent2829bfe60d03c252f56bdb2025fb6a1e10b3043a (diff)
parentc2515aaf47893aceb4e08c7719c6dbe146f50b28 (diff)
downloadvulkan-cereal-android12-s1-release.tar.gz
Snap for 7364021 from c2515aaf47893aceb4e08c7719c6dbe146f50b28 to sc-releaseandroid-vts-12.0_r9android-vts-12.0_r8android-vts-12.0_r7android-vts-12.0_r6android-vts-12.0_r5android-vts-12.0_r4android-vts-12.0_r3android-vts-12.0_r2android-vts-12.0_r12android-vts-12.0_r11android-vts-12.0_r10android-vts-12.0_r1android-security-12.0.0_r59android-security-12.0.0_r58android-security-12.0.0_r57android-security-12.0.0_r56android-security-12.0.0_r55android-security-12.0.0_r54android-security-12.0.0_r53android-security-12.0.0_r52android-security-12.0.0_r51android-security-12.0.0_r50android-security-12.0.0_r49android-security-12.0.0_r48android-security-12.0.0_r47android-security-12.0.0_r46android-security-12.0.0_r45android-security-12.0.0_r44android-security-12.0.0_r43android-security-12.0.0_r42android-security-12.0.0_r41android-security-12.0.0_r40android-security-12.0.0_r39android-security-12.0.0_r38android-security-12.0.0_r37android-security-12.0.0_r36android-security-12.0.0_r35android-security-12.0.0_r34android-security-11.0.0_r71android-platform-12.0.0_r9android-platform-12.0.0_r8android-platform-12.0.0_r7android-platform-12.0.0_r6android-platform-12.0.0_r5android-platform-12.0.0_r4android-platform-12.0.0_r31android-platform-12.0.0_r30android-platform-12.0.0_r3android-platform-12.0.0_r29android-platform-12.0.0_r28android-platform-12.0.0_r27android-platform-12.0.0_r26android-platform-12.0.0_r25android-platform-12.0.0_r24android-platform-12.0.0_r23android-platform-12.0.0_r22android-platform-12.0.0_r21android-platform-12.0.0_r20android-platform-12.0.0_r2android-platform-12.0.0_r19android-platform-12.0.0_r18android-platform-12.0.0_r17android-platform-12.0.0_r16android-platform-12.0.0_r15android-platform-12.0.0_r14android-platform-12.0.0_r13android-platform-12.0.0_r12android-platform-12.0.0_r11android-platform-12.0.0_r10android-platform-12.0.0_r1android-cts-12.0_r9android-cts-12.0_r8android-cts-12.0_r7android-cts-12.0_r6android-cts-12.0_r5android-cts-12.0_r4android-cts-12.0_r3android-cts-12.0_r2android-cts-12.0_r12android-cts-12.0_r11android-cts-12.0_r10android-cts-12.0_r1android-12.0.0_r9android-12.0.0_r8android-12.0.0_r34android-12.0.0_r33android-12.0.0_r31android-12.0.0_r30android-12.0.0_r3android-12.0.0_r25android-12.0.0_r2android-12.0.0_r11android-12.0.0_r10android-12.0.0_r1android12-tests-releaseandroid12-security-releaseandroid12-s5-releaseandroid12-s4-releaseandroid12-s3-releaseandroid12-s2-releaseandroid12-s1-releaseandroid12-releaseandroid12-platform-release
Change-Id: I4d8d976a5fa2f87ed3b03cfa6952aa9633749202
-rw-r--r--stream-servers/glestranslator/GLES_CM/GLEScmImp.cpp22
-rw-r--r--stream-servers/glestranslator/GLES_V2/GLESv2Imp.cpp8
-rw-r--r--stream-servers/glestranslator/GLcommon/TextureUtils.cpp40
-rw-r--r--stream-servers/glestranslator/include/GLcommon/TextureUtils.h2
4 files changed, 36 insertions, 36 deletions
diff --git a/stream-servers/glestranslator/GLES_CM/GLEScmImp.cpp b/stream-servers/glestranslator/GLES_CM/GLEScmImp.cpp
index 24797502..fb00d415 100644
--- a/stream-servers/glestranslator/GLES_CM/GLEScmImp.cpp
+++ b/stream-servers/glestranslator/GLES_CM/GLEScmImp.cpp
@@ -1064,14 +1064,14 @@ GL_API void GL_APIENTRY glGetBooleanv( GLenum pname, GLboolean *params) {
}
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
- *params = (GLboolean)getCompressedFormats(NULL);
+ *params = (GLboolean)getCompressedFormats(1, NULL);
break;
case GL_COMPRESSED_TEXTURE_FORMATS:
{
- int nparams = getCompressedFormats(NULL);
+ int nparams = getCompressedFormats(1, NULL);
if (nparams>0) {
int * iparams = new int[nparams];
- getCompressedFormats(iparams);
+ getCompressedFormats(1, iparams);
for (int i=0; i<nparams; i++) params[i] = (GLboolean)iparams[i];
delete [] iparams;
}
@@ -1162,15 +1162,15 @@ GL_API void GL_APIENTRY glGetFixedv( GLenum pname, GLfixed *params) {
glGetFloatv(pname,&fParams[0]);
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
- *params = I2X(getCompressedFormats(NULL));
+ *params = I2X(getCompressedFormats(1, NULL));
return;
break;
case GL_COMPRESSED_TEXTURE_FORMATS:
{
- int nparams = getCompressedFormats(NULL);
+ int nparams = getCompressedFormats(1, NULL);
if (nparams>0) {
int * iparams = new int[nparams];
- getCompressedFormats(iparams);
+ getCompressedFormats(1, iparams);
for (int i=0; i<nparams; i++) params[i] = I2X(iparams[i]);
delete [] iparams;
}
@@ -1208,14 +1208,14 @@ GL_API void GL_APIENTRY glGetFloatv( GLenum pname, GLfloat *params) {
*params = (GLfloat)i;
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
- *params = (GLfloat)getCompressedFormats(NULL);
+ *params = (GLfloat)getCompressedFormats(1, NULL);
break;
case GL_COMPRESSED_TEXTURE_FORMATS:
{
- int nparams = getCompressedFormats(NULL);
+ int nparams = getCompressedFormats(1, NULL);
if (nparams>0) {
int * iparams = new int[nparams];
- getCompressedFormats(iparams);
+ getCompressedFormats(1, iparams);
for (int i=0; i<nparams; i++) params[i] = (GLfloat)iparams[i];
delete [] iparams;
}
@@ -1266,10 +1266,10 @@ GL_API void GL_APIENTRY glGetIntegerv( GLenum pname, GLint *params) {
}
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
- *params = getCompressedFormats(NULL);
+ *params = getCompressedFormats(1, NULL);
break;
case GL_COMPRESSED_TEXTURE_FORMATS:
- getCompressedFormats(params);
+ getCompressedFormats(1, params);
break;
case GL_MAX_CLIP_PLANES:
ctx->dispatcher().glGetIntegerv(pname,params);
diff --git a/stream-servers/glestranslator/GLES_V2/GLESv2Imp.cpp b/stream-servers/glestranslator/GLES_V2/GLESv2Imp.cpp
index e438183c..b31fa345 100644
--- a/stream-servers/glestranslator/GLES_V2/GLESv2Imp.cpp
+++ b/stream-servers/glestranslator/GLES_V2/GLESv2Imp.cpp
@@ -2086,14 +2086,14 @@ static void s_glStateQueryTv(bool es2, GLenum pname, T* params, GLStateQueryFunc
break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
- *params = (T)getCompressedFormats(NULL);
+ *params = (T)getCompressedFormats(2, NULL);
break;
case GL_COMPRESSED_TEXTURE_FORMATS:
{
- int nparams = getCompressedFormats(NULL);
+ int nparams = getCompressedFormats(2, NULL);
if (nparams > 0) {
int* iparams = new int[nparams];
- getCompressedFormats(iparams);
+ getCompressedFormats(2, iparams);
for (int i = 0; i < nparams; i++) {
params[i] = (T)iparams[i];
}
@@ -3481,7 +3481,7 @@ static void sPrepareTexImage2D(GLenum target, GLsizei level, GLint internalforma
!((format == GL_DEPTH_COMPONENT && internalformat == GL_DEPTH_COMPONENT)
|| (format == GL_LUMINANCE && internalformat == GL_LUMINANCE)), GL_INVALID_OPERATION);
- VALIDATE(!GLESv2Validate::pixelOp(format,type) && internalformat == ((GLint)format),GL_INVALID_OPERATION);
+ VALIDATE(!GLESv2Validate::pixelOp(format,type),GL_INVALID_OPERATION);
VALIDATE(!GLESv2Validate::pixelSizedFrmt(ctx, internalformat, format, type), GL_INVALID_OPERATION);
}
diff --git a/stream-servers/glestranslator/GLcommon/TextureUtils.cpp b/stream-servers/glestranslator/GLcommon/TextureUtils.cpp
index 6e61e64a..f47d6cd4 100644
--- a/stream-servers/glestranslator/GLcommon/TextureUtils.cpp
+++ b/stream-servers/glestranslator/GLcommon/TextureUtils.cpp
@@ -64,26 +64,30 @@ static constexpr size_t kASTCFormatsCount = 28;
EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, astc_codec::FootprintType::k12x10, true) \
EXPAND_MACRO(GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, astc_codec::FootprintType::k12x12, true) \
-int getCompressedFormats(int* formats) {
+int getCompressedFormats(int majorVersion, int* formats) {
static constexpr size_t kCount = MAX_SUPPORTED_PALETTE + MAX_ETC_SUPPORTED + kASTCFormatsCount;
+ int res = kCount;
+
+ if (majorVersion > 1) {
+ res -= MAX_SUPPORTED_PALETTE;
+ }
if (formats) {
size_t i = 0;
- // Palette
- formats[i++] = GL_PALETTE4_RGBA8_OES;
- formats[i++] = GL_PALETTE4_RGBA4_OES;
- formats[i++] = GL_PALETTE8_RGBA8_OES;
- formats[i++] = GL_PALETTE8_RGBA4_OES;
- formats[i++] = GL_PALETTE4_RGB8_OES;
- formats[i++] = GL_PALETTE8_RGB8_OES;
- formats[i++] = GL_PALETTE4_RGB5_A1_OES;
- formats[i++] = GL_PALETTE8_RGB5_A1_OES;
- formats[i++] = GL_PALETTE4_R5_G6_B5_OES;
- formats[i++] = GL_PALETTE8_R5_G6_B5_OES;
-
- assert(i == MAX_SUPPORTED_PALETTE &&
- "getCompressedFormats size mismatch");
+ if (1 == majorVersion) {
+ // Palette
+ formats[i++] = GL_PALETTE4_RGBA8_OES;
+ formats[i++] = GL_PALETTE4_RGBA4_OES;
+ formats[i++] = GL_PALETTE8_RGBA8_OES;
+ formats[i++] = GL_PALETTE8_RGBA4_OES;
+ formats[i++] = GL_PALETTE4_RGB8_OES;
+ formats[i++] = GL_PALETTE8_RGB8_OES;
+ formats[i++] = GL_PALETTE4_RGB5_A1_OES;
+ formats[i++] = GL_PALETTE8_RGB5_A1_OES;
+ formats[i++] = GL_PALETTE4_R5_G6_B5_OES;
+ formats[i++] = GL_PALETTE8_R5_G6_B5_OES;
+ }
// ETC
formats[i++] = GL_ETC1_RGB8_OES;
@@ -99,9 +103,6 @@ int getCompressedFormats(int* formats) {
formats[i++] = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
formats[i++] = GL_COMPRESSED_R11_EAC;
- assert(i == MAX_SUPPORTED_PALETTE + MAX_ETC_SUPPORTED &&
- "getCompressedFormats size mismatch");
-
// ASTC
#define ASTC_FORMAT(typeName, footprintType, srgbValue) \
formats[i++] = typeName;
@@ -109,10 +110,9 @@ int getCompressedFormats(int* formats) {
ASTC_FORMATS_LIST(ASTC_FORMAT)
#undef ASTC_FORMAT
- assert(i == kCount && "getCompressedFormats size mismatch");
}
- return kCount;
+ return res;
}
ETC2ImageFormat getEtcFormat(GLenum internalformat) {
diff --git a/stream-servers/glestranslator/include/GLcommon/TextureUtils.h b/stream-servers/glestranslator/include/GLcommon/TextureUtils.h
index 641011ea..b5034d0a 100644
--- a/stream-servers/glestranslator/include/GLcommon/TextureUtils.h
+++ b/stream-servers/glestranslator/include/GLcommon/TextureUtils.h
@@ -37,7 +37,7 @@ bool isEtc2Format(GLenum internalformat);
bool isBptcFormat(GLenum internalformat);
bool isS3tcFormat(GLenum internalformat);
bool isPaletteFormat(GLenum internalformat);
-int getCompressedFormats(int* formats);
+int getCompressedFormats(int majorVersion, int* formats);
void doCompressedTexImage2D(GLEScontext* ctx, GLenum target, GLint level,
GLenum internalformat, GLsizei width,
GLsizei height, GLint border, GLsizei imageSize,