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_graphics_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 '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index a0ef0e98b..afdd8b371 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -169,19 +169,23 @@ void GraphicsPipeline::Configure(bool is_indexed) { ++index; } const auto& cbufs{maxwell3d.state.shader_stages[stage].const_buffers}; - 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(cbufs[cbuf_index].enabled); 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.GetGraphicsSampler(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()); buffer_cache.UpdateGraphicsBuffers(is_indexed); |