Open jaebaek opened 3 years ago
This is the first issue mentioned by https://github.com/microsoft/DirectXShaderCompiler/pull/3721#issuecomment-829537469
@jaebaek - we think that this is problem that impacts both the DXIL and SPIR-V backends, since relaly this error should be detected in sema.
(For reference, x0, x1 and x2 in the repro should be static)
DXIL backend reports error if the code has assignments to resources e.g.,
To enable the error report for the SPIR-V backend, we need a SPIR-V analysis to check if the code conducts
OpStore
to a resource because it is not trivial to check the assignment by checking onlya0 = r0
. We have no ideaa0
is a reference to a global resource or not.Unfortunately, the spirv-opt legalization handles the code and somehow generates the legal code: x.legal.txt from the initial code generated by DXC: x.txt
To fix this issue, I guess we need a sophisticated handling in spirv-val ...