diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-08-15 09:29:52 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-08-15 09:33:36 -0700 |
| commit | 4a94f39020dcc143f9a1d8f5c57ba77a828ead61 (patch) | |
| tree | 384ed2dd18f2d3fa070dffbd70d3e1f9a2bf0909 /tests | |
| parent | 4a9b281c154422cdef03ef629718a458f753093f (diff) | |
Improve diagnostics for overlapping/conflicting bindings
Closes #38
- Change overlapping bindings case from error to warning (it is *technically* allowed in HLSL/GLSL)
- Make diagnostic messages for these cases include a note to point at the "other" declaration in each case, so that user can more easily isolate the problem
- Unrelated fix: make sure `slangc` sets up its diagnostic callback *before* parsing command-line options so that error messages output during options parsing will be visible
- Unrelated fix: make sure that formatting for diagnostic messages doesn't print diagnostic ID for notes (all have IDs < 0).
- Note: eventually I'd like to not print diagnostic IDs at all (I think they are cluttering up our output), but doing that requires touching all the test cases...
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/diagnostics/gh-38-fs.hlsl | 9 | ||||
| -rw-r--r-- | tests/diagnostics/gh-38-vs.hlsl | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/diagnostics/gh-38-fs.hlsl b/tests/diagnostics/gh-38-fs.hlsl new file mode 100644 index 000000000..61c8381e4 --- /dev/null +++ b/tests/diagnostics/gh-38-fs.hlsl @@ -0,0 +1,9 @@ +//TEST_IGNORE_FILE: + +// Companion file to `gh-38-fs.hlsl` + +Texture2D overlappingB : register(t0); + +Texture2D conflicting : register(t2); + +float4 main() : SV_Target { return 0; } diff --git a/tests/diagnostics/gh-38-vs.hlsl b/tests/diagnostics/gh-38-vs.hlsl new file mode 100644 index 000000000..7b23efdea --- /dev/null +++ b/tests/diagnostics/gh-38-vs.hlsl @@ -0,0 +1,9 @@ +//TEST:SIMPLE: -target dxbc-assembly -profile vs_5_0 -entry main tests/diagnostics/gh-38-fs.hlsl -profile ps_5_0 -entry main + +// Ensure that we catch errors with overlapping or conflicting parameter bindings. + +Texture2D overlappingA : register(t0); + +Texture2D conflicting : register(t1); + +float4 main() : SV_Position { return 0; } |
