https://github.com/shader-slang/slang
Revision e2096cf81dab8f77ff5aa9b0c3fcf6a81a81dc4a authored by Tim Foley on 12 February 2021, 21:48:11 UTC, committed by GitHub on 12 February 2021, 21:48:11 UTC
This change adds initial support for a feature being proposed for inclusion in dxc: https://github.com/microsoft/DirectXShaderCompiler/pull/3171.

The main features are:

* A `[payload]` attribute that indicates which `struct` types are intended to be used as payloads. Consistent use of this attribute should mean that an application no longer needs to manually specify a maximum payload size when creating a ray-tracing pipeline.

* `read(...)` and `write(...)` qualifiers which can be attached to fields of `struct` types (usually `[payload]`-attributed types) to indicate which ray tracing pipeline stages are allowed read/write access to that part of the payload. Use of these qualifiers should allow an implementation to optimize storage of ray payload elements across RT pipeline stages.

The work in this change just adds basic parsing for these features, translation to matching IR decorations, and then emission of HLSL text based on those decorations.
Notable gaps in this first change include:

* No work is currently being done to validate access to ray payloads in RT entry points based on these qualifiers.

* The stage names in `read(...)` and `write(...)` are not being validated, and are being stored in the IR as text. These should probably use the `Stage` enumeration in some fashion, but we would need to have a way to encode the additional `caller` pseudo-stage that the feature uses.

* No work is currently being done to adjust or react to the chosen shader model when emitting HLSL code. We should *either* have these attributes force a switch to a higher shader model, *or* skip emission of these attributes if the chosen shader model / profile does not imply support for them.

* No tests are currently included for this work, because tests would rely on using a custom `dxcompiler.dll` build with the new feature supported.
1 parent 0dea127
History
Tip revision: e2096cf81dab8f77ff5aa9b0c3fcf6a81a81dc4a authored by Tim Foley on 12 February 2021, 21:48:11 UTC
Initial support for DXR payload access qualifiers (#1705)
Tip revision: e2096cf
File Mode Size
.github
build
docs
examples
external
extras
prelude
source
tests
tools
.editorconfig -rw-r--r-- 937 bytes
.gitattributes -rw-r--r-- 95 bytes
.gitignore -rw-r--r-- 1.0 KB
.gitmodules -rw-r--r-- 951 bytes
CODE_OF_CONDUCT.md -rw-r--r-- 3.1 KB
LICENSE -rw-r--r-- 1.1 KB
README.md -rw-r--r-- 8.6 KB
github_build.sh -rw-r--r-- 495 bytes
github_test.sh -rw-r--r-- 546 bytes
premake.bat -rw-r--r-- 120 bytes
premake5.lua -rw-r--r-- 47.0 KB
slang-com-helper.h -rw-r--r-- 4.8 KB
slang-com-ptr.h -rw-r--r-- 4.9 KB
slang-tag-version.h -rw-r--r-- 36 bytes
slang.h -rw-r--r-- 167.5 KB
slang.sln -rw-r--r-- 19.7 KB
test.bat -rw-r--r-- 1.4 KB

README.md

back to top