summaryrefslogtreecommitdiff
path: root/src/video_core/shader/registry.cpp
diff options
context:
space:
mode:
authorGravatar VolcaEM2020-06-25 23:34:37 +0200
committerGravatar GitHub2020-06-25 23:34:37 +0200
commit0f4512291a0504b32fac248f73a68fec34f657fe (patch)
tree3c69736a2ac82a9a0076ec3b79673c814e5f1abd /src/video_core/shader/registry.cpp
parentFix typo 2: electric boogaloo (diff)
parentMerge pull request #4136 from VolcaEM/mods (diff)
downloadyuzu-0f4512291a0504b32fac248f73a68fec34f657fe.tar.gz
yuzu-0f4512291a0504b32fac248f73a68fec34f657fe.tar.xz
yuzu-0f4512291a0504b32fac248f73a68fec34f657fe.zip
Merge branch 'master' into quickstart-faq
Diffstat (limited to 'src/video_core/shader/registry.cpp')
-rw-r--r--src/video_core/shader/registry.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/video_core/shader/registry.cpp b/src/video_core/shader/registry.cpp
index af70b3f35..cdf274e54 100644
--- a/src/video_core/shader/registry.cpp
+++ b/src/video_core/shader/registry.cpp
@@ -93,6 +93,26 @@ std::optional<SamplerDescriptor> Registry::ObtainBoundSampler(u32 offset) {
93 return value; 93 return value;
94} 94}
95 95
96std::optional<Tegra::Engines::SamplerDescriptor> Registry::ObtainSeparateSampler(
97 std::pair<u32, u32> buffers, std::pair<u32, u32> offsets) {
98 SeparateSamplerKey key;
99 key.buffers = buffers;
100 key.offsets = offsets;
101 const auto iter = separate_samplers.find(key);
102 if (iter != separate_samplers.end()) {
103 return iter->second;
104 }
105 if (!engine) {
106 return std::nullopt;
107 }
108
109 const u32 handle_1 = engine->AccessConstBuffer32(stage, key.buffers.first, key.offsets.first);
110 const u32 handle_2 = engine->AccessConstBuffer32(stage, key.buffers.second, key.offsets.second);
111 const SamplerDescriptor value = engine->AccessSampler(handle_1 | handle_2);
112 separate_samplers.emplace(key, value);
113 return value;
114}
115
96std::optional<Tegra::Engines::SamplerDescriptor> Registry::ObtainBindlessSampler(u32 buffer, 116std::optional<Tegra::Engines::SamplerDescriptor> Registry::ObtainBindlessSampler(u32 buffer,
97 u32 offset) { 117 u32 offset) {
98 const std::pair key = {buffer, offset}; 118 const std::pair key = {buffer, offset};