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 <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2021-02-04 22:17:52 +00:00 committed by Commit Bot service account
parent f92307dcc3
commit 4846281d36
2 changed files with 5 additions and 27 deletions

View File

@ -173,10 +173,12 @@ namespace dawn_native { namespace opengl {
break; break;
case BindingInfoType::StorageTexture: { case BindingInfoType::StorageTexture: {
if (gl.GetVersion().IsDesktop()) {
GLint location = gl.GetUniformLocation(mProgram, name.c_str()); GLint location = gl.GetUniformLocation(mProgram, name.c_str());
if (location != -1) { if (location != -1) {
gl.Uniform1i(location, indices[group][bindingIndex]); gl.Uniform1i(location, indices[group][bindingIndex]);
} }
}
break; break;
} }
} }

View File

@ -691,9 +691,6 @@ TEST_P(StorageTextureTests, BindGroupLayoutWithStorageTextureBindingType) {
// Test that read-only storage textures are supported in compute shader. // Test that read-only storage textures are supported in compute shader.
TEST_P(StorageTextureTests, ReadonlyStorageTextureInComputeShader) { 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) { for (wgpu::TextureFormat format : utils::kAllTextureFormats) {
if (!utils::TextureFormatSupportsStorageTexture(format)) { if (!utils::TextureFormatSupportsStorageTexture(format)) {
continue; continue;
@ -732,9 +729,6 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInComputeShader) {
// Test that read-only storage textures are supported in vertex shader. // Test that read-only storage textures are supported in vertex shader.
TEST_P(StorageTextureTests, ReadonlyStorageTextureInVertexShader) { 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) { for (wgpu::TextureFormat format : utils::kAllTextureFormats) {
if (!utils::TextureFormatSupportsStorageTexture(format)) { if (!utils::TextureFormatSupportsStorageTexture(format)) {
continue; continue;
@ -917,9 +911,6 @@ TEST_P(StorageTextureTests, WriteonlyStorageTextureInFragmentShader) {
// Verify 2D array read-only storage texture works correctly. // Verify 2D array read-only storage texture works correctly.
TEST_P(StorageTextureTests, Readonly2DArrayStorageTexture) { 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 uint32_t kArrayLayerCount = 3u;
constexpr wgpu::TextureFormat kTextureFormat = wgpu::TextureFormat::R32Uint; constexpr wgpu::TextureFormat kTextureFormat = wgpu::TextureFormat::R32Uint;
@ -953,9 +944,6 @@ TEST_P(StorageTextureTests, Readonly2DArrayStorageTexture) {
// Verify 2D array write-only storage texture works correctly. // Verify 2D array write-only storage texture works correctly.
TEST_P(StorageTextureTests, Writeonly2DArrayStorageTexture) { 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 uint32_t kArrayLayerCount = 3u;
constexpr wgpu::TextureFormat kTextureFormat = wgpu::TextureFormat::R32Uint; 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 // Verify that the texture is correctly cleared to 0 before its first usage as a read-only storage
// texture in a render pass. // texture in a render pass.
TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInRenderPass) { 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 = wgpu::Texture readonlyStorageTexture =
CreateTexture(wgpu::TextureFormat::R32Uint, wgpu::TextureUsage::Storage); 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 // Verify that the texture is correctly cleared to 0 before its first usage as a read-only storage
// texture in a compute pass. // texture in a compute pass.
TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInComputePass) { 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 = wgpu::Texture readonlyStorageTexture =
CreateTexture(wgpu::TextureFormat::R32Uint, wgpu::TextureUsage::Storage); 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 // Verify that the texture is correctly cleared to 0 before its first usage as a write-only storage
// storage texture in a render pass. // storage texture in a render pass.
TEST_P(StorageTextureZeroInitTests, WriteonlyStorageTextureClearsToZeroInRenderPass) { 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. // Prepare the write-only storage texture.
constexpr uint32_t kTexelSizeR32Uint = 4u; constexpr uint32_t kTexelSizeR32Uint = 4u;
wgpu::Texture writeonlyStorageTexture = CreateTexture( 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 // Verify that the texture is correctly cleared to 0 before its first usage as a write-only storage
// texture in a compute pass. // texture in a compute pass.
TEST_P(StorageTextureZeroInitTests, WriteonlyStorageTextureClearsToZeroInComputePass) { 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. // Prepare the write-only storage texture.
constexpr uint32_t kTexelSizeR32Uint = 4u; constexpr uint32_t kTexelSizeR32Uint = 4u;
wgpu::Texture writeonlyStorageTexture = CreateTexture( wgpu::Texture writeonlyStorageTexture = CreateTexture(