diff --git a/src/renderers/webgpu/nodes/WGSLNodeBuilder.js b/src/renderers/webgpu/nodes/WGSLNodeBuilder.js index aa68369e4c0e0e..e1abfaa83945f7 100644 --- a/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +++ b/src/renderers/webgpu/nodes/WGSLNodeBuilder.js @@ -1146,14 +1146,12 @@ class WGSLNodeBuilder extends NodeBuilder { if ( uniformsGroup === undefined ) { uniformsGroup = new NodeUniformsGroup( groupName, group ); + uniformsGroup.setVisibility( GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT | GPUShaderStage.COMPUTE ); this.uniformGroups[ groupName ] = uniformsGroup; } - // TODO: Verifier caches - uniformsGroup.setVisibility( GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT | GPUShaderStage.COMPUTE ); - // Add to bindings for this stage if not already present if ( bindings.indexOf( uniformsGroup ) === - 1 ) { diff --git a/src/renderers/webgpu/utils/WebGPUBindingUtils.js b/src/renderers/webgpu/utils/WebGPUBindingUtils.js index 3136a7bf2978c4..e08aeb5601e28c 100644 --- a/src/renderers/webgpu/utils/WebGPUBindingUtils.js +++ b/src/renderers/webgpu/utils/WebGPUBindingUtils.js @@ -6,6 +6,7 @@ import { import { FloatType, IntType, UnsignedIntType, Compatibility } from '../../../constants.js'; import { NodeAccess } from '../../../nodes/core/constants.js'; import { isTypedArray, error } from '../../../utils.js'; +import { hashString } from '../../../nodes/core/NodeUtils.js'; /** * Class representing a WebGPU bind group layout. @@ -99,7 +100,7 @@ class WebGPUBindingUtils { // if not, assing one const entries = this._createLayoutEntries( bindGroup ); - const bindGroupLayoutKey = JSON.stringify( entries ); + const bindGroupLayoutKey = hashString( JSON.stringify( entries ) ); // try to find an existing layout in the cache