diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-09-26 05:23:08 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-10-25 15:01:32 +0200 |
commit | 78f3e8a75792c976eb5bfa6df4c020d898642684 (patch) | |
tree | 4c7103c396f180654850362c89d01b46358e58cb /src/video_core/shader/const_buffer_locker.cpp | |
parent | gl_shader_disk_cache: Store and load fast BRX (diff) | |
download | yuzu-78f3e8a75792c976eb5bfa6df4c020d898642684.tar yuzu-78f3e8a75792c976eb5bfa6df4c020d898642684.tar.gz yuzu-78f3e8a75792c976eb5bfa6df4c020d898642684.tar.bz2 yuzu-78f3e8a75792c976eb5bfa6df4c020d898642684.tar.lz yuzu-78f3e8a75792c976eb5bfa6df4c020d898642684.tar.xz yuzu-78f3e8a75792c976eb5bfa6df4c020d898642684.tar.zst yuzu-78f3e8a75792c976eb5bfa6df4c020d898642684.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/const_buffer_locker.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/video_core/shader/const_buffer_locker.cpp b/src/video_core/shader/const_buffer_locker.cpp index fda9e3c38..592bbf657 100644 --- a/src/video_core/shader/const_buffer_locker.cpp +++ b/src/video_core/shader/const_buffer_locker.cpp @@ -82,23 +82,27 @@ bool ConstBufferLocker::IsConsistent() const { return false; } return std::all_of(keys.begin(), keys.end(), - [](const auto& key) { - const auto [value, other_value] = key.first; - return value == other_value; + [this](const auto& pair) { + const auto [cbuf, offset] = pair.first; + const auto value = pair.second; + return value == engine->AccessConstBuffer32(stage, cbuf, offset); }) && std::all_of(bound_samplers.begin(), bound_samplers.end(), [this](const auto& sampler) { const auto [key, value] = sampler; - const auto other_value = engine->AccessBoundSampler(stage, key); - return value == other_value; + return value == engine->AccessBoundSampler(stage, key); }) && - std::all_of( - bindless_samplers.begin(), bindless_samplers.end(), [this](const auto& sampler) { - const auto [cbuf, offset] = sampler.first; - const auto value = sampler.second; - const auto other_value = engine->AccessBindlessSampler(stage, cbuf, offset); - return value == other_value; - }); + std::all_of(bindless_samplers.begin(), bindless_samplers.end(), + [this](const auto& sampler) { + const auto [cbuf, offset] = sampler.first; + const auto value = sampler.second; + return value == engine->AccessBindlessSampler(stage, cbuf, offset); + }); +} + +bool ConstBufferLocker::HasEqualKeys(const ConstBufferLocker& rhs) const { + return keys == rhs.keys && bound_samplers == rhs.bound_samplers && + bindless_samplers == rhs.bindless_samplers; } } // namespace VideoCommon::Shader |