Просмотр исходного кода

WebGPURenderer: Ensure valid render pipelines when using `depthBias`. (#33471)

Michael Herzog 1 месяц назад
Родитель
Сommit
3ba1df353f
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/renderers/webgpu/utils/WebGPUPipelineUtils.js

+ 2 - 2
src/renderers/webgpu/utils/WebGPUPipelineUtils.js

@@ -1,7 +1,7 @@
 import { BlendColorFactor, OneMinusBlendColorFactor, } from '../../common/Constants.js';
 
 import {
-	GPUFrontFace, GPUCullMode, GPUColorWriteFlags, GPUCompareFunction, GPUBlendFactor, GPUBlendOperation, GPUIndexFormat, GPUStencilOperation
+	GPUFrontFace, GPUCullMode, GPUColorWriteFlags, GPUCompareFunction, GPUBlendFactor, GPUBlendOperation, GPUIndexFormat, GPUStencilOperation, GPUPrimitiveTopology
 } from './WebGPUConstants.js';
 
 import {
@@ -256,7 +256,7 @@ class WebGPUPipelineUtils {
 
 			}
 
-			if ( material.polygonOffset === true ) {
+			if ( material.polygonOffset === true && ( primitiveState.topology === GPUPrimitiveTopology.TriangleList ) ) {
 
 				depthStencil.depthBias = material.polygonOffsetUnits;
 				depthStencil.depthBiasSlopeScale = material.polygonOffsetFactor;

粤ICP备19079148号