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
{{ message }}
Repository navigation
[SPIR-V] Support EvaluateAttribute* intrinsics #3649
Currently, SPIR-V backend does not support EvaluateAttribute* intrinsics.
According to the discussion in KhronosGroup/glslang#2584, OpInterpolate* needs a pointer operand rather than OpLoad. Based on the offline discussion with Greg Fischer (@greg-lunarg) we need a spirv-opt pass to replace OpLoad operand of OpInterpolate* to the pointer loaded by the OpLoad.
When a spirv-opt pass is prepared, we can simply let DXC emit OpInterpolate* for EvaluateAttribute*. Since it will just follow typical code generation routine, it will use OpLoad for its operand. We can rely on the spirv-opt pass to make it correct (as a part of the legalization pass).
We have two use three instructions InterpolateAtCentroid, InterpolateAtSample, and InterpolateAtOffset of GLSL.std.450 extended instruction set for corresponding EvaluateAttribute*.
We are also relying on EvaluateAttributeAtSample() HLSL instruction in our code. This is now the only thing we haven't been able to port to Vulkan. Not dramatic, but our tree shadows looked better in D3D11, what is a bit frustrating.
I'm also interested in this. I tried using the SPIR-V intrinsics but not sure how to get the interpolant into the Input storage class. Here is what I tried:
Activity
jaebaek commentedon Mar 31, 2021
KhronosGroup/SPIRV-Tools#4220 is the spirv-opt PR.
jaebaek commentedon Jul 13, 2021
We have two use three instructions
InterpolateAtCentroid,InterpolateAtSample, andInterpolateAtOffsetof GLSL.std.450 extended instruction set for correspondingEvaluateAttribute*.gjaegy commentedon Jan 6, 2022
We are also relying on EvaluateAttributeAtSample() HLSL instruction in our code. This is now the only thing we haven't been able to port to Vulkan. Not dramatic, but our tree shadows looked better in D3D11, what is a bit frustrating.
Is there any update on that issue ?
Thanks a lot !
pdoane commentedon Apr 6, 2022
I'm also interested in this. I tried using the SPIR-V intrinsics but not sure how to get the interpolant into the Input storage class. Here is what I tried:
which outputs:
opt: Mark InterpolateAt* argument as live
opt: Mark InterpolateAt* argument as live for DCE (#5824)
[SPIR-V] Implement EvaluateAttribute* functions
[SPIR-V] Implement EvaluateAttribute* functions
[SPIR-V] Implement EvaluateAttribute* functions (microsoft#6945)
opt: Mark InterpolateAt* argument as live for DCE (KhronosGroup#5824)
[SPIR-V] Implement EvaluateAttribute* functions (microsoft#6945)