mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
rsx: Fix coordinate scaling for shadow access (#10668)
- For shadow2DProj the 3rd coordinate is actually the depth value, do not scale
This commit is contained in:
parent
456b649b19
commit
f745971cc8
2 changed files with 11 additions and 4 deletions
|
@ -2010,11 +2010,18 @@ namespace rsx
|
|||
|
||||
if (is_unnormalized)
|
||||
{
|
||||
if (extended_dimension <= rsx::texture_dimension_extended::texture_dimension_2d)
|
||||
switch (extended_dimension)
|
||||
{
|
||||
scale.width /= attributes.width;
|
||||
scale.height /= attributes.height;
|
||||
case rsx::texture_dimension_extended::texture_dimension_3d:
|
||||
case rsx::texture_dimension_extended::texture_dimension_cubemap:
|
||||
scale.depth /= attributes.depth;
|
||||
[[ fallthrough ]];
|
||||
case rsx::texture_dimension_extended::texture_dimension_2d:
|
||||
scale.height /= attributes.height;
|
||||
[[ fallthrough ]];
|
||||
default:
|
||||
scale.width /= attributes.width;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -881,7 +881,7 @@ namespace glsl
|
|||
OS <<
|
||||
"#define TEX2D_SHADOW(index, coord3) texture(TEX_NAME(index), vec3(COORD_SCALE2(index, coord3.xy), coord3.z))\n"
|
||||
"#define TEX2D_SHADOWCUBE(index, coord4) texture(TEX_NAME(index), vec4(COORD_SCALE3(index, coord4.xyz), coord4.w))\n"
|
||||
"#define TEX2D_SHADOWPROJ(index, coord4) textureProj(TEX_NAME(index), vec4(COORD_SCALE3(index, coord4.xyz), coord4.w))\n";
|
||||
"#define TEX2D_SHADOWPROJ(index, coord4) textureProj(TEX_NAME(index), vec4(COORD_SCALE2(index, coord4.xy), coord4.zw))\n";
|
||||
}
|
||||
|
||||
OS <<
|
||||
|
|
Loading…
Add table
Reference in a new issue