diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-01-03 23:15:24 +0100 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2020-01-24 21:43:29 +0100 |
commit | 1e4b6bef6f1b278bdc99170b76f33179a2eff26f (patch) | |
tree | 1f61df883d015efc725638d811c76ea82723861d /src/video_core/shader/const_buffer_locker.cpp | |
parent | GPU: Implement guest driver profile and deduce texture handler sizes. (diff) | |
download | yuzu-1e4b6bef6f1b278bdc99170b76f33179a2eff26f.tar yuzu-1e4b6bef6f1b278bdc99170b76f33179a2eff26f.tar.gz yuzu-1e4b6bef6f1b278bdc99170b76f33179a2eff26f.tar.bz2 yuzu-1e4b6bef6f1b278bdc99170b76f33179a2eff26f.tar.lz yuzu-1e4b6bef6f1b278bdc99170b76f33179a2eff26f.tar.xz yuzu-1e4b6bef6f1b278bdc99170b76f33179a2eff26f.tar.zst yuzu-1e4b6bef6f1b278bdc99170b76f33179a2eff26f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/const_buffer_locker.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/video_core/shader/const_buffer_locker.cpp b/src/video_core/shader/const_buffer_locker.cpp index a4a0319eb..0638be8cb 100644 --- a/src/video_core/shader/const_buffer_locker.cpp +++ b/src/video_core/shader/const_buffer_locker.cpp @@ -66,6 +66,18 @@ std::optional<Tegra::Engines::SamplerDescriptor> ConstBufferLocker::ObtainBindle return value; } +std::optional<u32> ConstBufferLocker::ObtainBoundBuffer() { + if (bound_buffer_saved) { + return bound_buffer; + } + if (!engine) { + return std::nullopt; + } + bound_buffer_saved = true; + bound_buffer = engine->GetBoundBuffer(); + return bound_buffer; +} + void ConstBufferLocker::InsertKey(u32 buffer, u32 offset, u32 value) { keys.insert_or_assign({buffer, offset}, value); } @@ -78,6 +90,11 @@ void ConstBufferLocker::InsertBindlessSampler(u32 buffer, u32 offset, SamplerDes bindless_samplers.insert_or_assign({buffer, offset}, sampler); } +void ConstBufferLocker::SetBoundBuffer(u32 buffer) { + bound_buffer_saved = true; + bound_buffer = buffer; +} + bool ConstBufferLocker::IsConsistent() const { if (!engine) { return false; |