diff options
Diffstat (limited to 'src/video_core/shader/registry.cpp')
| -rw-r--r-- | src/video_core/shader/registry.cpp | 20 |
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 | ||
| 96 | std::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 | |||
| 96 | std::optional<Tegra::Engines::SamplerDescriptor> Registry::ObtainBindlessSampler(u32 buffer, | 116 | std::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}; |