diff options
| author | 2021-05-30 02:57:42 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:34 -0400 | |
| commit | a7e9756671be5bb99566277709e5becdea774f34 (patch) | |
| tree | 060a277d1150fb671c0365fb51490584939993b9 /src/video_core/renderer_vulkan | |
| parent | shader: Always initialize up reference in structure control flow (diff) | |
| download | yuzu-a7e9756671be5bb99566277709e5becdea774f34.tar.gz yuzu-a7e9756671be5bb99566277709e5becdea774f34.tar.xz yuzu-a7e9756671be5bb99566277709e5becdea774f34.zip | |
buffer_cache: Mark uniform buffers as dirty if any enable bit changes
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.h | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index e5f54a84f..dfe6e6a80 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -218,6 +218,9 @@ GraphicsPipeline::GraphicsPipeline(Tegra::Engines::Maxwell3D& maxwell3d_, | |||
| 218 | update_descriptor_queue{update_descriptor_queue_}, spv_modules{std::move(stages)} { | 218 | update_descriptor_queue{update_descriptor_queue_}, spv_modules{std::move(stages)} { |
| 219 | std::ranges::transform(infos, stage_infos.begin(), | 219 | std::ranges::transform(infos, stage_infos.begin(), |
| 220 | [](const Shader::Info* info) { return info ? *info : Shader::Info{}; }); | 220 | [](const Shader::Info* info) { return info ? *info : Shader::Info{}; }); |
| 221 | std::ranges::transform(infos, enabled_uniform_buffers.begin(), [](const Shader::Info* info) { | ||
| 222 | return info ? info->constant_buffer_mask : 0; | ||
| 223 | }); | ||
| 221 | 224 | ||
| 222 | auto func{[this, &render_pass_cache, &descriptor_pool] { | 225 | auto func{[this, &render_pass_cache, &descriptor_pool] { |
| 223 | DescriptorLayoutBuilder builder{MakeBuilder(device, stage_infos)}; | 226 | DescriptorLayoutBuilder builder{MakeBuilder(device, stage_infos)}; |
| @@ -259,11 +262,12 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { | |||
| 259 | 262 | ||
| 260 | texture_cache.SynchronizeGraphicsDescriptors(); | 263 | texture_cache.SynchronizeGraphicsDescriptors(); |
| 261 | 264 | ||
| 265 | buffer_cache.SetEnabledUniformBuffers(enabled_uniform_buffers); | ||
| 266 | |||
| 262 | const auto& regs{maxwell3d.regs}; | 267 | const auto& regs{maxwell3d.regs}; |
| 263 | const bool via_header_index{regs.sampler_index == Maxwell::SamplerIndex::ViaHeaderIndex}; | 268 | const bool via_header_index{regs.sampler_index == Maxwell::SamplerIndex::ViaHeaderIndex}; |
| 264 | const auto config_stage{[&](size_t stage) LAMBDA_FORCEINLINE { | 269 | const auto config_stage{[&](size_t stage) LAMBDA_FORCEINLINE { |
| 265 | const Shader::Info& info{stage_infos[stage]}; | 270 | const Shader::Info& info{stage_infos[stage]}; |
| 266 | buffer_cache.SetEnabledUniformBuffers(stage, info.constant_buffer_mask); | ||
| 267 | buffer_cache.UnbindGraphicsStorageBuffers(stage); | 271 | buffer_cache.UnbindGraphicsStorageBuffers(stage); |
| 268 | if constexpr (Spec::has_storage_buffers) { | 272 | if constexpr (Spec::has_storage_buffers) { |
| 269 | size_t ssbo_index{}; | 273 | size_t ssbo_index{}; |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index e362d13c5..4068a0edc 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h | |||
| @@ -128,7 +128,10 @@ private: | |||
| 128 | std::vector<GraphicsPipeline*> transitions; | 128 | std::vector<GraphicsPipeline*> transitions; |
| 129 | 129 | ||
| 130 | std::array<vk::ShaderModule, NUM_STAGES> spv_modules; | 130 | std::array<vk::ShaderModule, NUM_STAGES> spv_modules; |
| 131 | |||
| 131 | std::array<Shader::Info, NUM_STAGES> stage_infos; | 132 | std::array<Shader::Info, NUM_STAGES> stage_infos; |
| 133 | std::array<u32, 5> enabled_uniform_buffers{}; | ||
| 134 | |||
| 132 | vk::DescriptorSetLayout descriptor_set_layout; | 135 | vk::DescriptorSetLayout descriptor_set_layout; |
| 133 | DescriptorAllocator descriptor_allocator; | 136 | DescriptorAllocator descriptor_allocator; |
| 134 | vk::PipelineLayout pipeline_layout; | 137 | vk::PipelineLayout pipeline_layout; |