-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Calling member function on raypayload causes cast<X>() argument of incompatible type
error with PAQ
#6464
Comments
A few bits of extra context. This reproduces back to DXC 1.7.2207 when targeting SM 6.7, so it is not a new regression. The call stack for the exception throw is: An exception is being thrown from here, because a member function is being accessed but the code assumes all member accesses are field declarations. This exposes a flaw in the implementation for payload access qualifiers. It incorrectly assumes all member expressions are accessing field declarations whereas here we're accessing a member function declaration. |
Slightly reduced repro: https://godbolt.org/z/bnb9feMv6 - this repro doesn't have any payload qualifiers at all, although passing Looks like this would affect someone trying to migrate from lib_6_6 to lib_6_7. |
I've ran into this recently with SPIR-V output as well struct [raypayload] PrimaryPayload
{
using generator_t = nbl::hlsl::random::Pcg;
// alpha is quantized to 10 bits
bool nextDiscard(const uint32_t quantAlpha)
{
const uint32_t bitpattern = pcg()>>22;
return bitpattern > quantAlpha;
}
bool nextDiscard(const float32_t alpha)
{
const uint32_t bitpattern = pcg();
const float32_t xi = (float32_t(bitpattern)+0.5f)/float32_t(0xFFFFFFFF);
return xi > alpha;
}
float32_t3 worldNormal : read(caller) : write(closesthit);
float32_t rayDistance : read(caller) : write(closesthit, miss);
generator_t pcg : read(anyhit) : write(caller,anyhit);
MaterialId materialId : read(caller) : write(closesthit);
}; as soon as I added a method to a payload struct |
You can, however put a struct with a method as a member variable in the payload. That works. |
Description
When compiling the provided simple shader repro with SM6.7 or above (when PAQ is enabled by default) or with SM6.6 and compiling with
-enable-payload-qualifiers
, the compiler fails with an "Internal Compiler error".It seems to be related to PAQ in combination with calling a member function on a
raypayload
that writes to a member.Steps to Reproduce
Example in Compiler Explorer: https://godbolt.org/z/qqKedsWv9
Commandlines that reproduce the issue:
-T lib_6_7
-T lib_6_8
-T lib_6_6 -enable-payload-qualifiers
Actual Behavior
The output of the compiler:
Environment
dxcompiler.dll: 1.8 - 1.8.2403.36 (9c2b82878); dxil.dll: 1.8(101.8.2403.21)
The text was updated successfully, but these errors were encountered: