Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Nov 27, 2024
1 parent 34b257a commit 7cd7d82
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/webgpu/compat/api/validation/pipeline_creation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,20 @@ g.test('texture_sampler_combos')
Test that you can not use more texture+sampler combos than
min(maxSamplersPerShaderStage, maxSampledTexturesPerShaderStage)
in compatibility mode.
The spec, copy and pasted here:
maxCombinationsPerStage = min(maxSampledTexturesPerShaderStage, maxSamplersPerShaderStage)
for each stage of the pipeline:
sum = 0
for each texture binding in the pipeline layout which is visible to that stage:
sum += max(1, number of texture sampler combos for that texture binding)
for each external texture binding in the pipeline layout which is visible to that stage:
sum += 1 // for LUT texture + LUT sampler
sum += 3 * max(1, number of external_texture sampler combos) // for Y+U+V
if sum > maxCombinationsPerStage
generate a validation error.
`
)
.params(u =>
Expand Down Expand Up @@ -313,8 +327,6 @@ fn usage1() -> vec4f {
return vec4f(0);
}
@group(2) @binding(0) var tt: texture_2d<f32>;
@fragment fn fs() -> @location(0) vec4f {
return ${stages.includes('fragment') ? 'usage1()' : 'vec4f(0)'};
}
Expand Down

0 comments on commit 7cd7d82

Please sign in to comment.