mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
TextureConversionShader: Use round() instead of roundEven() in HLSL
HLSL does not define roundEven(), only round(). This means that the output may differ slightly for OpenGL vs Direct3D. However, it ensures consistency across OpenGL drivers, as round() in GLSL can go either way.
This commit is contained in:
parent
e0ffce2785
commit
d0601c0a83
@ -72,6 +72,12 @@ static void WriteSwizzler(char*& p, EFBCopyFormat format, APIType ApiType)
|
||||
WRITE(p, "uniform float y_scale;\n");
|
||||
}
|
||||
|
||||
// D3D does not have roundEven(), only round(), which is specified "to the nearest integer".
|
||||
// This differs from the roundEven() behavior, but to get consistency across drivers in OpenGL
|
||||
// we need to use roundEven().
|
||||
if (ApiType == APIType::D3D)
|
||||
WRITE(p, "#define roundEven(x) round(x)\n");
|
||||
|
||||
// Alpha channel in the copy is set to 1 the EFB format does not have an alpha channel.
|
||||
WRITE(p, "float4 RGBA8ToRGB8(float4 src)\n");
|
||||
WRITE(p, "{\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user