mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
rsx: Optimize 8-bit rounding logic a bit
- NV hw does not like the raw use of round()
This commit is contained in:
parent
c38ca21a81
commit
3e794e7fdb
1 changed files with 3 additions and 2 deletions
|
@ -566,8 +566,9 @@ namespace glsl
|
||||||
OS << "// Workaround broken output rounding behavior\n";
|
OS << "// Workaround broken output rounding behavior\n";
|
||||||
if (props.srgb_output_rounding)
|
if (props.srgb_output_rounding)
|
||||||
{
|
{
|
||||||
const auto scale = (props.supports_native_fp16) ? "float16_t(255.)" : "255.";
|
const auto _255 = (props.supports_native_fp16) ? "f16vec4(255.)" : "vec4(255.)";
|
||||||
OS << "#define round_to_8bit(v4) (round(v4 * " << scale << ") / " << scale << ")\n\n";
|
const auto _1_over_2 = (props.supports_native_fp16) ? "f16vec4(0.5)" : "vec4(0.5)";
|
||||||
|
OS << "#define round_to_8bit(v4) (floor(fma(v4, " << _255 << ", " << _1_over_2 << ")) / " << _255 << ")\n\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue