Sfoglia il codice sorgente

Replace gl_VertexID by gl_VertexIndex in shaders

Popov72 4 anni fa
parent
commit
a6084af7c5
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      src/Engines/WebGPU/webgpuShaderProcessors.ts

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

@@ -245,6 +245,7 @@ export class WebGPUShaderProcessor implements IShaderProcessor {
             code = code.replace(/void\s+?main\s*\(/g, (hasDrawBuffersExtension ? "" : "layout(location = 0) out vec4 glFragColor;\n") + "void main(");
         } else {
             code = code.replace(/gl_InstanceID/g, "gl_InstanceIndex");
+            code = code.replace(/gl_VertexID/g, "gl_VertexIndex");
             var hasMultiviewExtension = defines.indexOf("#define MULTIVIEW") !== -1;
             if (hasMultiviewExtension) {
                 return "#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n" + code;