intel/fs: implement exact ALU support
When ALU instructions are flagged as exact, the expectation is that we do computations at more than 16bits of precision.
This fixes failures in vkd3d-proton's test_shader_instructions_dxil test. The particular code is as follows (HLSL) :
StructuredBuffer<float> Buf : register(t0);
RWStructuredBuffer<half2> RWBuf : register(u0);
[numthreads(4, 1, 1)]
void main(uint thr : SV_DispatchThreadID)
{
precise half result = half(Buf[thr]) - half(Buf[thr ^ 3]);
RWBuf[thr].x = result;
}
With the following values in Buf[] :
1.0f / 0x1000000
2.0f / 0x1000000
3.0f / 0x1000000
4.0f / 0x1000000
The negation of half(Buf[thr ^ 3])
leads to a value that would be
negative in higher precision but instead becomes -0.0f which makes the
computation incorrect for the precise mode.
Signed-off-by: Lionel Landwerlin lionel.g.landwerlin@intel.com Cc: mesa-stable
Edited by Lionel Landwerlin