Skip to content

Commit 8fd57e2

Browse files
philcnTim Foley
authored and
Tim Foley
committed
Add SLANG_ACCELERATION_STRUCTURE resource shape for RaytracingAccelerationStructureType (shader-slang#901)
* Add SLANG_ACCELERATION_STRUCTURE resource shape for RaytracingAccelerationStructureType * Change order of resource shape cases I've changed the order of the `UNKNOWN` and `ACCELERATION_STRUCTURE` cases so that the binary value of the `UNKNOWN` case isn't changed by the new feature.
1 parent bf92b6c commit 8fd57e2

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

slang.h

+1
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,7 @@ extern "C"
15351535
SLANG_STRUCTURED_BUFFER = 0x06,
15361536
SLANG_BYTE_ADDRESS_BUFFER = 0x07,
15371537
SLANG_RESOURCE_UNKNOWN = 0x08,
1538+
SLANG_ACCELERATION_STRUCTURE = 0x09,
15381539

15391540
SLANG_RESOURCE_EXT_SHAPE_MASK = 0xF0,
15401541
SLANG_TEXTURE_ARRAY_FLAG = 0x40,

source/slang/reflection.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -511,15 +511,16 @@ SLANG_API SlangResourceShape spReflectionType_GetResourceShape(SlangReflectionTy
511511
return SHAPE; \
512512
} while(0)
513513

514-
CASE(HLSLStructuredBufferType, SLANG_STRUCTURED_BUFFER, SLANG_RESOURCE_ACCESS_READ);
515-
CASE(HLSLRWStructuredBufferType, SLANG_STRUCTURED_BUFFER, SLANG_RESOURCE_ACCESS_READ_WRITE);
516-
CASE(HLSLRasterizerOrderedStructuredBufferType, SLANG_STRUCTURED_BUFFER, SLANG_RESOURCE_ACCESS_RASTER_ORDERED);
517-
CASE(HLSLAppendStructuredBufferType, SLANG_STRUCTURED_BUFFER, SLANG_RESOURCE_ACCESS_APPEND);
518-
CASE(HLSLConsumeStructuredBufferType, SLANG_STRUCTURED_BUFFER, SLANG_RESOURCE_ACCESS_CONSUME);
519-
CASE(HLSLByteAddressBufferType, SLANG_BYTE_ADDRESS_BUFFER, SLANG_RESOURCE_ACCESS_READ);
520-
CASE(HLSLRWByteAddressBufferType, SLANG_BYTE_ADDRESS_BUFFER, SLANG_RESOURCE_ACCESS_READ_WRITE);
521-
CASE(HLSLRasterizerOrderedByteAddressBufferType, SLANG_BYTE_ADDRESS_BUFFER, SLANG_RESOURCE_ACCESS_RASTER_ORDERED);
522-
CASE(UntypedBufferResourceType, SLANG_BYTE_ADDRESS_BUFFER, SLANG_RESOURCE_ACCESS_READ);
514+
CASE(HLSLStructuredBufferType, SLANG_STRUCTURED_BUFFER, SLANG_RESOURCE_ACCESS_READ);
515+
CASE(HLSLRWStructuredBufferType, SLANG_STRUCTURED_BUFFER, SLANG_RESOURCE_ACCESS_READ_WRITE);
516+
CASE(HLSLRasterizerOrderedStructuredBufferType, SLANG_STRUCTURED_BUFFER, SLANG_RESOURCE_ACCESS_RASTER_ORDERED);
517+
CASE(HLSLAppendStructuredBufferType, SLANG_STRUCTURED_BUFFER, SLANG_RESOURCE_ACCESS_APPEND);
518+
CASE(HLSLConsumeStructuredBufferType, SLANG_STRUCTURED_BUFFER, SLANG_RESOURCE_ACCESS_CONSUME);
519+
CASE(HLSLByteAddressBufferType, SLANG_BYTE_ADDRESS_BUFFER, SLANG_RESOURCE_ACCESS_READ);
520+
CASE(HLSLRWByteAddressBufferType, SLANG_BYTE_ADDRESS_BUFFER, SLANG_RESOURCE_ACCESS_READ_WRITE);
521+
CASE(HLSLRasterizerOrderedByteAddressBufferType, SLANG_BYTE_ADDRESS_BUFFER, SLANG_RESOURCE_ACCESS_RASTER_ORDERED);
522+
CASE(RaytracingAccelerationStructureType, SLANG_ACCELERATION_STRUCTURE, SLANG_RESOURCE_ACCESS_READ);
523+
CASE(UntypedBufferResourceType, SLANG_BYTE_ADDRESS_BUFFER, SLANG_RESOURCE_ACCESS_READ);
523524
#undef CASE
524525

525526
return SLANG_RESOURCE_NONE;

0 commit comments

Comments
 (0)