diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-08-21 08:40:25 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-21 08:40:25 -0700 |
| commit | 0ce1131ba12f777fbaa40004e0e3e7af89ccf4f0 (patch) | |
| tree | 053d94527cab22111060087c53f18c4bd066ecd2 /source/slang/syntax.cpp | |
| parent | 56d8a752d84e984afab20de5980edf10fe6c06f5 (diff) | |
Add support for more RasterizerOrdered types (#628)
Fixes #627
The front-end has support for `RasterizerOrderedBuffer` and `RasterizerOrderedTexture*`, but left out support for:
* `RasterizerOrderedByteAddressBuffer`
* `RasterizerOrderedStructuredBuffer`
[Nitpick: these tyeps are all amazingly annoying to type. It is easy to want to write `RasterOrdered` instead of the bulkier `RasterizerOrdered`, and almost everybody does in casual speech. There's already the issue of wanting to type `StructureBuffer` (a buffer of structures) instead of `StructuredBuffer` (a buffer that is... structured?). Then you have `ByteAddressBuffer` which is just adding to the confusion because it is nominally a "byte addressable" buffer (so that `ByteAddressedBuffer` would actually make sense), but then actually *isn't* byte addressable in practice.]
There were a few `TODO` comments related to this already, and this change was mostly a matter of doing a find-in-files for `RWByteAddressBuffer` and `RWStructuredBuffer` and adding matching `RasterizerOrdered` cases.
The test I added just checks that these types make it through the front-end, and doesn't do any actual confirmation that they work as intended. It is worth noting that the handling of ordering in GLSL/VK is different from in HLSL ("pixel shader interlock" instead of "rasterizer ordered views"), so coming up with a cross-compilation story would need to be a later step.
Diffstat (limited to 'source/slang/syntax.cpp')
| -rw-r--r-- | source/slang/syntax.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp index db0410cbd..bb6d6a575 100644 --- a/source/slang/syntax.cpp +++ b/source/slang/syntax.cpp @@ -873,6 +873,7 @@ void Type::accept(IValVisitor* visitor, void* extra) CASE(HLSLStructuredBufferType, HLSLStructuredBufferType) CASE(HLSLRWStructuredBufferType, HLSLRWStructuredBufferType) + CASE(HLSLRasterizerOrderedStructuredBufferType, HLSLRasterizerOrderedStructuredBufferType) CASE(HLSLAppendStructuredBufferType, HLSLAppendStructuredBufferType) CASE(HLSLConsumeStructuredBufferType, HLSLConsumeStructuredBufferType) @@ -893,6 +894,7 @@ void Type::accept(IValVisitor* visitor, void* extra) CASE(HLSLByteAddressBufferType, HLSLByteAddressBufferType) CASE(HLSLRWByteAddressBufferType, HLSLRWByteAddressBufferType) + CASE(HLSLRasterizerOrderedByteAddressBufferType, HLSLRasterizerOrderedByteAddressBufferType) CASE(UntypedBufferResourceType, UntypedBufferResourceType) CASE(GLSLInputAttachmentType, GLSLInputAttachmentType) |
