Commit 7af2676b by Tobin Ehlis Committed by Commit Bot

Fix TextureAttachment support for unsized DS formats

Unsized DS formats should not pick up support from ES3 automatically. Also unsized DEPTH COMPONENT textures should not be allowed as texture attachments without also having support for GL_ANGLE_depth_texture or GL_OES_depth_texture extensions. This change modifies some unsized formats to require extension support for TextureAttachment use. There are a couple of tests bugs that were exposed by this change so updated those tests as well. This CL only changes TextureAttachment support, but it's quite possible that renderbuffer (and texture) support may also need to be updated. Will attempt that in a follow-on. Bug: angleproject:3952 Change-Id: I75d15330dc418c421cd2855135e1e8100a89b2e8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1877135Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent a2e66a5e
...@@ -1055,11 +1055,11 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() ...@@ -1055,11 +1055,11 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
// Unsized depth stencil formats // Unsized depth stencil formats
// | Internal format |sized | D |S | X | Format | Type | Component type | Texture supported | Filterable | Texture attachment | Renderbuffer | // | Internal format |sized | D |S | X | Format | Type | Component type | Texture supported | Filterable | Texture attachment | Renderbuffer |
AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT, false, 16, 0, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_UNSIGNED_NORMALIZED, RequireES<1, 0>, AlwaysSupported, RequireES<1, 0>, RequireES<1, 0> ); AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT, false, 16, 0, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_UNSIGNED_NORMALIZED, RequireES<1, 0>, AlwaysSupported, RequireExtOrExt<&Extensions::depthTextureANGLE, &Extensions::depthTextureOES>, RequireES<1, 0> );
AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT, false, 24, 0, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_UNSIGNED_NORMALIZED, RequireES<1, 0>, AlwaysSupported, RequireES<1, 0>, RequireES<1, 0> ); AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT, false, 24, 0, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_UNSIGNED_NORMALIZED, RequireES<1, 0>, AlwaysSupported, RequireExtOrExt<&Extensions::depthTextureANGLE, &Extensions::depthTextureOES>, RequireES<1, 0> );
AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT, false, 32, 0, 0, GL_DEPTH_COMPONENT, GL_FLOAT, GL_FLOAT, RequireES<1, 0>, AlwaysSupported, RequireES<1, 0>, RequireES<1, 0> ); AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT, false, 32, 0, 0, GL_DEPTH_COMPONENT, GL_FLOAT, GL_FLOAT, RequireES<1, 0>, AlwaysSupported, RequireES<1, 0>, RequireES<1, 0> );
AddDepthStencilFormat(&map, GL_DEPTH_STENCIL, false, 24, 8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_UNSIGNED_NORMALIZED, RequireESOrExt<3, 0, &Extensions::packedDepthStencil>, AlwaysSupported, RequireESOrExt<3, 0, &Extensions::packedDepthStencil>, RequireESOrExt<3, 0, &Extensions::packedDepthStencil>); AddDepthStencilFormat(&map, GL_DEPTH_STENCIL, false, 24, 8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_UNSIGNED_NORMALIZED, RequireESOrExt<3, 0, &Extensions::packedDepthStencil>, AlwaysSupported, RequireExtAndExt<&Extensions::packedDepthStencil, &Extensions::depthTextureANGLE>, RequireESOrExt<3, 0, &Extensions::packedDepthStencil>);
AddDepthStencilFormat(&map, GL_DEPTH_STENCIL, false, 32, 8, 24, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_FLOAT, RequireESOrExt<3, 0, &Extensions::packedDepthStencil>, AlwaysSupported, RequireESOrExt<3, 0, &Extensions::packedDepthStencil>, RequireESOrExt<3, 0, &Extensions::packedDepthStencil>); AddDepthStencilFormat(&map, GL_DEPTH_STENCIL, false, 32, 8, 24, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_FLOAT, RequireESOrExt<3, 0, &Extensions::packedDepthStencil>, AlwaysSupported, RequireExt<&Extensions::packedDepthStencil>, RequireESOrExt<3, 0, &Extensions::packedDepthStencil>);
AddDepthStencilFormat(&map, GL_STENCIL, false, 0, 8, 0, GL_STENCIL, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, RequireES<1, 0>, NeverSupported , RequireES<1, 0>, RequireES<1, 0> ); AddDepthStencilFormat(&map, GL_STENCIL, false, 0, 8, 0, GL_STENCIL, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, RequireES<1, 0>, NeverSupported , RequireES<1, 0>, RequireES<1, 0> );
// clang-format on // clang-format on
......
...@@ -574,11 +574,6 @@ ...@@ -574,11 +574,6 @@
// Fails only with SwiftShader: // Fails only with SwiftShader:
3952 VULKAN SWIFTSHADER : dEQP-GLES3.functional.fbo.completeness.renderable.texture.stencil.depth_stencil_unsigned_int_24_8 = FAIL
3952 VULKAN SWIFTSHADER : dEQP-GLES3.functional.fbo.completeness.renderable.texture.depth.depth_component_unsigned_short = FAIL
3952 VULKAN SWIFTSHADER : dEQP-GLES3.functional.fbo.completeness.renderable.texture.depth.depth_component_unsigned_int = FAIL
3952 VULKAN SWIFTSHADER : dEQP-GLES3.functional.fbo.completeness.renderable.texture.depth.depth_stencil_unsigned_int_24_8 = FAIL
4037 VULKAN SWIFTSHADER : dEQP-GLES3.functional.fbo.blit.depth_stencil.*stencil8_scale = FAIL 4037 VULKAN SWIFTSHADER : dEQP-GLES3.functional.fbo.blit.depth_stencil.*stencil8_scale = FAIL
4013 VULKAN SWIFTSHADER : dEQP-GLES3.functional.fbo.invalidate.*.unbind_blit* = FAIL 4013 VULKAN SWIFTSHADER : dEQP-GLES3.functional.fbo.invalidate.*.unbind_blit* = FAIL
...@@ -4976,6 +4976,8 @@ TEST_P(Texture2DDepthTest, DepthTextureES2Compatibility) ...@@ -4976,6 +4976,8 @@ TEST_P(Texture2DDepthTest, DepthTextureES2Compatibility)
{ {
ANGLE_SKIP_TEST_IF(IsD3D11()); ANGLE_SKIP_TEST_IF(IsD3D11());
ANGLE_SKIP_TEST_IF(IsIntel() && IsD3D9()); ANGLE_SKIP_TEST_IF(IsIntel() && IsD3D9());
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_depth_texture") &&
!IsGLExtensionEnabled("GL_OES_depth_texture"));
// When the depth texture is specified with unsized internalformat implementations follow // When the depth texture is specified with unsized internalformat implementations follow
// OES_depth_texture behavior. Otherwise they follow GLES 3.0 behavior. // OES_depth_texture behavior. Otherwise they follow GLES 3.0 behavior.
......
...@@ -3596,7 +3596,7 @@ void main() { ...@@ -3596,7 +3596,7 @@ void main() {
FillTexture2D(tex0.get(), width, height, GLColor::black, 0, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE); FillTexture2D(tex0.get(), width, height, GLColor::black, 0, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE);
FillTexture2D(tex1.get(), width, height, 0x80, 0, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, FillTexture2D(tex1.get(), width, height, 0x80, 0, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT,
GL_UNSIGNED_INT); GL_UNSIGNED_INT);
FillTexture2D(tex2.get(), width, height, 0x40, 0, GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, FillTexture2D(tex2.get(), width, height, 0x40, 0, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL,
GL_UNSIGNED_INT_24_8); GL_UNSIGNED_INT_24_8);
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
......
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