Skip to content

Commit 3ba1df3

Browse files
authored
WebGPURenderer: Ensure valid render pipelines when using depthBias. (#33471)
1 parent c48a5b1 commit 3ba1df3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/renderers/webgpu/utils/WebGPUPipelineUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BlendColorFactor, OneMinusBlendColorFactor, } from '../../common/Constants.js';
22

33
import {
4-
GPUFrontFace, GPUCullMode, GPUColorWriteFlags, GPUCompareFunction, GPUBlendFactor, GPUBlendOperation, GPUIndexFormat, GPUStencilOperation
4+
GPUFrontFace, GPUCullMode, GPUColorWriteFlags, GPUCompareFunction, GPUBlendFactor, GPUBlendOperation, GPUIndexFormat, GPUStencilOperation, GPUPrimitiveTopology
55
} from './WebGPUConstants.js';
66

77
import {
@@ -256,7 +256,7 @@ class WebGPUPipelineUtils {
256256

257257
}
258258

259-
if ( material.polygonOffset === true ) {
259+
if ( material.polygonOffset === true && ( primitiveState.topology === GPUPrimitiveTopology.TriangleList ) ) {
260260

261261
depthStencil.depthBias = material.polygonOffsetUnits;
262262
depthStencil.depthBiasSlopeScale = material.polygonOffsetFactor;

0 commit comments

Comments
 (0)