From b5c5df50ab385e52dbae22ee6b5761780291bed9 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Tue, 29 Mar 2022 16:34:23 +0000 Subject: [PATCH] Implement support for depth24stencil8 on OpenGL. Covered by existing tests. Change-Id: Ibb6daf8cd195474560a306e830d69c484579ae1c Bug: dawn:1338 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85140 Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Commit-Queue: Stephen White --- src/dawn/native/opengl/BackendGL.cpp | 1 + src/dawn/native/opengl/GLFormat.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/dawn/native/opengl/BackendGL.cpp b/src/dawn/native/opengl/BackendGL.cpp index ed8f15b675..aac0c14c50 100644 --- a/src/dawn/native/opengl/BackendGL.cpp +++ b/src/dawn/native/opengl/BackendGL.cpp @@ -244,6 +244,7 @@ namespace dawn::native::opengl { supportsBPTC) { mSupportedFeatures.EnableFeature(dawn::native::Feature::TextureCompressionBC); } + mSupportedFeatures.EnableFeature(Feature::Depth24UnormStencil8); } return {}; diff --git a/src/dawn/native/opengl/GLFormat.cpp b/src/dawn/native/opengl/GLFormat.cpp index 36e40a97f0..a0ae13ec86 100644 --- a/src/dawn/native/opengl/GLFormat.cpp +++ b/src/dawn/native/opengl/GLFormat.cpp @@ -93,6 +93,7 @@ namespace dawn::native::opengl { // Depth stencil formats AddFormat(wgpu::TextureFormat::Depth32Float, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, Type::DepthStencil); AddFormat(wgpu::TextureFormat::Depth24Plus, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, Type::DepthStencil); + AddFormat(wgpu::TextureFormat::Depth24UnormStencil8, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, Type::DepthStencil); AddFormat(wgpu::TextureFormat::Depth24PlusStencil8, GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, Type::DepthStencil); AddFormat(wgpu::TextureFormat::Depth16Unorm, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, Type::DepthStencil); AddFormat(wgpu::TextureFormat::Stencil8, GL_STENCIL_INDEX8, GL_STENCIL, GL_UNSIGNED_BYTE, Type::DepthStencil);