diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-01 05:29:31 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:29 +0200 |
commit | f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6 (patch) | |
tree | 7d40909d8644a405724c21e66f1e566c38fe1119 | |
parent | shader: Fix IADD3.CC (diff) | |
download | yuzu-f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6.tar yuzu-f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6.tar.gz yuzu-f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6.tar.bz2 yuzu-f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6.tar.lz yuzu-f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6.tar.xz yuzu-f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6.tar.zst yuzu-f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6.zip |
-rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 76080bde1..9f5d30fe8 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -253,6 +253,7 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { std::array<ImageId, MAX_IMAGE_ELEMENTS> image_view_ids; std::array<u32, MAX_IMAGE_ELEMENTS> image_view_indices; std::array<VkSampler, MAX_IMAGE_ELEMENTS> samplers; + size_t sampler_index{}; size_t image_index{}; texture_cache.SynchronizeGraphicsDescriptors(); @@ -312,11 +313,10 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { for (const auto& desc : info.texture_descriptors) { for (u32 index = 0; index < desc.count; ++index) { const TextureHandle handle{read_handle(desc, index)}; - image_view_indices[image_index] = handle.image; + image_view_indices[image_index++] = handle.image; Sampler* const sampler{texture_cache.GetGraphicsSampler(handle.sampler)}; - samplers[image_index] = sampler->Handle(); - ++image_index; + samplers[sampler_index++] = sampler->Handle(); } } if constexpr (Spec::has_images) { @@ -360,10 +360,9 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { ++texture_buffer_index; } }}; + buffer_cache.UnbindGraphicsTextureBuffers(stage); + const Shader::Info& info{stage_infos[stage]}; - if constexpr (Spec::has_texture_buffers || Spec::has_image_buffers) { - buffer_cache.UnbindGraphicsTextureBuffers(stage); - } if constexpr (Spec::has_texture_buffers) { for (const auto& desc : info.texture_buffer_descriptors) { add_buffer(desc); @@ -443,7 +442,9 @@ void GraphicsPipeline::ConfigureDraw() { const bool bind_pipeline{scheduler.UpdateGraphicsPipeline(this)}; const void* const descriptor_data{update_descriptor_queue.UpdateData()}; scheduler.Record([this, descriptor_data, bind_pipeline](vk::CommandBuffer cmdbuf) { - cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline); + if (bind_pipeline) { + cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline); + } if (!descriptor_set_layout) { return; } |