mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
rsx: Clamp depth range to [0,1]
- Fixes remaining issues with Ni no Kuni
This commit is contained in:
parent
bbf2a97d2e
commit
6eb1786635
2 changed files with 16 additions and 4 deletions
|
@ -257,8 +257,8 @@ namespace rsx
|
|||
|
||||
//zcull
|
||||
virtual void notify_zcull_info_changed() {}
|
||||
virtual void clear_zcull_stats(u32 type) {}
|
||||
virtual u32 get_zcull_stats(u32 type) { return UINT32_MAX; }
|
||||
virtual void clear_zcull_stats(u32 /*type*/) {}
|
||||
virtual u32 get_zcull_stats(u32 /*type*/) { return UINT32_MAX; }
|
||||
|
||||
gsl::span<const gsl::byte> get_raw_index_array(const std::vector<std::pair<u32, u32> >& draw_indexed_clause) const;
|
||||
gsl::span<const gsl::byte> get_raw_vertex_buffer(const rsx::data_array_format_info&, u32 base_offset, const std::vector<std::pair<u32, u32>>& vertex_ranges) const;
|
||||
|
|
|
@ -376,12 +376,24 @@ namespace rsx
|
|||
|
||||
f32 clip_min() const
|
||||
{
|
||||
return decode<NV4097_SET_CLIP_MIN>().clip_min();
|
||||
f32 depth_min = decode<NV4097_SET_CLIP_MIN>().clip_min();
|
||||
|
||||
//Clamp to [0, 1]
|
||||
if (depth_min < 0.f) return 0.f;
|
||||
if (depth_min > 1.f) return 1.f;
|
||||
|
||||
return depth_min;
|
||||
}
|
||||
|
||||
f32 clip_max() const
|
||||
{
|
||||
return decode<NV4097_SET_CLIP_MAX>().clip_max();
|
||||
f32 depth_max = decode<NV4097_SET_CLIP_MAX>().clip_max();
|
||||
|
||||
//Clamp to [0, 1]
|
||||
if (depth_max < 0.f) return 0.f;
|
||||
if (depth_max > 1.f) return 1.f;
|
||||
|
||||
return depth_max;
|
||||
}
|
||||
|
||||
bool logic_op_enabled() const
|
||||
|
|
Loading…
Add table
Reference in a new issue