1 |
- {"ast":null,"code":"/** @internal */\nexport class WebGPUShaderProcessor {\n constructor() {\n this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n }\n _addUniformToLeftOverUBO(name, uniformType, preProcessors) {\n let length = 0;\n [name, uniformType, length] = this._getArraySize(name, uniformType, preProcessors);\n for (let i = 0; i < this._webgpuProcessingContext.leftOverUniforms.length; i++) {\n if (this._webgpuProcessingContext.leftOverUniforms[i].name === name) {\n return;\n }\n }\n this._webgpuProcessingContext.leftOverUniforms.push({\n name,\n type: uniformType,\n length\n });\n }\n _buildLeftOverUBO() {\n if (!this._webgpuProcessingContext.leftOverUniforms.length) {\n return \"\";\n }\n const name = WebGPUShaderProcessor.LeftOvertUBOName;\n let availableUBO = this._webgpuProcessingContext.availableBuffers[name];\n if (!availableUBO) {\n availableUBO = {\n binding: this._webgpuProcessingContext.getNextFreeUBOBinding()\n };\n this._webgpuProcessingContext.availableBuffers[name] = availableUBO;\n this._addBufferBindingDescription(name, availableUBO, \"uniform\" /* WebGPUConstants.BufferBindingType.Uniform */, true);\n this._addBufferBindingDescription(name, availableUBO, \"uniform\" /* WebGPUConstants.BufferBindingType.Uniform */, false);\n }\n return this._generateLeftOverUBOCode(name, availableUBO);\n }\n _collectBindingNames() {\n // collect all the binding names for faster processing in WebGPUCacheBindGroup\n for (let i = 0; i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) {\n const setDefinition = this._webgpuProcessingContext.bindGroupLayoutEntries[i];\n if (setDefinition === undefined) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[i] = [];\n continue;\n }\n for (let j = 0; j < setDefinition.length; j++) {\n const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j];\n const name = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name;\n const nameInArrayOfTexture = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].nameInArrayOfTexture;\n if (entry) {\n if (entry.texture || entry.externalTexture || entry.storageTexture) {\n this._webgpuProcessingContext.textureNames.push(nameInArrayOfTexture);\n } else if (entry.sampler) {\n this._webgpuProcessingContext.samplerNames.push(name);\n } else if (entry.buffer) {\n this._webgpuProcessingContext.bufferNames.push(name);\n }\n }\n }\n }\n }\n _preCreateBindGroupEntries() {\n const bindGroupEntries = this._webgpuProcessingContext.bindGroupEntries;\n for (let i = 0; i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) {\n const setDefinition = this._webgpuProcessingContext.bindGroupLayoutEntries[i];\n const entries = [];\n for (let j = 0; j < setDefinition.length; j++) {\n const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j];\n if (entry.sampler || entry.texture || entry.storageTexture || entry.externalTexture) {\n entries.push({\n binding: entry.binding,\n resource: undefined\n });\n } else if (entry.buffer) {\n entries.push({\n binding: entry.binding,\n resource: {\n buffer: undefined,\n offset: 0,\n size: 0\n }\n });\n }\n }\n bindGroupEntries[i] = entries;\n }\n }\n _addTextureBindingDescription(name, textureInfo, textureIndex, dimension, format, isVertex) {\n // eslint-disable-next-line prefer-const\n let {\n groupIndex,\n bindingIndex\n } = textureInfo.textures[textureIndex];\n if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];\n }\n if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {\n let len;\n if (dimension === null) {\n len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n externalTexture: {}\n });\n } else if (format) {\n len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n storageTexture: {\n access: \"write-only\" /* WebGPUConstants.StorageTextureAccess.WriteOnly */,\n format,\n viewDimension: dimension\n }\n });\n } else {\n len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n texture: {\n sampleType: textureInfo.sampleType,\n viewDimension: dimension,\n multisampled: false\n }\n });\n }\n const textureName = textureInfo.isTextureArray ? name + textureIndex : name;\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = {\n name,\n index: len - 1,\n nameInArrayOfTexture: textureName\n };\n }\n bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;\n if (isVertex) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;\n } else {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;\n }\n }\n _addSamplerBindingDescription(name, samplerInfo, isVertex) {\n // eslint-disable-next-line prefer-const\n let {\n groupIndex,\n bindingIndex\n } = samplerInfo.binding;\n if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];\n }\n if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {\n const len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n sampler: {\n type: samplerInfo.type\n }\n });\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = {\n name,\n index: len - 1\n };\n }\n bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;\n if (isVertex) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;\n } else {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;\n }\n }\n _addBufferBindingDescription(name, uniformBufferInfo, bufferType, isVertex) {\n // eslint-disable-next-line prefer-const\n let {\n groupIndex,\n bindingIndex\n } = uniformBufferInfo.binding;\n if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];\n }\n if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {\n const len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n buffer: {\n type: bufferType\n }\n });\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = {\n name,\n index: len - 1\n };\n }\n bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;\n if (isVertex) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;\n } else {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;\n }\n }\n}\nWebGPUShaderProcessor.LeftOvertUBOName = \"LeftOver\";\nWebGPUShaderProcessor.InternalsUBOName = \"Internals\";\nWebGPUShaderProcessor.UniformSizes = {\n // GLSL types\n bool: 1,\n int: 1,\n float: 1,\n vec2: 2,\n ivec2: 2,\n uvec2: 2,\n vec3: 3,\n ivec3: 3,\n uvec3: 3,\n vec4: 4,\n ivec4: 4,\n uvec4: 4,\n mat2: 4,\n mat3: 12,\n mat4: 16,\n // WGSL types\n i32: 1,\n u32: 1,\n f32: 1,\n mat2x2: 4,\n mat3x3: 12,\n mat4x4: 16,\n mat2x2f: 4,\n mat3x3f: 12,\n mat4x4f: 16,\n vec2i: 2,\n vec3i: 3,\n vec4i: 4,\n vec2u: 2,\n vec3u: 3,\n vec4u: 4,\n vec2f: 2,\n vec3f: 3,\n vec4f: 4,\n vec2h: 1,\n vec3h: 2,\n vec4h: 2\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._SamplerFunctionByWebGLSamplerType = {\n sampler2D: \"sampler2D\",\n sampler2DArray: \"sampler2DArray\",\n sampler2DShadow: \"sampler2DShadow\",\n sampler2DArrayShadow: \"sampler2DArrayShadow\",\n samplerCube: \"samplerCube\",\n sampler3D: \"sampler3D\"\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._TextureTypeByWebGLSamplerType = {\n sampler2D: \"texture2D\",\n sampler2DArray: \"texture2DArray\",\n sampler2DShadow: \"texture2D\",\n sampler2DArrayShadow: \"texture2DArray\",\n samplerCube: \"textureCube\",\n samplerCubeArray: \"textureCubeArray\",\n sampler3D: \"texture3D\"\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._GpuTextureViewDimensionByWebGPUTextureType = {\n textureCube: \"cube\" /* WebGPUConstants.TextureViewDimension.Cube */,\n textureCubeArray: \"cube-array\" /* WebGPUConstants.TextureViewDimension.CubeArray */,\n texture2D: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n texture2DArray: \"2d-array\" /* WebGPUConstants.TextureViewDimension.E2dArray */,\n texture3D: \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */\n};\n// if the webgl sampler type is not listed in this array, \"sampler\" is taken by default\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._SamplerTypeByWebGLSamplerType = {\n sampler2DShadow: \"samplerShadow\",\n sampler2DArrayShadow: \"samplerShadow\"\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType = {\n samplerShadow: true,\n samplerArrayShadow: true,\n sampler: false\n};","map":{"version":3,"names":["WebGPUShaderProcessor","constructor","shaderLanguage","_addUniformToLeftOverUBO","name","uniformType","preProcessors","length","_getArraySize","i","_webgpuProcessingContext","leftOverUniforms","push","type","_buildLeftOverUBO","LeftOvertUBOName","availableUBO","availableBuffers","binding","getNextFreeUBOBinding","_addBufferBindingDescription","_generateLeftOverUBOCode","_collectBindingNames","bindGroupLayoutEntries","setDefinition","undefined","j","entry","bindGroupLayoutEntryInfo","nameInArrayOfTexture","texture","externalTexture","storageTexture","textureNames","sampler","samplerNames","buffer","bufferNames","_preCreateBindGroupEntries","bindGroupEntries","entries","resource","offset","size","_addTextureBindingDescription","textureInfo","textureIndex","dimension","format","isVertex","groupIndex","bindingIndex","textures","len","visibility","access","viewDimension","sampleType","multisampled","textureName","isTextureArray","index","_addSamplerBindingDescription","samplerInfo","uniformBufferInfo","bufferType","InternalsUBOName","UniformSizes","bool","int","float","vec2","ivec2","uvec2","vec3","ivec3","uvec3","vec4","ivec4","uvec4","mat2","mat3","mat4","i32","u32","f32","mat2x2","mat3x3","mat4x4","mat2x2f","mat3x3f","mat4x4f","vec2i","vec3i","vec4i","vec2u","vec3u","vec4u","vec2f","vec3f","vec4f","vec2h","vec3h","vec4h","_SamplerFunctionByWebGLSamplerType","sampler2D","sampler2DArray","sampler2DShadow","sampler2DArrayShadow","samplerCube","sampler3D","_TextureTypeByWebGLSamplerType","samplerCubeArray","_GpuTextureViewDimensionByWebGPUTextureType","textureCube","textureCubeArray","texture2D","texture2DArray","texture3D","_SamplerTypeByWebGLSamplerType","_IsComparisonSamplerByWebGPUSamplerType","samplerShadow","samplerArrayShadow"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Engines/WebGPU/webgpuShaderProcessor.js"],"sourcesContent":["/** @internal */\nexport class WebGPUShaderProcessor {\n constructor() {\n this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n }\n _addUniformToLeftOverUBO(name, uniformType, preProcessors) {\n let length = 0;\n [name, uniformType, length] = this._getArraySize(name, uniformType, preProcessors);\n for (let i = 0; i < this._webgpuProcessingContext.leftOverUniforms.length; i++) {\n if (this._webgpuProcessingContext.leftOverUniforms[i].name === name) {\n return;\n }\n }\n this._webgpuProcessingContext.leftOverUniforms.push({\n name,\n type: uniformType,\n length,\n });\n }\n _buildLeftOverUBO() {\n if (!this._webgpuProcessingContext.leftOverUniforms.length) {\n return \"\";\n }\n const name = WebGPUShaderProcessor.LeftOvertUBOName;\n let availableUBO = this._webgpuProcessingContext.availableBuffers[name];\n if (!availableUBO) {\n availableUBO = {\n binding: this._webgpuProcessingContext.getNextFreeUBOBinding(),\n };\n this._webgpuProcessingContext.availableBuffers[name] = availableUBO;\n this._addBufferBindingDescription(name, availableUBO, \"uniform\" /* WebGPUConstants.BufferBindingType.Uniform */, true);\n this._addBufferBindingDescription(name, availableUBO, \"uniform\" /* WebGPUConstants.BufferBindingType.Uniform */, false);\n }\n return this._generateLeftOverUBOCode(name, availableUBO);\n }\n _collectBindingNames() {\n // collect all the binding names for faster processing in WebGPUCacheBindGroup\n for (let i = 0; i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) {\n const setDefinition = this._webgpuProcessingContext.bindGroupLayoutEntries[i];\n if (setDefinition === undefined) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[i] = [];\n continue;\n }\n for (let j = 0; j < setDefinition.length; j++) {\n const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j];\n const name = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name;\n const nameInArrayOfTexture = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].nameInArrayOfTexture;\n if (entry) {\n if (entry.texture || entry.externalTexture || entry.storageTexture) {\n this._webgpuProcessingContext.textureNames.push(nameInArrayOfTexture);\n }\n else if (entry.sampler) {\n this._webgpuProcessingContext.samplerNames.push(name);\n }\n else if (entry.buffer) {\n this._webgpuProcessingContext.bufferNames.push(name);\n }\n }\n }\n }\n }\n _preCreateBindGroupEntries() {\n const bindGroupEntries = this._webgpuProcessingContext.bindGroupEntries;\n for (let i = 0; i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) {\n const setDefinition = this._webgpuProcessingContext.bindGroupLayoutEntries[i];\n const entries = [];\n for (let j = 0; j < setDefinition.length; j++) {\n const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j];\n if (entry.sampler || entry.texture || entry.storageTexture || entry.externalTexture) {\n entries.push({\n binding: entry.binding,\n resource: undefined,\n });\n }\n else if (entry.buffer) {\n entries.push({\n binding: entry.binding,\n resource: {\n buffer: undefined,\n offset: 0,\n size: 0,\n },\n });\n }\n }\n bindGroupEntries[i] = entries;\n }\n }\n _addTextureBindingDescription(name, textureInfo, textureIndex, dimension, format, isVertex) {\n // eslint-disable-next-line prefer-const\n let { groupIndex, bindingIndex } = textureInfo.textures[textureIndex];\n if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];\n }\n if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {\n let len;\n if (dimension === null) {\n len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n externalTexture: {},\n });\n }\n else if (format) {\n len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n storageTexture: {\n access: \"write-only\" /* WebGPUConstants.StorageTextureAccess.WriteOnly */,\n format,\n viewDimension: dimension,\n },\n });\n }\n else {\n len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n texture: {\n sampleType: textureInfo.sampleType,\n viewDimension: dimension,\n multisampled: false,\n },\n });\n }\n const textureName = textureInfo.isTextureArray ? name + textureIndex : name;\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1, nameInArrayOfTexture: textureName };\n }\n bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;\n if (isVertex) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;\n }\n else {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;\n }\n }\n _addSamplerBindingDescription(name, samplerInfo, isVertex) {\n // eslint-disable-next-line prefer-const\n let { groupIndex, bindingIndex } = samplerInfo.binding;\n if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];\n }\n if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {\n const len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n sampler: {\n type: samplerInfo.type,\n },\n });\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1 };\n }\n bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;\n if (isVertex) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;\n }\n else {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;\n }\n }\n _addBufferBindingDescription(name, uniformBufferInfo, bufferType, isVertex) {\n // eslint-disable-next-line prefer-const\n let { groupIndex, bindingIndex } = uniformBufferInfo.binding;\n if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];\n }\n if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {\n const len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n buffer: {\n type: bufferType,\n },\n });\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1 };\n }\n bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;\n if (isVertex) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;\n }\n else {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;\n }\n }\n}\nWebGPUShaderProcessor.LeftOvertUBOName = \"LeftOver\";\nWebGPUShaderProcessor.InternalsUBOName = \"Internals\";\nWebGPUShaderProcessor.UniformSizes = {\n // GLSL types\n bool: 1,\n int: 1,\n float: 1,\n vec2: 2,\n ivec2: 2,\n uvec2: 2,\n vec3: 3,\n ivec3: 3,\n uvec3: 3,\n vec4: 4,\n ivec4: 4,\n uvec4: 4,\n mat2: 4,\n mat3: 12,\n mat4: 16,\n // WGSL types\n i32: 1,\n u32: 1,\n f32: 1,\n mat2x2: 4,\n mat3x3: 12,\n mat4x4: 16,\n mat2x2f: 4,\n mat3x3f: 12,\n mat4x4f: 16,\n vec2i: 2,\n vec3i: 3,\n vec4i: 4,\n vec2u: 2,\n vec3u: 3,\n vec4u: 4,\n vec2f: 2,\n vec3f: 3,\n vec4f: 4,\n vec2h: 1,\n vec3h: 2,\n vec4h: 2,\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._SamplerFunctionByWebGLSamplerType = {\n sampler2D: \"sampler2D\",\n sampler2DArray: \"sampler2DArray\",\n sampler2DShadow: \"sampler2DShadow\",\n sampler2DArrayShadow: \"sampler2DArrayShadow\",\n samplerCube: \"samplerCube\",\n sampler3D: \"sampler3D\",\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._TextureTypeByWebGLSamplerType = {\n sampler2D: \"texture2D\",\n sampler2DArray: \"texture2DArray\",\n sampler2DShadow: \"texture2D\",\n sampler2DArrayShadow: \"texture2DArray\",\n samplerCube: \"textureCube\",\n samplerCubeArray: \"textureCubeArray\",\n sampler3D: \"texture3D\",\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._GpuTextureViewDimensionByWebGPUTextureType = {\n textureCube: \"cube\" /* WebGPUConstants.TextureViewDimension.Cube */,\n textureCubeArray: \"cube-array\" /* WebGPUConstants.TextureViewDimension.CubeArray */,\n texture2D: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n texture2DArray: \"2d-array\" /* WebGPUConstants.TextureViewDimension.E2dArray */,\n texture3D: \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */,\n};\n// if the webgl sampler type is not listed in this array, \"sampler\" is taken by default\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._SamplerTypeByWebGLSamplerType = {\n sampler2DShadow: \"samplerShadow\",\n sampler2DArrayShadow: \"samplerShadow\",\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType = {\n samplerShadow: true,\n samplerArrayShadow: true,\n sampler: false,\n};\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,qBAAqB,CAAC;EAC/BC,WAAWA,CAAA,EAAG;IACV,IAAI,CAACC,cAAc,GAAG,CAAC,CAAC;EAC5B;EACAC,wBAAwBA,CAACC,IAAI,EAAEC,WAAW,EAAEC,aAAa,EAAE;IACvD,IAAIC,MAAM,GAAG,CAAC;IACd,CAACH,IAAI,EAAEC,WAAW,EAAEE,MAAM,CAAC,GAAG,IAAI,CAACC,aAAa,CAACJ,IAAI,EAAEC,WAAW,EAAEC,aAAa,CAAC;IAClF,KAAK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