summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-05-30 07:57:42 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:34 +0200
commita7e9756671be5bb99566277709e5becdea774f34 (patch)
tree060a277d1150fb671c0365fb51490584939993b9 /src/video_core/renderer_vulkan
parentshader: Always initialize up reference in structure control flow (diff)
downloadyuzu-a7e9756671be5bb99566277709e5becdea774f34.tar
yuzu-a7e9756671be5bb99566277709e5becdea774f34.tar.gz
yuzu-a7e9756671be5bb99566277709e5becdea774f34.tar.bz2
yuzu-a7e9756671be5bb99566277709e5becdea774f34.tar.lz
yuzu-a7e9756671be5bb99566277709e5becdea774f34.tar.xz
yuzu-a7e9756671be5bb99566277709e5becdea774f34.tar.zst
yuzu-a7e9756671be5bb99566277709e5becdea774f34.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.h3
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_,
update_descriptor_queue{update_descriptor_queue_}, spv_modules{std::move(stages)} {
std::ranges::transform(infos, stage_infos.begin(),
[](const Shader::Info* info) { return info ? *info : Shader::Info{}; });
+ std::ranges::transform(infos, enabled_uniform_buffers.begin(), [](const Shader::Info* info) {
+ return info ? info->constant_buffer_mask : 0;
+ });
auto func{[this, &render_pass_cache, &descriptor_pool] {
DescriptorLayoutBuilder builder{MakeBuilder(device, stage_infos)};
@@ -259,11 +262,12 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
texture_cache.SynchronizeGraphicsDescriptors();
+ buffer_cache.SetEnabledUniformBuffers(enabled_uniform_buffers);
+
const auto& regs{maxwell3d.regs};
const bool via_header_index{regs.sampler_index == Maxwell::SamplerIndex::ViaHeaderIndex};
const auto config_stage{[&](size_t stage) LAMBDA_FORCEINLINE {
const Shader::Info& info{stage_infos[stage]};
- buffer_cache.SetEnabledUniformBuffers(stage, info.constant_buffer_mask);
buffer_cache.UnbindGraphicsStorageBuffers(stage);
if constexpr (Spec::has_storage_buffers) {
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:
std::vector<GraphicsPipeline*> transitions;
std::array<vk::ShaderModule, NUM_STAGES> spv_modules;
+
std::array<Shader::Info, NUM_STAGES> stage_infos;
+ std::array<u32, 5> enabled_uniform_buffers{};
+
vk::DescriptorSetLayout descriptor_set_layout;
DescriptorAllocator descriptor_allocator;
vk::PipelineLayout pipeline_layout;