GLES: revert part of the view format reinterpretation on GLES.

View format reinterpretation doesn't work, but its implementation was causing failures on other content.

This patch came from: https://dawn-review.googlesource.com/c/dawn/+/84704/comments/339d5a75_5dce5ce3

Bug: dawn:1360
Change-Id: I76adc264d6f185f840d975b46b6e92a0e5a7b4a8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86362
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2022-04-12 03:31:16 +00:00 committed by Dawn LUCI CQ
parent 8085367233
commit cedd55a9bf
2 changed files with 9 additions and 5 deletions

View File

@ -612,8 +612,12 @@ namespace dawn::native::opengl {
void TextureView::BindToFramebuffer(GLenum target, GLenum attachment) { void TextureView::BindToFramebuffer(GLenum target, GLenum attachment) {
const OpenGLFunctions& gl = ToBackend(GetDevice())->gl; const OpenGLFunctions& gl = ToBackend(GetDevice())->gl;
// Use the base texture where possible to minimize the amount of copying required on GLES.
bool useOwnView = GetFormat().format != GetTexture()->GetFormat().format &&
!GetTexture()->GetFormat().HasDepthOrStencil();
GLuint handle, textarget, mipLevel, arrayLayer; GLuint handle, textarget, mipLevel, arrayLayer;
if (mOwnsHandle) { if (useOwnView) {
// Use our own texture handle and target which points to a subset of the texture's // Use our own texture handle and target which points to a subset of the texture's
// subresources. // subresources.
handle = GetHandle(); handle = GetHandle();
@ -622,7 +626,7 @@ namespace dawn::native::opengl {
arrayLayer = 0; arrayLayer = 0;
} else { } else {
// Use the texture's handle and target, with the view's base mip level and base array // Use the texture's handle and target, with the view's base mip level and base array
// layer.
handle = ToBackend(GetTexture())->GetHandle(); handle = ToBackend(GetTexture())->GetHandle();
textarget = ToBackend(GetTexture())->GetGLTarget(); textarget = ToBackend(GetTexture())->GetGLTarget();
mipLevel = GetBaseMipLevel(); mipLevel = GetBaseMipLevel();

View File

@ -435,7 +435,7 @@ TEST_P(TextureViewSamplingTest, Texture2DArrayViewOnOneLevelOf2DArrayTexture) {
// Test that an RGBA8 texture may be interpreted as RGBA8UnormSrgb and sampled from. // Test that an RGBA8 texture may be interpreted as RGBA8UnormSrgb and sampled from.
// More extensive color value checks and format tests are left for the CTS. // More extensive color value checks and format tests are left for the CTS.
TEST_P(TextureViewSamplingTest, SRGBReinterpretation) { TEST_P(TextureViewSamplingTest, SRGBReinterpretation) {
// TODO(crbug.com/dawn/593): This test requires glTextureView, which is unsupported on GLES. // TODO(crbug.com/dawn/1360): OpenGLES doesn't support view format reinterpretation.
DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES()); DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES());
wgpu::TextureViewDescriptor viewDesc = {}; wgpu::TextureViewDescriptor viewDesc = {};
@ -769,7 +769,7 @@ TEST_P(TextureViewRenderingTest, Texture2DArrayViewOnALayerOf2DArrayTextureAsCol
// Test that an RGBA8 texture may be interpreted as RGBA8UnormSrgb and rendered to. // Test that an RGBA8 texture may be interpreted as RGBA8UnormSrgb and rendered to.
// More extensive color value checks and format tests are left for the CTS. // More extensive color value checks and format tests are left for the CTS.
TEST_P(TextureViewRenderingTest, SRGBReinterpretationRenderAttachment) { TEST_P(TextureViewRenderingTest, SRGBReinterpretationRenderAttachment) {
// TODO(crbug.com/dawn/593): This test requires glTextureView, which is unsupported on GLES. // TODO(crbug.com/dawn/1360): OpenGLES doesn't support view format reinterpretation.
DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES()); DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES());
// Test will render into an SRGB view // Test will render into an SRGB view
@ -875,7 +875,7 @@ TEST_P(TextureViewRenderingTest, SRGBReinterpretationRenderAttachment) {
// This test samples the RGBA8Unorm texture into an RGBA8Unorm multisample texture viewed as SRGB, // This test samples the RGBA8Unorm texture into an RGBA8Unorm multisample texture viewed as SRGB,
// and resolves it into an RGBA8Unorm texture, viewed as SRGB. // and resolves it into an RGBA8Unorm texture, viewed as SRGB.
TEST_P(TextureViewRenderingTest, SRGBReinterpretionResolveAttachment) { TEST_P(TextureViewRenderingTest, SRGBReinterpretionResolveAttachment) {
// TODO(crbug.com/dawn/593): This test requires glTextureView, which is unsupported on GLES. // TODO(crbug.com/dawn/1360): OpenGLES doesn't support view format reinterpretation.
DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES()); DAWN_TEST_UNSUPPORTED_IF(IsOpenGLES());
// Test will resolve into an SRGB view // Test will resolve into an SRGB view