rsx: Fix user clip plane encode/decode

This commit is contained in:
kd-11
2025-10-14 01:11:26 +03:00
committed by kd-11
parent 1cae72c872
commit a5b5ac1ed5
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -589,7 +589,7 @@ namespace rsx
{ {
if (REGS(m_ctx)->clip_planes_mask() == 0) [[ likely ]] if (REGS(m_ctx)->clip_planes_mask() == 0) [[ likely ]]
{ {
*reinterpret_cast<u32*>(buffer) = 0u; *reinterpret_cast<u32*>(buffer) = 0b0101010101010101;
return; return;
} }
@@ -631,7 +631,7 @@ namespace rsx
break; break;
case rsx::user_clip_plane_op::less_than: case rsx::user_clip_plane_op::less_than:
clip_configuration_field |= CLIP_DISTANCE_FACTOR(2) << shift_offset; clip_configuration_field |= CLIP_DISTANCE_FACTOR(-1) << shift_offset;
break; break;
} }
} }
+1 -1
View File
@@ -182,7 +182,7 @@ namespace glsl
OS << OS <<
"#define CLIP_PLANE_DISABLED 1\n" "#define CLIP_PLANE_DISABLED 1\n"
"#define is_user_clip_enabled(idx) (_get_bits(get_user_clip_config(), idx * 2, 2) != CLIP_PLANE_DISABLED)\n" "#define is_user_clip_enabled(idx) (_get_bits(get_user_clip_config(), idx * 2, 2) != CLIP_PLANE_DISABLED)\n"
"#define user_clip_factor(idx) float(_get_bits(get_user_clip_config(), idx * 2, 2) - 1)\n\n"; "#define user_clip_factor(idx) (float(_get_bits(get_user_clip_config(), idx * 2, 2)) - 1.f)\n\n";
} }
if (props.domain == glsl::program_domain::glsl_fragment_program) if (props.domain == glsl::program_domain::glsl_fragment_program)