Revision 60bcc6809f57e12f3705cc65cb325b0983b08899 authored by Tim Foley on 02 May 2018, 18:40:09 UTC, committed by GitHub on 02 May 2018, 18:40:09 UTC
This change adds support for specifying explicit register spaces, like:

```hlsl
// Bind to texture register #2 in space #1
Texture2D t : register(t2, space1);
```

I added a test case to confirm that the register space is properly propagated through the Slang reflection API.

This change also adds proper error messages for some error/unsupported cases that weren't being diagnosed:

* Specifying a completely bogus register "class" (e.g., `register(bad99)`)
* Failing to specify a register index (`register(u)`)
* Specifying a component mask (`register(t0.x)`)
* Using `packoffset` bindings

I added test cases to cover all of these, as well as the new errors around support for register `space` bindings.

In order to get the existing tests to pass, I had to remove explicit `packoffset` bindings from some DXSDK test shaders.
None of these `packoffset` bindings were semantically significant (they matched what the compiler would do anyway, for both Slang and the standard HLSL compiler). Removing them is required for Slang now that we give an explicit error about our lack of `packoffset` support.
In a future change we might add logic to either detect semantically insignificant `packoffset`s, or to just go ahead and support them properly (as a general feature on `struct` types).
1 parent d3c1c8b
History
File Mode Size
build
docs
examples
external
source
tests
tools
.editorconfig -rw-r--r-- 937 bytes
.gitattributes -rw-r--r-- 95 bytes
.gitignore -rw-r--r-- 398 bytes
.gitmodules -rw-r--r-- 107 bytes
.travis.yml -rw-r--r-- 1.6 KB
CODE_OF_CONDUCT.md -rw-r--r-- 3.1 KB
LICENSE -rw-r--r-- 1.1 KB
Makefile -rw-r--r-- 6.3 KB
README.md -rw-r--r-- 4.9 KB
appveyor.yml -rw-r--r-- 3.5 KB
slang.h -rw-r--r-- 42.9 KB
slang.sln -rw-r--r-- 9.1 KB
test.bat -rw-r--r-- 1.4 KB

README.md

back to top