dx11: work around some float literal precision issue with the compiler
For some reason the directx compiler doesn't convert float literal in a deterministic way (!). A difference of one ulp can be seen between different compilation of the same code. This causes an issue with the rounding of the alpha value for PT polys. Issue #1207
This commit is contained in:
parent
496429d6f4
commit
5eddc26850
|
@ -295,7 +295,7 @@ PSO main(in Pixel inpix)
|
|||
#endif
|
||||
|
||||
#if cp_AlphaTest == 1
|
||||
color.a = round(color.a * 255.0f) / 255.0f;
|
||||
color.a = round(color.a * 255.0f) * 0.0039215688593685626983642578125; // 1 / 255
|
||||
if (alphaTestValue > color.a)
|
||||
discard;
|
||||
color.a = 1.0f;
|
||||
|
|
|
@ -521,7 +521,7 @@ PSO main(in VertexIn inpix)
|
|||
color *= trilinearAlpha;
|
||||
|
||||
#if cp_AlphaTest == 1
|
||||
color.a = round(color.a * 255.0f) / 255.0f;
|
||||
color.a = round(color.a * 255.0f) * 0.0039215688593685626983642578125; // 1 / 255
|
||||
if (alphaTestValue > color.a)
|
||||
discard;
|
||||
color.a = 1.0f;
|
||||
|
|
Loading…
Reference in New Issue