Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DXR] Clarify whether empty payloads and/or empty hit attribute structs are allowed #113

Open
jasilvanus opened this issue Nov 14, 2022 · 0 comments

Comments

@jasilvanus
Copy link

jasilvanus commented Nov 14, 2022

Description

dxc explicitly forbids empty payload structs and empty hit attribute structs. This does not seem to be explicitly forbidden by the DXR spec.
Not sure what the intended behavior is, i.e. whether the spec should be updated, or whether this should be fixed in https://github.com/microsoft/DirectXShaderCompiler.

Empty payload example

struct [raypayload] EmptyPayload {};

[shader("miss")]
void MissEmptyPayload(inout EmptyPayload) {}

dxc -T lib_6_7 output:

empty_payload.hlsl:4:6: error: shader must include inout payload structure parameter.
void MissEmptyPayload(inout EmptyPayload) {}
     ^

Empty hit attribute struct example:

struct [raypayload] Payload { float value; };
struct Attributes {};

[shader("anyhit")]
void AnyHitEmptyAttributes(inout Payload, in Attributes) {}

dxc -T lib_6_7 output:

empty_payload.hlsl:5:6: error: shader must include attributes structure parameter.
void AnyHitEmptyAttributes(inout Payload, in Attributes) {}
     ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant