gpuweb / cts

WebGPU Conformance Test Suite
https://gpuweb.github.io/cts/
BSD 3-Clause "New" or "Revised" License
119 stars 72 forks source link

[wgsl] Validate errors are generated for overrides which aren't used. #3747

Open dj2 opened 1 month ago

dj2 commented 1 month ago

With the decision in https://github.com/gpuweb/gpuweb/issues/4624 an override that is unused but set is allowed. There is no way to test that the value was set correctly due to it not being used, but we should have a test that it will fail shader or pipeline-creation if there is a const-evaluation error.

There are two cases to be tested:

  1. Override exists in module without a default
  2. Override exists in module with a default

For 1. we need a test where the override has no default in the module, is unused by the entry point and when it is set at pipeline creation it overflows and a pipeline-creation error should be reported.

For 2. we need a test where the override has a default in the module, is unused by the entry point and the value calculation overflows this causes a shader creation error.

dj2 commented 4 weeks ago

This blocked on the resolution of https://github.com/gpuweb/gpuweb/issues/4648