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

ByteAddressBuffer template Load<> of struct containing enum fails to compile #7170

Open
kylawl opened this issue Feb 28, 2025 · 0 comments
Open
Labels
bug Bug, regression, crash needs-triage Awaiting triage

Comments

@kylawl
Copy link

kylawl commented Feb 28, 2025

Description
Place an enum in a struct and attempt a templated load out of a ByteAddressBuffer, you're presented with the following error. Converting your enum to a uint works though.

error: Explicit template arguments on intrinsic Load must be a single numeric type
    MyStruct myStruct = inBuff.Load<MyStruct>(0);

Steps to Reproduce

// The entry point and target profile are needed to compile this example:
// -T cs_6_6 -E CSMain -HV 2021

enum MyEnum : uint
{
    Foo,
    Bar,
    Why
};

struct MyStruct
{     
    MyEnum myEnum; // << Enum BAD :()
    // uint myEnum; // << Uint GOOD :)
};


ByteAddressBuffer inBuff;
RWStructuredBuffer<MyStruct> outBuff;

[numthreads(64,1,1)]
void CSMain(uint3 group_thread_id : SV_GroupThreadID)
{
    MyStruct myStruct = inBuff.Load<MyStruct>(0);
    outBuff[group_thread_id.x] = myStruct;
}

Actual Behavior

error: Explicit template arguments on intrinsic Load must be a single numeric type
    MyStruct myStruct = inBuff.Load<MyStruct>(0);

Environment

  • DXC version 1.8.2407
  • Host Operating System Win10
@kylawl kylawl added bug Bug, regression, crash needs-triage Awaiting triage labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash needs-triage Awaiting triage
Projects
Status: No status
Development

No branches or pull requests

1 participant