diff --git a/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts b/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts index 350237459705..72268c5b368b 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts @@ -4470,7 +4470,7 @@ function createTextureCallsRunner( const samplerType = isCompare ? 'sampler_comparison' : 'sampler'; const renderTarget = t.createTextureTracked({ - format: resultFormat, + format: 'rgba32uint', size: [calls.length, 1], usage: GPUTextureUsage.COPY_SRC | GPUTextureUsage.RENDER_ATTACHMENT, }); @@ -4510,8 +4510,8 @@ function createTextureCallsRunner( getResult(instance_index, ${derivativeType}(0))); } -@fragment fn fsVertex(v: VOut) -> @location(0) ${returnType} { - return v.result; +@fragment fn fsVertex(v: VOut) -> @location(0) vec4u { + return bitcast(v.result); } ` : stage === 'fragment' @@ -4524,9 +4524,9 @@ function createTextureCallsRunner( return VOut(vec4f(positions[vertex_index], 0, 1), instance_index, ${returnType}(0)); } -@fragment fn fsFragment(v: VOut) -> @location(0) ${returnType} { +@fragment fn fsFragment(v: VOut) -> @location(0) vec4u { ${derivativeBaseWGSL} - return getResult(v.ndx, derivativeBase); + return bitcast(getResult(v.ndx, derivativeBase)); } ` : ` @@ -4696,7 +4696,7 @@ ${stageWGSL} vertex: { module }, fragment: { module, - targets: [{ format: renderTarget.format }], + targets: [{ format: 'rgba32uint' }], }, }); break;