From 4846281d3680e1e34ffeebe556ca25c285bc1151 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Thu, 4 Feb 2021 22:17:52 +0000 Subject: [PATCH] Don't call glUniform for Storage Texture on OpenGL ES. Change-Id: I8595fb2c89e45819995748e502b800fb88605f44 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/40341 Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Commit-Queue: Stephen White --- src/dawn_native/opengl/PipelineGL.cpp | 8 +++++--- src/tests/end2end/StorageTextureTests.cpp | 24 ----------------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/src/dawn_native/opengl/PipelineGL.cpp b/src/dawn_native/opengl/PipelineGL.cpp index 0039c1eb5c..c40d25d55f 100644 --- a/src/dawn_native/opengl/PipelineGL.cpp +++ b/src/dawn_native/opengl/PipelineGL.cpp @@ -173,9 +173,11 @@ namespace dawn_native { namespace opengl { break; case BindingInfoType::StorageTexture: { - GLint location = gl.GetUniformLocation(mProgram, name.c_str()); - if (location != -1) { - gl.Uniform1i(location, indices[group][bindingIndex]); + if (gl.GetVersion().IsDesktop()) { + GLint location = gl.GetUniformLocation(mProgram, name.c_str()); + if (location != -1) { + gl.Uniform1i(location, indices[group][bindingIndex]); + } } break; } diff --git a/src/tests/end2end/StorageTextureTests.cpp b/src/tests/end2end/StorageTextureTests.cpp index 38eff079c4..19ad706729 100644 --- a/src/tests/end2end/StorageTextureTests.cpp +++ b/src/tests/end2end/StorageTextureTests.cpp @@ -691,9 +691,6 @@ TEST_P(StorageTextureTests, BindGroupLayoutWithStorageTextureBindingType) { // Test that read-only storage textures are supported in compute shader. TEST_P(StorageTextureTests, ReadonlyStorageTextureInComputeShader) { - // TODO(crbug.com/dawn/624): this test fails validation on GLES. Investigate why. - DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); - for (wgpu::TextureFormat format : utils::kAllTextureFormats) { if (!utils::TextureFormatSupportsStorageTexture(format)) { continue; @@ -732,9 +729,6 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInComputeShader) { // Test that read-only storage textures are supported in vertex shader. TEST_P(StorageTextureTests, ReadonlyStorageTextureInVertexShader) { - // TODO(crbug.com/dawn/624): this test fails validation on GLES. Investigate why. - DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); - for (wgpu::TextureFormat format : utils::kAllTextureFormats) { if (!utils::TextureFormatSupportsStorageTexture(format)) { continue; @@ -917,9 +911,6 @@ TEST_P(StorageTextureTests, WriteonlyStorageTextureInFragmentShader) { // Verify 2D array read-only storage texture works correctly. TEST_P(StorageTextureTests, Readonly2DArrayStorageTexture) { - // TODO(crbug.com/dawn/624): this test fails validation on GLES. Investigate why. - DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); - constexpr uint32_t kArrayLayerCount = 3u; constexpr wgpu::TextureFormat kTextureFormat = wgpu::TextureFormat::R32Uint; @@ -953,9 +944,6 @@ TEST_P(StorageTextureTests, Readonly2DArrayStorageTexture) { // Verify 2D array write-only storage texture works correctly. TEST_P(StorageTextureTests, Writeonly2DArrayStorageTexture) { - // TODO(crbug.com/dawn/624): this test fails validation on GLES. Investigate why. - DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); - constexpr uint32_t kArrayLayerCount = 3u; constexpr wgpu::TextureFormat kTextureFormat = wgpu::TextureFormat::R32Uint; @@ -1178,9 +1166,6 @@ fn doTest() -> bool { // Verify that the texture is correctly cleared to 0 before its first usage as a read-only storage // texture in a render pass. TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInRenderPass) { - // TODO(crbug.com/dawn/624): this test fails validation on GLES. Investigate why. - DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); - wgpu::Texture readonlyStorageTexture = CreateTexture(wgpu::TextureFormat::R32Uint, wgpu::TextureUsage::Storage); @@ -1205,9 +1190,6 @@ TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInRenderPa // Verify that the texture is correctly cleared to 0 before its first usage as a read-only storage // texture in a compute pass. TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInComputePass) { - // TODO(crbug.com/dawn/624): this test fails validation on GLES. Investigate why. - DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); - wgpu::Texture readonlyStorageTexture = CreateTexture(wgpu::TextureFormat::R32Uint, wgpu::TextureUsage::Storage); @@ -1235,9 +1217,6 @@ TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInComputeP // Verify that the texture is correctly cleared to 0 before its first usage as a write-only storage // storage texture in a render pass. TEST_P(StorageTextureZeroInitTests, WriteonlyStorageTextureClearsToZeroInRenderPass) { - // TODO(crbug.com/dawn/624): this test fails validation on GLES. Investigate why. - DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); - // Prepare the write-only storage texture. constexpr uint32_t kTexelSizeR32Uint = 4u; wgpu::Texture writeonlyStorageTexture = CreateTexture( @@ -1251,9 +1230,6 @@ TEST_P(StorageTextureZeroInitTests, WriteonlyStorageTextureClearsToZeroInRenderP // Verify that the texture is correctly cleared to 0 before its first usage as a write-only storage // texture in a compute pass. TEST_P(StorageTextureZeroInitTests, WriteonlyStorageTextureClearsToZeroInComputePass) { - // TODO(crbug.com/dawn/624): this test fails validation on GLES. Investigate why. - DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); - // Prepare the write-only storage texture. constexpr uint32_t kTexelSizeR32Uint = 4u; wgpu::Texture writeonlyStorageTexture = CreateTexture(