-
Notifications
You must be signed in to change notification settings - Fork 808
Closed as not planned
Labels
Description
Description
Inout allows implicit casts such as float to uint. This is unexpected behavior and might end up causing a confusing debugging session.
Steps to Reproduce
struct PSInput {
float4 color : COLOR;
};
void fun(inout uint v) {
v = 1;
}
float4 PSMain(PSInput input) : SV_TARGET {
float v = 2;
fun(v);
return input.color * v;
}Actual Behavior
This should cause an error because a float should not be implicitly converted to a uint like this. For example if this was a uint& in C++ it would complain too.
Environment
- DXC version: trunk on 2023-06-16+ (shader-playground) and up.
- Host Operating System: N/A.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Triaged