rsx: Clamp depth range to [0,1]

- Fixes remaining issues with Ni no Kuni
This commit is contained in:
kd-11 2017-08-11 15:16:56 +03:00
parent bbf2a97d2e
commit 6eb1786635
2 changed files with 16 additions and 4 deletions

View file

@ -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;

View file

@ -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