Skip to content

Commit 3fddc5c

Browse files
authored
WebGPURenderer: Fix depth/stencil format out-of-sync bug. (#32731)
1 parent 2ec2102 commit 3fddc5c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/renderers/webgpu/utils/WebGPUUtils.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,21 @@ class WebGPUUtils {
3434

3535
let format;
3636

37-
if ( renderContext.depthTexture !== null ) {
37+
if ( renderContext.depth ) {
3838

39-
format = this.getTextureFormatGPU( renderContext.depthTexture );
39+
if ( renderContext.depthTexture !== null ) {
4040

41-
} else if ( renderContext.depth && renderContext.stencil ) {
41+
format = this.getTextureFormatGPU( renderContext.depthTexture );
4242

43-
format = GPUTextureFormat.Depth24PlusStencil8;
43+
} else if ( renderContext.stencil ) {
4444

45-
} else if ( renderContext.depth ) {
45+
format = GPUTextureFormat.Depth24PlusStencil8;
4646

47-
format = GPUTextureFormat.Depth24Plus;
47+
} else {
48+
49+
format = GPUTextureFormat.Depth24Plus;
50+
51+
}
4852

4953
}
5054

0 commit comments

Comments
 (0)