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,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;
}

View File

@ -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(