Check arguments direction in interface implementation #5962
Labels
goal:quality & productivity
Quality issues and issues that impact our productivity coding day to day inside slang
Milestone
Currently, the direction of function arguments in a structure that implements an interface is not checked if it is the same as in the interface declaration. Therefore a function can modify a variable that is expected to be only an input and do not modify a variable that is expected to be an output.
Current result:
This shader is successfully compiled and after the invocation of this code,
output
buffer contains[5, 687]
, which is not expected if we look at the interface declaration.Tested on binaries from the latest release (v2024.17) and a build from the current master (89dd2b1).
Expected result:
Slang will write an error about the difference in an argument direction. This can be quite useful in the link-time specialization where the entire shader works with an unknown type based on a known interface.
The text was updated successfully, but these errors were encountered: