You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In HLSL arrays when passed as parameters to functions are passed by-value. This is implemented in DXIL by creating a temporary of the array then passing the pointer-decayed temporary in place of the parameter.
HLSL constant sized array function parameters do not decay to pointers.
Instead constant sized array types are preserved as unique types for
overload resolution, template instantiation and name mangling.
This implements the change by adding a new `ArrayParameterType` which
represents a non-decaying `ConstantArrayType`. The new type behaves the
same as `ConstantArrayType` except that it does not decay to a pointer.
Values of `ConstantArrayType` in HLSL decay during overload resolution
via a new `HLSLArrayRValue` cast to `ArrayParameterType`.
`ArrayParamterType` values are passed indirectly by-value to functions
in IR generation resulting in callee generated memcpy instructions.
The behavior of HLSL function calls is documented in the [draft language
specification](https://microsoft.github.io/hlsl-specs/specs/hlsl.pdf)
under the Expr.Post.Call heading.
Additionally the design of this implementation approach is documented in
[Clang's
documentation](https://clang.llvm.org/docs/HLSL/FunctionCalls.html)
Resolves#70123
In HLSL arrays when passed as parameters to functions are passed by-value. This is implemented in DXIL by creating a temporary of the array then passing the pointer-decayed temporary in place of the parameter.
Uh oh!
There was an error while loading. Please reload this page.
In HLSL arrays when passed as parameters to functions are passed by-value. This is implemented in DXIL by creating a temporary of the array then passing the pointer-decayed temporary in place of the parameter.
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-function-parameters
AC:
C
The text was updated successfully, but these errors were encountered: