GS-vk: Fix sample_4_index shader.

Macro conditions conditions should return a value.

Fixes bad shader issues on games that trigger it.
Fixes Star Ocean shadows.
Fixes Keroro Gunsou - Mero Mero Battle Royale text.

Make the rounding consistent accross all renderers.
This commit is contained in:
lightningterror 2023-01-19 19:21:11 +01:00
parent 536a4162c4
commit 8f183955a0
1 changed files with 3 additions and 3 deletions

View File

@ -534,14 +534,14 @@ uvec4 sample_4_index(vec4 uv)
c.w = sample_c(uv.zw).a;
// Denormalize value
uvec4 i = uvec4(c * 255.0f + 0.5f);
uvec4 i = uvec4(c * 255.5f);
#if PS_PAL_FMT == 1
// 4HL
c = i & 0xFu;
return i & 0xFu;
#elif PS_PAL_FMT == 2
// 4HH
c = i >> 4u;
return i >> 4u;
#else
// 8
return i;