diff options
author | FengChen <vonchenplus@gmail.com> | 2022-10-21 13:14:22 +0200 |
---|---|---|
committer | FengChen <vonchenplus@gmail.com> | 2022-10-22 10:58:23 +0200 |
commit | 2f90694797e30088820937855acf613bdcf27247 (patch) | |
tree | e0eeea1cd4b5ca0aae9319a670ad968b0b5f658e /src/video_core/renderer_vulkan/vk_rasterizer.cpp | |
parent | video_coare: Reimplementing the maxwell drawing trigger mechanism (diff) | |
download | yuzu-2f90694797e30088820937855acf613bdcf27247.tar yuzu-2f90694797e30088820937855acf613bdcf27247.tar.gz yuzu-2f90694797e30088820937855acf613bdcf27247.tar.bz2 yuzu-2f90694797e30088820937855acf613bdcf27247.tar.lz yuzu-2f90694797e30088820937855acf613bdcf27247.tar.xz yuzu-2f90694797e30088820937855acf613bdcf27247.tar.zst yuzu-2f90694797e30088820937855acf613bdcf27247.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 9a7d90b2a..9f05a7a18 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -193,6 +193,8 @@ void RasterizerVulkan::Draw(bool is_indexed, u32 instance_count) { pipeline->SetEngine(maxwell3d, gpu_memory); pipeline->Configure(is_indexed); + BindInlineIndexBuffer(); + BeginTransformFeedback(); UpdateDynamicStates(); @@ -1008,4 +1010,17 @@ void RasterizerVulkan::ReleaseChannel(s32 channel_id) { query_cache.EraseChannel(channel_id); } +void RasterizerVulkan::BindInlineIndexBuffer() { + if (maxwell3d->inline_index_draw_indexes.empty()) { + return; + } + const auto data_count = static_cast<u32>(maxwell3d->inline_index_draw_indexes.size()); + auto buffer = buffer_cache_runtime.UploadStagingBuffer(data_count); + std::memcpy(buffer.mapped_span.data(), maxwell3d->inline_index_draw_indexes.data(), data_count); + buffer_cache_runtime.BindIndexBuffer( + maxwell3d->regs.draw.topology, maxwell3d->regs.index_buffer.format, + maxwell3d->regs.index_buffer.first, maxwell3d->regs.index_buffer.count, buffer.buffer, + static_cast<u32>(buffer.offset), data_count); +} + } // namespace Vulkan |