Skip to content

Commit

Permalink
Refactor to not render to rgba32float (#4020)
Browse files Browse the repository at this point in the history
Compat will not have rgba32float as a render target support
except as an optional feature so refactor to not use it.
  • Loading branch information
greggman authored Oct 30, 2024
1 parent 30ee073 commit bfbfd9e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4470,7 +4470,7 @@ function createTextureCallsRunner<T extends Dimensionality>(
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,
});
Expand Down Expand Up @@ -4510,8 +4510,8 @@ function createTextureCallsRunner<T extends Dimensionality>(
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<vec4u>(v.result);
}
`
: stage === 'fragment'
Expand All @@ -4524,9 +4524,9 @@ function createTextureCallsRunner<T extends Dimensionality>(
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<vec4u>(getResult(v.ndx, derivativeBase));
}
`
: `
Expand Down Expand Up @@ -4696,7 +4696,7 @@ ${stageWGSL}
vertex: { module },
fragment: {
module,
targets: [{ format: renderTarget.format }],
targets: [{ format: 'rgba32uint' }],
},
});
break;
Expand Down

0 comments on commit bfbfd9e

Please sign in to comment.