mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
rsx: Fix depth clipping
This commit is contained in:
parent
c5074ba81f
commit
7ca2c444cc
7 changed files with 39 additions and 29 deletions
|
@ -790,8 +790,14 @@ namespace rsx
|
|||
if (flip_y) scale_y *= -1;
|
||||
if (flip_y) offset_y *= -1;
|
||||
|
||||
float scale_z = rsx::method_registers.viewport_scale_z();
|
||||
float offset_z = rsx::method_registers.viewport_offset_z();
|
||||
float clip_min = rsx::method_registers.clip_min();
|
||||
float clip_max = rsx::method_registers.clip_max();
|
||||
|
||||
float z_clip_scale = (clip_max + clip_min) == 0.f ? 1.f : (clip_max + clip_min);
|
||||
float z_offset_scale = (clip_max - clip_min) == 0.f ? 1.f : (clip_max - clip_min);
|
||||
|
||||
float scale_z = rsx::method_registers.viewport_scale_z() / z_clip_scale;
|
||||
float offset_z = rsx::method_registers.viewport_offset_z() / z_offset_scale;
|
||||
float one = 1.f;
|
||||
|
||||
stream_vector(buffer, (u32&)scale_x, 0, 0, (u32&)offset_x);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue