mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00: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";
|
||||
if (props.srgb_output_rounding)
|
||||
{
|
||||
const auto scale = (props.supports_native_fp16) ? "float16_t(255.)" : "255.";
|
||||
OS << "#define round_to_8bit(v4) (round(v4 * " << scale << ") / " << scale << ")\n\n";
|
||||
const auto _255 = (props.supports_native_fp16) ? "f16vec4(255.)" : "vec4(255.)";
|
||||
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
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue