Commit 839ce0b4 by Geoff Lang

Validate that compressed image formats are supported by the context.

This validation was previously acceptable because all renderers supported all compressed formats in the format tables. Adding new formats that are not universally supported would have caused failures in the dEQP negative API tests. BUG=angleproject:1185 Change-Id: I102a3286a351a7c8936527963a382d9673341fc0 Reviewed-on: https://chromium-review.googlesource.com/308490Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 7535b761
...@@ -195,33 +195,6 @@ ES3FormatCombinationSet BuildES3FormatSet() ...@@ -195,33 +195,6 @@ ES3FormatCombinationSet BuildES3FormatSet()
// From GL_ANGLE_depth_texture // From GL_ANGLE_depth_texture
InsertES3FormatCombo(&set, GL_DEPTH_COMPONENT32_OES, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT_24_8_OES ); InsertES3FormatCombo(&set, GL_DEPTH_COMPONENT32_OES, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT_24_8_OES );
// Compressed formats
// From ES 3.0.1 spec, table 3.16
// | Internal format | Format | Type |
// | | | |
InsertES3FormatCombo(&set, GL_COMPRESSED_R11_EAC, GL_COMPRESSED_R11_EAC, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_R11_EAC, GL_COMPRESSED_R11_EAC, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_SIGNED_R11_EAC, GL_COMPRESSED_SIGNED_R11_EAC, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_RG11_EAC, GL_COMPRESSED_RG11_EAC, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_SIGNED_RG11_EAC, GL_COMPRESSED_SIGNED_RG11_EAC, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_RGB8_ETC2, GL_COMPRESSED_RGB8_ETC2, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_SRGB8_ETC2, GL_COMPRESSED_SRGB8_ETC2, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, GL_UNSIGNED_BYTE);
// From GL_EXT_texture_compression_dxt1
InsertES3FormatCombo(&set, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE);
InsertES3FormatCombo(&set, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE);
// From GL_ANGLE_texture_compression_dxt3
InsertES3FormatCombo(&set, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_UNSIGNED_BYTE);
// From GL_ANGLE_texture_compression_dxt5
InsertES3FormatCombo(&set, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE);
return set; return set;
} }
...@@ -406,6 +379,12 @@ bool ValidateES3TexImageParameters(Context *context, GLenum target, GLint level, ...@@ -406,6 +379,12 @@ bool ValidateES3TexImageParameters(Context *context, GLenum target, GLint level,
return false; return false;
} }
if (!actualFormatInfo.textureSupport(context->getClientVersion(), context->getExtensions()))
{
context->recordError(Error(GL_INVALID_ENUM));
return false;
}
if (target == GL_TEXTURE_3D) if (target == GL_TEXTURE_3D)
{ {
context->recordError(Error(GL_INVALID_OPERATION)); context->recordError(Error(GL_INVALID_OPERATION));
......
...@@ -1068,8 +1068,6 @@ ...@@ -1068,8 +1068,6 @@
1101 WIN : dEQP-GLES3.functional.negative_api.buffer.renderbuffer_storage_multisample = FAIL 1101 WIN : dEQP-GLES3.functional.negative_api.buffer.renderbuffer_storage_multisample = FAIL
1101 WIN : dEQP-GLES3.functional.negative_api.texture.bindtexture = FAIL 1101 WIN : dEQP-GLES3.functional.negative_api.texture.bindtexture = FAIL
1101 WIN : dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage2d = FAIL 1101 WIN : dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage2d = FAIL
1101 WIN : dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage2d_neg_level = FAIL
1101 WIN : dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage2d_max_level = FAIL
1101 WIN : dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage2d_invalid_size = FAIL 1101 WIN : dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage2d_invalid_size = FAIL
1101 WIN : dEQP-GLES3.functional.negative_api.texture.teximage3d = FAIL 1101 WIN : dEQP-GLES3.functional.negative_api.texture.teximage3d = FAIL
1101 WIN : dEQP-GLES3.functional.negative_api.texture.texsubimage3d = FAIL 1101 WIN : dEQP-GLES3.functional.negative_api.texture.texsubimage3d = FAIL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment