DirectXShaderCompiler
DirectXShaderCompiler copied to clipboard
When using "--variable" as an argument to an inout function, 2 is subtracted not one
https://godbolt.org/z/73so7qzzW
void Func(inout uint byteOffset) { }
uint PSMain(uint i : I) : SV_TARGET { Func(--i); // Subtracts 2... return i; }
The resulting DXIL has an "Add minus two" operation, not "add minus one".
%2 = add i32 %1, -2, !dbg !37
Assigning to myself to check against my development branch that is rewriting parameter passing.
This will be fixed by #5377. I've verified this is fixed against the draft PR #5249. I'll keep this assigned to me to construct a test case to include with the final PR.