瀏覽代碼

Fix pre-pass renderer with webgpu

Popov72 4 年之前
父節點
當前提交
515555bc65
共有 2 個文件被更改,包括 1 次插入3 次删除
  1. 1 1
      src/Engines/WebGPU/webgpuShaderProcessors.ts
  2. 0 2
      src/Shaders/ShadersInclude/prePassDeclaration.fx

+ 1 - 1
src/Engines/WebGPU/webgpuShaderProcessors.ts

@@ -90,7 +90,7 @@ export class WebGPUShaderProcessor implements IShaderProcessor {
 
         const webgpuProcessingContext = processingContext! as WebGPUShaderProcessingContext;
 
-        const varyingRegex = new RegExp(/\s*varying\s+(\S+)\s+(\S+)\s*;/gm);
+        const varyingRegex = new RegExp(/\s*varying\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/gm);
         const match = varyingRegex.exec(varying);
         if (match != null) {
             const varyingType = match[1];

+ 0 - 2
src/Shaders/ShadersInclude/prePassDeclaration.fx

@@ -1,9 +1,7 @@
 #ifdef PREPASS
 #extension GL_EXT_draw_buffers : require
-#ifdef WEBGL2
 layout(location = 0) out highp vec4 glFragData[{X}];
 highp vec4 gl_FragColor;
-#endif
 
 #ifdef PREPASS_DEPTHNORMAL
     varying highp vec3 vViewPos;