diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-04-06 07:56:15 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:26 +0200 |
commit | 1f3eb601acdcdfa4c119cffbf36b5792147b893f (patch) | |
tree | 1a8dcc5e4ce11e9090dd6d7a8b4e8aaa130ff67b /src/video_core/renderer_vulkan/vk_compute_pipeline.cpp | |
parent | shader: Address feedback (diff) | |
download | yuzu-1f3eb601acdcdfa4c119cffbf36b5792147b893f.tar yuzu-1f3eb601acdcdfa4c119cffbf36b5792147b893f.tar.gz yuzu-1f3eb601acdcdfa4c119cffbf36b5792147b893f.tar.bz2 yuzu-1f3eb601acdcdfa4c119cffbf36b5792147b893f.tar.lz yuzu-1f3eb601acdcdfa4c119cffbf36b5792147b893f.tar.xz yuzu-1f3eb601acdcdfa4c119cffbf36b5792147b893f.tar.zst yuzu-1f3eb601acdcdfa4c119cffbf36b5792147b893f.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_compute_pipeline.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_compute_pipeline.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index 0bb5b852d..9922cbd0f 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp @@ -93,20 +93,23 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, const auto& launch_desc{kepler_compute.launch_description}; const auto& cbufs{launch_desc.const_buffer_config}; const bool via_header_index{launch_desc.linked_tsc}; - for (const auto& desc : info.texture_descriptors) { - const u32 cbuf_index{desc.cbuf_index}; - const u32 cbuf_offset{desc.cbuf_offset}; + const auto read_handle{[&](u32 cbuf_index, u32 cbuf_offset) { ASSERT(((launch_desc.const_buffer_enable_mask >> cbuf_index) & 1) != 0); - const GPUVAddr addr{cbufs[cbuf_index].Address() + cbuf_offset}; const u32 raw_handle{gpu_memory.Read<u32>(addr)}; - - const TextureHandle handle(raw_handle, via_header_index); + return TextureHandle(raw_handle, via_header_index); + }}; + for (const auto& desc : info.texture_descriptors) { + const TextureHandle handle{read_handle(desc.cbuf_index, desc.cbuf_offset)}; image_view_indices.push_back(handle.image); Sampler* const sampler = texture_cache.GetComputeSampler(handle.sampler); samplers.push_back(sampler->Handle()); } + for (const auto& desc : info.texture_buffer_descriptors) { + const TextureHandle handle{read_handle(desc.cbuf_index, desc.cbuf_offset)}; + image_view_indices.push_back(handle.image); + } const std::span indices_span(image_view_indices.data(), image_view_indices.size()); texture_cache.FillComputeImageViews(indices_span, image_view_ids); |