diff --git a/src/dawn_native/opengl/BackendGL.cpp b/src/dawn_native/opengl/BackendGL.cpp index ac1c67f3d1..394179c168 100644 --- a/src/dawn_native/opengl/BackendGL.cpp +++ b/src/dawn_native/opengl/BackendGL.cpp @@ -183,6 +183,10 @@ namespace dawn_native { namespace opengl { mDriverDescription = std::string("OpenGL version ") + reinterpret_cast(mFunctions.GetString(GL_VERSION)); + if (mPCIInfo.name.find("SwiftShader") != std::string::npos) { + mAdapterType = wgpu::AdapterType::CPU; + } + InitializeSupportedExtensions(); return {}; diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp index b45fb61ae1..a6ce3e5da8 100644 --- a/src/tests/DawnTest.cpp +++ b/src/tests/DawnTest.cpp @@ -439,7 +439,8 @@ void DawnTestEnvironment::SelectPreferredAdapterProperties(const dawn_native::In // If we ever have Swiftshader GL (unlikely), we could set the DeviceType properly. (preferredDeviceType != dawn_native::DeviceType::CPU && adapter.GetDeviceType() == dawn_native::DeviceType::Unknown && - properties.backendType == wgpu::BackendType::OpenGL) || + (properties.backendType == wgpu::BackendType::OpenGL || + properties.backendType == wgpu::BackendType::OpenGLES)) || // Always select the Null backend. There are few tests on this backend, and they run // quickly. This is temporary as to not lose coverage. We can group it with // Swiftshader as a CPU adapter when we have Swiftshader tests. diff --git a/src/tests/end2end/BufferZeroInitTests.cpp b/src/tests/end2end/BufferZeroInitTests.cpp index 029a072fb1..64b859b34c 100644 --- a/src/tests/end2end/BufferZeroInitTests.cpp +++ b/src/tests/end2end/BufferZeroInitTests.cpp @@ -980,6 +980,9 @@ TEST_P(BufferZeroInitTest, Copy2DArrayTextureToBuffer) { // Test that the buffer will be lazy initialized correctly when its first use is to be bound as a // uniform buffer. TEST_P(BufferZeroInitTest, BoundAsUniformBuffer) { + // TODO(crbug.com/dawn/661): Diagnose and fix this backend validation failure on GLES. + DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); + const char* computeShader = R"( #version 450 layout(set = 0, binding = 0, std140) uniform UBO { @@ -1016,6 +1019,9 @@ TEST_P(BufferZeroInitTest, BoundAsUniformBuffer) { // Test that the buffer will be lazy initialized correctly when its first use is to be bound as a // read-only storage buffer. TEST_P(BufferZeroInitTest, BoundAsReadonlyStorageBuffer) { + // TODO(crbug.com/dawn/661): Diagnose and fix this backend validation failure on GLES. + DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); + const char* computeShader = R"( #version 450 layout(set = 0, binding = 0, std140) readonly buffer SSBO { @@ -1052,6 +1058,9 @@ TEST_P(BufferZeroInitTest, BoundAsReadonlyStorageBuffer) { // Test that the buffer will be lazy initialized correctly when its first use is to be bound as a // storage buffer. TEST_P(BufferZeroInitTest, BoundAsStorageBuffer) { + // TODO(crbug.com/dawn/661): Diagnose and fix this backend validation failure on GLES. + DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); + // TODO(crbug.com/tint/375): Enable once barriers are implemented DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator")); const char* computeShader = R"( @@ -1162,6 +1171,9 @@ TEST_P(BufferZeroInitTest, IndirectBufferForDrawIndexedIndirect) { // Test the buffer will be lazily initialized correctly when its first use is an indirect buffer for // DispatchIndirect. TEST_P(BufferZeroInitTest, IndirectBufferForDispatchIndirect) { + // TODO(crbug.com/dawn/661): Diagnose and fix this backend validation failure on GLES. + DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); + // Bind the whole buffer as an indirect buffer. { constexpr uint64_t kOffset = 0u; diff --git a/src/tests/end2end/EntryPointTests.cpp b/src/tests/end2end/EntryPointTests.cpp index 6f1f5563a3..6cc370ad85 100644 --- a/src/tests/end2end/EntryPointTests.cpp +++ b/src/tests/end2end/EntryPointTests.cpp @@ -22,7 +22,7 @@ class EntryPointTests : public DawnTest {}; // Test creating a render pipeline from two entryPoints in the same module. TEST_P(EntryPointTests, FragAndVertexSameModule) { // TODO(crbug.com/dawn/658): Crashes on bots - DAWN_SKIP_TEST_IF(IsOpenGL()); + DAWN_SKIP_TEST_IF(IsOpenGL() || IsOpenGLES()); wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"( [[builtin(position)]] var Position : vec4; diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp index ffdc643015..fb40b4d57f 100644 --- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp +++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp @@ -230,6 +230,10 @@ TEST_P(GpuMemorySyncTests, ComputePassToRenderPass) { // Use an image as both sampled and readonly storage in a compute pass. This is a regression test // for the Vulkan backend choosing different layouts for Sampled and ReadOnlyStorage. TEST_P(GpuMemorySyncTests, SampledAndROStorageTextureInComputePass) { + // TODO(crbug.com/dawn/646): diagnose and fix this OpenGL ES backend validation failure. + // "GL_INVALID_OPERATION error generated. Image variable update is not allowed." + DAWN_SKIP_TEST_IF(IsOpenGLES() && IsBackendValidationEnabled()); + // Create a storage + sampled texture of one texel initialized to 1 wgpu::TextureDescriptor texDesc; texDesc.format = wgpu::TextureFormat::R32Uint; diff --git a/src/tests/end2end/StorageTextureTests.cpp b/src/tests/end2end/StorageTextureTests.cpp index 19ad706729..38eff079c4 100644 --- a/src/tests/end2end/StorageTextureTests.cpp +++ b/src/tests/end2end/StorageTextureTests.cpp @@ -691,6 +691,9 @@ 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; @@ -729,6 +732,9 @@ 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; @@ -911,6 +917,9 @@ 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; @@ -944,6 +953,9 @@ 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; @@ -1166,6 +1178,9 @@ 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); @@ -1190,6 +1205,9 @@ 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); @@ -1217,6 +1235,9 @@ 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( @@ -1230,6 +1251,9 @@ 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(