diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-04-07 01:14:55 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:26 +0200 |
commit | e9a91bc5cc2c39b476ba8946f66930f5ab5608b2 (patch) | |
tree | ad75617771ba4093c5609a505e3c8926668eb533 /src/video_core/renderer_vulkan/pipeline_helper.h | |
parent | shader: Fix F2I (diff) | |
download | yuzu-e9a91bc5cc2c39b476ba8946f66930f5ab5608b2.tar yuzu-e9a91bc5cc2c39b476ba8946f66930f5ab5608b2.tar.gz yuzu-e9a91bc5cc2c39b476ba8946f66930f5ab5608b2.tar.bz2 yuzu-e9a91bc5cc2c39b476ba8946f66930f5ab5608b2.tar.lz yuzu-e9a91bc5cc2c39b476ba8946f66930f5ab5608b2.tar.xz yuzu-e9a91bc5cc2c39b476ba8946f66930f5ab5608b2.tar.zst yuzu-e9a91bc5cc2c39b476ba8946f66930f5ab5608b2.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/pipeline_helper.h')
-rw-r--r-- | src/video_core/renderer_vulkan/pipeline_helper.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h index decf0d32c..cff93cc60 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h @@ -24,7 +24,8 @@ struct TextureHandle { [[likely]] if (via_header_index) { image = data; sampler = data; - } else { + } + else { const Tegra::Texture::TextureHandle handle{data}; image = handle.tic_id; sampler = via_header_index ? image : handle.tsc_id.Value(); @@ -90,12 +91,12 @@ public: for ([[maybe_unused]] const auto& desc : info.storage_buffers_descriptors) { Add(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, stage); } + for ([[maybe_unused]] const auto& desc : info.texture_buffer_descriptors) { + Add(VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, stage); + } for ([[maybe_unused]] const auto& desc : info.texture_descriptors) { Add(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, stage); } - for (const auto& desc : info.texture_buffer_descriptors) { - Add(VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, stage); - } } private: @@ -156,20 +157,15 @@ inline VideoCommon::ImageViewType CastType(Shader::TextureType type) { return {}; } -inline void PushImageDescriptors(const Shader::Info& info, const VkSampler* samplers, - const ImageId* image_view_ids, TextureCache& texture_cache, - VKUpdateDescriptorQueue& update_descriptor_queue, size_t& index) { +inline void PushImageDescriptors(const Shader::Info& info, const VkSampler*& samplers, + const ImageId*& image_view_ids, TextureCache& texture_cache, + VKUpdateDescriptorQueue& update_descriptor_queue) { + image_view_ids += info.texture_buffer_descriptors.size(); for (const auto& desc : info.texture_descriptors) { - const VkSampler sampler{samplers[index]}; - ImageView& image_view{texture_cache.GetImageView(image_view_ids[index])}; + const VkSampler sampler{*(samplers++)}; + ImageView& image_view{texture_cache.GetImageView(*(image_view_ids++))}; const VkImageView vk_image_view{image_view.Handle(CastType(desc.type))}; update_descriptor_queue.AddSampledImage(vk_image_view, sampler); - ++index; - } - for (const auto& desc : info.texture_buffer_descriptors) { - ImageView& image_view{texture_cache.GetImageView(image_view_ids[index])}; - update_descriptor_queue.AddTexelBuffer(image_view.BufferView()); - ++index; } } |