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
Raw File
.gitmodules
[submodule "external/glslang"]
	path = external/glslang
	url = https://github.com/shader-slang/glslang.git
[submodule "external/tinyobjloader"]
	path = external/tinyobjloader
	url = https://github.com/syoyo/tinyobjloader
[submodule "external/glm"]
	path = external/glm
	url = https://github.com/g-truc/glm.git
[submodule "external/imgui"]
	path = external/imgui
	url = https://github.com/ocornut/imgui.git
[submodule "external/slang-binaries"]
	path = external/slang-binaries
	url = https://github.com/shader-slang/slang-binaries
[submodule "external/spirv-tools"]
	path = external/spirv-tools
	url = https://github.com/KhronosGroup/SPIRV-Tools.git
[submodule "external/spirv-headers"]
	path = external/spirv-headers
	url = https://github.com/KhronosGroup/SPIRV-Headers.git
[submodule "external/miniz"]
	path = external/miniz
	url = https://github.com/richgel999/miniz
[submodule "external/lz4"]
	path = external/lz4
	url = https://github.com/lz4/lz4
back to top