瀏覽代碼

Remove unneeded code in getBindGroupsToRender

Popov72 4 年之前
父節點
當前提交
6b70b6e377
共有 1 個文件被更改,包括 4 次插入18 次删除
  1. 4 18
      src/Engines/webgpuEngine.ts

+ 4 - 18
src/Engines/webgpuEngine.ts

@@ -3390,7 +3390,7 @@ export class WebGPUEngine extends Engine {
         return vertexInputs;
         return vertexInputs;
     }
     }
 
 
-    private _getBindGroupsToRender(renderPipeline: GPURenderPipeline): GPUBindGroup[] {
+    private _getBindGroupsToRender(): GPUBindGroup[] {
         const webgpuPipelineContext = this._currentEffect!._pipelineContext as WebGPUPipelineContext;
         const webgpuPipelineContext = this._currentEffect!._pipelineContext as WebGPUPipelineContext;
         let bindGroups: GPUBindGroup[] = [];
         let bindGroups: GPUBindGroup[] = [];
 
 
@@ -3406,14 +3406,7 @@ export class WebGPUEngine extends Engine {
         for (let i = 0; i < webgpuPipelineContext.shaderProcessingContext.orderedUBOsAndSamplers.length; i++) {
         for (let i = 0; i < webgpuPipelineContext.shaderProcessingContext.orderedUBOsAndSamplers.length; i++) {
             const setDefinition = webgpuPipelineContext.shaderProcessingContext.orderedUBOsAndSamplers[i];
             const setDefinition = webgpuPipelineContext.shaderProcessingContext.orderedUBOsAndSamplers[i];
             if (setDefinition === undefined) {
             if (setDefinition === undefined) {
-                let groupLayout: GPUBindGroupLayout;
-                if (bindGroupLayouts && bindGroupLayouts[i]) {
-                    groupLayout = bindGroupLayouts[i];
-                }
-                else {
-                    // TODO WEBGPU can it happens? we should be able to avoid a dependency on renderPipeline here
-                    groupLayout = renderPipeline.getBindGroupLayout(i);
-                }
+                let groupLayout = bindGroupLayouts[i];
                 bindGroups[i] = this._device.createBindGroup({
                 bindGroups[i] = this._device.createBindGroup({
                     layout: groupLayout,
                     layout: groupLayout,
                     entries: [],
                     entries: [],
@@ -3497,14 +3490,7 @@ export class WebGPUEngine extends Engine {
             }
             }
 
 
             if (entries.length > 0) {
             if (entries.length > 0) {
-                let groupLayout: GPUBindGroupLayout;
-                if (bindGroupLayouts && bindGroupLayouts[i]) {
-                    groupLayout = bindGroupLayouts[i];
-                }
-                else {
-                    // TODO WEBGPU can it happens? we should be able to avoid a dependency on renderPipeline here
-                    groupLayout = renderPipeline.getBindGroupLayout(i);
-                }
+                let groupLayout = bindGroupLayouts[i];
                 bindGroups[i] = this._device.createBindGroup({
                 bindGroups[i] = this._device.createBindGroup({
                     layout: groupLayout,
                     layout: groupLayout,
                     entries,
                     entries,
@@ -3551,7 +3537,7 @@ export class WebGPUEngine extends Engine {
         const vertexInputs = this._getVertexInputsToRender();
         const vertexInputs = this._getVertexInputsToRender();
         this._bindVertexInputs(vertexInputs);
         this._bindVertexInputs(vertexInputs);
 
 
-        const bindGroups = this._getBindGroupsToRender(pipeline);
+        const bindGroups = this._getBindGroupsToRender();
         this._setRenderBindGroups(bindGroups);
         this._setRenderBindGroups(bindGroups);
 
 
         if (this._stencilState.stencilTest) {
         if (this._stencilState.stencilTest) {