diff options
| author | 2021-05-01 00:29:31 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:29 -0400 | |
| commit | f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6 (patch) | |
| tree | 7d40909d8644a405724c21e66f1e566c38fe1119 /src | |
| parent | shader: Fix IADD3.CC (diff) | |
| download | yuzu-f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6.tar.gz yuzu-f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6.tar.xz yuzu-f4b82b8dd70a57b5a828bcdbecf9aefd1bd240b6.zip | |
vk_graphics_pipeline: Fix texture buffer descriptors
Diffstat (limited to 'src')
| -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) { | |||
| 253 | std::array<ImageId, MAX_IMAGE_ELEMENTS> image_view_ids; | 253 | std::array<ImageId, MAX_IMAGE_ELEMENTS> image_view_ids; |
| 254 | std::array<u32, MAX_IMAGE_ELEMENTS> image_view_indices; | 254 | std::array<u32, MAX_IMAGE_ELEMENTS> image_view_indices; |
| 255 | std::array<VkSampler, MAX_IMAGE_ELEMENTS> samplers; | 255 | std::array<VkSampler, MAX_IMAGE_ELEMENTS> samplers; |
| 256 | size_t sampler_index{}; | ||
| 256 | size_t image_index{}; | 257 | size_t image_index{}; |
| 257 | 258 | ||
| 258 | texture_cache.SynchronizeGraphicsDescriptors(); | 259 | texture_cache.SynchronizeGraphicsDescriptors(); |
| @@ -312,11 +313,10 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { | |||
| 312 | for (const auto& desc : info.texture_descriptors) { | 313 | for (const auto& desc : info.texture_descriptors) { |
| 313 | for (u32 index = 0; index < desc.count; ++index) { | 314 | for (u32 index = 0; index < desc.count; ++index) { |
| 314 | const TextureHandle handle{read_handle(desc, index)}; | 315 | const TextureHandle handle{read_handle(desc, index)}; |
| 315 | image_view_indices[image_index] = handle.image; | 316 | image_view_indices[image_index++] = handle.image; |
| 316 | 317 | ||
| 317 | Sampler* const sampler{texture_cache.GetGraphicsSampler(handle.sampler)}; | 318 | Sampler* const sampler{texture_cache.GetGraphicsSampler(handle.sampler)}; |
| 318 | samplers[image_index] = sampler->Handle(); | 319 | samplers[sampler_index++] = sampler->Handle(); |
| 319 | ++image_index; | ||
| 320 | } | 320 | } |
| 321 | } | 321 | } |
| 322 | if constexpr (Spec::has_images) { | 322 | if constexpr (Spec::has_images) { |
| @@ -360,10 +360,9 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { | |||
| 360 | ++texture_buffer_index; | 360 | ++texture_buffer_index; |
| 361 | } | 361 | } |
| 362 | }}; | 362 | }}; |
| 363 | buffer_cache.UnbindGraphicsTextureBuffers(stage); | ||
| 364 | |||
| 363 | const Shader::Info& info{stage_infos[stage]}; | 365 | const Shader::Info& info{stage_infos[stage]}; |
| 364 | if constexpr (Spec::has_texture_buffers || Spec::has_image_buffers) { | ||
| 365 | buffer_cache.UnbindGraphicsTextureBuffers(stage); | ||
| 366 | } | ||
| 367 | if constexpr (Spec::has_texture_buffers) { | 366 | if constexpr (Spec::has_texture_buffers) { |
| 368 | for (const auto& desc : info.texture_buffer_descriptors) { | 367 | for (const auto& desc : info.texture_buffer_descriptors) { |
| 369 | add_buffer(desc); | 368 | add_buffer(desc); |
| @@ -443,7 +442,9 @@ void GraphicsPipeline::ConfigureDraw() { | |||
| 443 | const bool bind_pipeline{scheduler.UpdateGraphicsPipeline(this)}; | 442 | const bool bind_pipeline{scheduler.UpdateGraphicsPipeline(this)}; |
| 444 | const void* const descriptor_data{update_descriptor_queue.UpdateData()}; | 443 | const void* const descriptor_data{update_descriptor_queue.UpdateData()}; |
| 445 | scheduler.Record([this, descriptor_data, bind_pipeline](vk::CommandBuffer cmdbuf) { | 444 | scheduler.Record([this, descriptor_data, bind_pipeline](vk::CommandBuffer cmdbuf) { |
| 446 | cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline); | 445 | if (bind_pipeline) { |
| 446 | cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline); | ||
| 447 | } | ||
| 447 | if (!descriptor_set_layout) { | 448 | if (!descriptor_set_layout) { |
| 448 | return; | 449 | return; |
| 449 | } | 450 | } |