Skip to content

Commit 9ce4be8

Browse files
committed
Add diagnostics, derivative uniformity failures trigger diagnostics
- Define diagnostics, each having: - severity: error, warning, info, off - triggering rule - triggering location - The spec names certain triggering rules. Currently only "derivative_uniformity" is defined, and it defaults to "error" severity. - Uniformity section is updated generally to say that analysis failures trigger a "uniformity failure", instead of "rejects the program". In one place, say that uniformity failure for deriviative builtins trigger derivative_uniformity at the call site of that builtin; and that uniformity failures for barrier builtins trigger a shader-creation error. - Triggering rules are named like identifiers. - Define diagnostic filters, which have - affected range: span of source text - new severity - triggering rule - Filters with an unknown triggering rule are ignored. - There are global filters, which are given as directives at the top of the module (mixed in with enables). - There are "range" filters, which are given as @diagnostic attributes before: control flow statements, switch bodies, function declarations, and compound statements. - @diagnostic attributes may be given more than once on a particular object. But they must not "conflict", meaning have the same range and triggering rule, but different "new severity". - The affected ranges of diagnostic filters perfectly nest, by constrution. - To apply a filter to a diagnostic: - the triggering location must fall in the affected range - they must have the same triggering rule - the severity of the diagnostic is updated to the one specified in the filter. - Define a step-wise process for processing triggered filters, roughly: 1. For each diagnostic with triggering rule R, apply the diagnostic filter for rule R whose affected range is smallest but also encloses the diagnostic's triggering location, if one exists. 2. Discard "off" diagnostics. 3. For each rule R, all but one "info" diagnostic for R may be discarded. 4. For each rule R, all but one "warning" diagnostic for R may be discarded. If there is such a diagnostic, all the info messages for R may be discarded. 5. If there is at least one error diagnostic, all other diagnostics may be discarded. Generate either a shader-creation or pipeline-creation error. 6. Diagnostics generated during shader-creation are reported in the messsages member of the GPUConpilationInfo object. 7. Error diagnostics generated during pipeline-creation are reported to the enclosing GPU error scope. Fixes: gpuweb#3554 gpuweb#3689
1 parent a185b50 commit 9ce4be8

File tree

3 files changed

+400
-67
lines changed

3 files changed

+400
-67
lines changed

0 commit comments

Comments
 (0)