summaryrefslogtreecommitdiffstats
path: root/source/slang/type-layout.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-08-21 08:40:25 -0700
committerGitHub <noreply@github.com>2018-08-21 08:40:25 -0700
commit0ce1131ba12f777fbaa40004e0e3e7af89ccf4f0 (patch)
tree053d94527cab22111060087c53f18c4bd066ecd2 /source/slang/type-layout.cpp
parent56d8a752d84e984afab20de5980edf10fe6c06f5 (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/type-layout.cpp')
-rw-r--r--source/slang/type-layout.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/slang/type-layout.cpp b/source/slang/type-layout.cpp
index 1f1002425..d7a4e68bc 100644
--- a/source/slang/type-layout.cpp
+++ b/source/slang/type-layout.cpp
@@ -1659,10 +1659,11 @@ SimpleLayoutInfo GetLayoutImpl(
return info; \
} while(0)
- CASE(HLSLStructuredBufferType, StructuredBuffer);
- CASE(HLSLRWStructuredBufferType, MutableStructuredBuffer);
- CASE(HLSLAppendStructuredBufferType, MutableStructuredBuffer);
- CASE(HLSLConsumeStructuredBufferType, MutableStructuredBuffer);
+ CASE(HLSLStructuredBufferType, StructuredBuffer);
+ CASE(HLSLRWStructuredBufferType, MutableStructuredBuffer);
+ CASE(HLSLRasterizerOrderedStructuredBufferType, MutableStructuredBuffer);
+ CASE(HLSLAppendStructuredBufferType, MutableStructuredBuffer);
+ CASE(HLSLConsumeStructuredBufferType, MutableStructuredBuffer);
#undef CASE
@@ -1675,8 +1676,9 @@ SimpleLayoutInfo GetLayoutImpl(
type, rules, outTypeLayout); \
} while(0)
- CASE(HLSLByteAddressBufferType, RawBuffer);
- CASE(HLSLRWByteAddressBufferType, MutableRawBuffer);
+ CASE(HLSLByteAddressBufferType, RawBuffer);
+ CASE(HLSLRWByteAddressBufferType, MutableRawBuffer);
+ CASE(HLSLRasterizerOrderedByteAddressBufferType, MutableRawBuffer);
CASE(GLSLInputAttachmentType, InputRenderTarget);