DXC allows assigning to members of a const struct variable #2860
Closed
Description
Hello, I just noticed that DXC will compile the following code without any errors:
struct MyData {
float3 x[4];
};
StructuredBuffer<MyData> DataIn;
RWStructuredBuffer<MyData> DataOut;
[numthreads(64, 1, 1)]
void CSMain(uint3 dispatchid : SV_DispatchThreadID)
{
const MyData data = DataIn[dispatchid.x];
data.x[0] = 1.0f;
DataOut[dispatchid.x] = data;
}
I would expect the data.x[0] = 1.0f
assignment to cause a compiler error since the data
variable is marked as const
.
Metadata
Assignees
Labels
No labels
Activity