rsx:: Use fcmp correctly

This commit is contained in:
kd-11 2019-10-25 20:06:24 +03:00 committed by kd-11
parent d04241ad25
commit ad2add9574
2 changed files with 7 additions and 11 deletions

View File

@ -1558,8 +1558,9 @@ private:
if (info.magFilter != mag_filter || info.minFilter != min_filter || info.mipmapMode != mipmap_mode ||
info.addressModeU != clamp_u || info.addressModeV != clamp_v || info.addressModeW != clamp_w ||
info.compareEnable != depth_compare || info.unnormalizedCoordinates != unnormalized_coordinates ||
info.mipLodBias != mipLodBias || info.maxAnisotropy != max_anisotropy || info.maxLod != max_lod ||
info.minLod != min_lod || info.compareOp != depth_compare_mode || info.borderColor != border_color)
!rsx::fcmp(info.maxLod, max_lod) || !rsx::fcmp(info.mipLodBias, mipLodBias) || !rsx::fcmp(info.minLod, min_lod) ||
!rsx::fcmp(info.maxAnisotropy, max_anisotropy) ||
info.compareOp != depth_compare_mode || info.borderColor != border_color)
return false;
return true;

View File

@ -45,11 +45,6 @@ namespace vk
std::unordered_multimap<u64, std::unique_ptr<vk::sampler>> m_sampler_pool;
std::deque<eid_scope_t> m_eid_map;
bool value_compare(const f32& a, const f32& b)
{
return fabsf(a - b) < 0.0000001f;
}
eid_scope_t& get_current_eid_scope()
{
const auto eid = current_event_id();
@ -94,10 +89,10 @@ namespace vk
for (auto It = found.first; It != found.second; ++It)
{
const auto& info = It->second->info;
if (!value_compare(info.mipLodBias, mipLodBias) ||
!value_compare(info.maxAnisotropy, max_anisotropy) ||
!value_compare(info.minLod, min_lod) ||
!value_compare(info.maxLod, max_lod))
if (!rsx::fcmp(info.maxLod, max_lod) ||
!rsx::fcmp(info.mipLodBias, mipLodBias) ||
!rsx::fcmp(info.minLod, min_lod) ||
!rsx::fcmp(info.maxAnisotropy, max_anisotropy))
{
continue;
}