diff options
| author | 2023-05-11 10:45:36 -0400 | |
|---|---|---|
| committer | 2023-05-11 10:45:36 -0400 | |
| commit | f94186d3c33f83e22576906f0bd88ca5f7e2f079 (patch) | |
| tree | 5e95a7b0dda1d27dc5cc1db631e5a9e100cb72bf | |
| parent | Merge pull request #10224 from yuzu-emu/readme-update (diff) | |
| parent | renderer_vulkan: separate guest and host compute descriptor queues (diff) | |
| download | yuzu-f94186d3c33f83e22576906f0bd88ca5f7e2f079.tar.gz yuzu-f94186d3c33f83e22576906f0bd88ca5f7e2f079.tar.xz yuzu-f94186d3c33f83e22576906f0bd88ca5f7e2f079.zip | |
Merge pull request #10222 from liamwhite/q
renderer_vulkan: separate guest and host compute descriptor queues
Diffstat (limited to '')
16 files changed, 81 insertions, 75 deletions
diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h index 28b893e25..983e1c2e1 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h | |||
| @@ -176,7 +176,7 @@ public: | |||
| 176 | }; | 176 | }; |
| 177 | 177 | ||
| 178 | inline void PushImageDescriptors(TextureCache& texture_cache, | 178 | inline void PushImageDescriptors(TextureCache& texture_cache, |
| 179 | UpdateDescriptorQueue& update_descriptor_queue, | 179 | GuestDescriptorQueue& guest_descriptor_queue, |
| 180 | const Shader::Info& info, RescalingPushConstant& rescaling, | 180 | const Shader::Info& info, RescalingPushConstant& rescaling, |
| 181 | const VkSampler*& samplers, | 181 | const VkSampler*& samplers, |
| 182 | const VideoCommon::ImageViewInOut*& views) { | 182 | const VideoCommon::ImageViewInOut*& views) { |
| @@ -190,7 +190,7 @@ inline void PushImageDescriptors(TextureCache& texture_cache, | |||
| 190 | const VkSampler sampler{*(samplers++)}; | 190 | const VkSampler sampler{*(samplers++)}; |
| 191 | ImageView& image_view{texture_cache.GetImageView(image_view_id)}; | 191 | ImageView& image_view{texture_cache.GetImageView(image_view_id)}; |
| 192 | const VkImageView vk_image_view{image_view.Handle(desc.type)}; | 192 | const VkImageView vk_image_view{image_view.Handle(desc.type)}; |
| 193 | update_descriptor_queue.AddSampledImage(vk_image_view, sampler); | 193 | guest_descriptor_queue.AddSampledImage(vk_image_view, sampler); |
| 194 | rescaling.PushTexture(texture_cache.IsRescaling(image_view)); | 194 | rescaling.PushTexture(texture_cache.IsRescaling(image_view)); |
| 195 | } | 195 | } |
| 196 | } | 196 | } |
| @@ -201,7 +201,7 @@ inline void PushImageDescriptors(TextureCache& texture_cache, | |||
| 201 | texture_cache.MarkModification(image_view.image_id); | 201 | texture_cache.MarkModification(image_view.image_id); |
| 202 | } | 202 | } |
| 203 | const VkImageView vk_image_view{image_view.StorageView(desc.type, desc.format)}; | 203 | const VkImageView vk_image_view{image_view.StorageView(desc.type, desc.format)}; |
| 204 | update_descriptor_queue.AddImage(vk_image_view); | 204 | guest_descriptor_queue.AddImage(vk_image_view); |
| 205 | rescaling.PushImage(texture_cache.IsRescaling(image_view)); | 205 | rescaling.PushImage(texture_cache.IsRescaling(image_view)); |
| 206 | } | 206 | } |
| 207 | } | 207 | } |
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 510602e8e..9627eb129 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp | |||
| @@ -298,12 +298,14 @@ private: | |||
| 298 | 298 | ||
| 299 | BufferCacheRuntime::BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_allocator_, | 299 | BufferCacheRuntime::BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_allocator_, |
| 300 | Scheduler& scheduler_, StagingBufferPool& staging_pool_, | 300 | Scheduler& scheduler_, StagingBufferPool& staging_pool_, |
| 301 | UpdateDescriptorQueue& update_descriptor_queue_, | 301 | GuestDescriptorQueue& guest_descriptor_queue_, |
| 302 | ComputePassDescriptorQueue& compute_pass_descriptor_queue, | ||
| 302 | DescriptorPool& descriptor_pool) | 303 | DescriptorPool& descriptor_pool) |
| 303 | : device{device_}, memory_allocator{memory_allocator_}, scheduler{scheduler_}, | 304 | : device{device_}, memory_allocator{memory_allocator_}, scheduler{scheduler_}, |
| 304 | staging_pool{staging_pool_}, update_descriptor_queue{update_descriptor_queue_}, | 305 | staging_pool{staging_pool_}, guest_descriptor_queue{guest_descriptor_queue_}, |
| 305 | uint8_pass(device, scheduler, descriptor_pool, staging_pool, update_descriptor_queue), | 306 | uint8_pass(device, scheduler, descriptor_pool, staging_pool, compute_pass_descriptor_queue), |
| 306 | quad_index_pass(device, scheduler, descriptor_pool, staging_pool, update_descriptor_queue) { | 307 | quad_index_pass(device, scheduler, descriptor_pool, staging_pool, |
| 308 | compute_pass_descriptor_queue) { | ||
| 307 | quad_array_index_buffer = std::make_shared<QuadArrayIndexBuffer>(device_, memory_allocator_, | 309 | quad_array_index_buffer = std::make_shared<QuadArrayIndexBuffer>(device_, memory_allocator_, |
| 308 | scheduler_, staging_pool_); | 310 | scheduler_, staging_pool_); |
| 309 | quad_strip_index_buffer = std::make_shared<QuadStripIndexBuffer>(device_, memory_allocator_, | 311 | quad_strip_index_buffer = std::make_shared<QuadStripIndexBuffer>(device_, memory_allocator_, |
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h index 879f1ed94..5e9602905 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.h +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h | |||
| @@ -63,7 +63,8 @@ class BufferCacheRuntime { | |||
| 63 | public: | 63 | public: |
| 64 | explicit BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_manager_, | 64 | explicit BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_manager_, |
| 65 | Scheduler& scheduler_, StagingBufferPool& staging_pool_, | 65 | Scheduler& scheduler_, StagingBufferPool& staging_pool_, |
| 66 | UpdateDescriptorQueue& update_descriptor_queue_, | 66 | GuestDescriptorQueue& guest_descriptor_queue, |
| 67 | ComputePassDescriptorQueue& compute_pass_descriptor_queue, | ||
| 67 | DescriptorPool& descriptor_pool); | 68 | DescriptorPool& descriptor_pool); |
| 68 | 69 | ||
| 69 | void Finish(); | 70 | void Finish(); |
| @@ -116,12 +117,12 @@ public: | |||
| 116 | 117 | ||
| 117 | void BindTextureBuffer(Buffer& buffer, u32 offset, u32 size, | 118 | void BindTextureBuffer(Buffer& buffer, u32 offset, u32 size, |
| 118 | VideoCore::Surface::PixelFormat format) { | 119 | VideoCore::Surface::PixelFormat format) { |
| 119 | update_descriptor_queue.AddTexelBuffer(buffer.View(offset, size, format)); | 120 | guest_descriptor_queue.AddTexelBuffer(buffer.View(offset, size, format)); |
| 120 | } | 121 | } |
| 121 | 122 | ||
| 122 | private: | 123 | private: |
| 123 | void BindBuffer(VkBuffer buffer, u32 offset, u32 size) { | 124 | void BindBuffer(VkBuffer buffer, u32 offset, u32 size) { |
| 124 | update_descriptor_queue.AddBuffer(buffer, offset, size); | 125 | guest_descriptor_queue.AddBuffer(buffer, offset, size); |
| 125 | } | 126 | } |
| 126 | 127 | ||
| 127 | void ReserveNullBuffer(); | 128 | void ReserveNullBuffer(); |
| @@ -130,7 +131,7 @@ private: | |||
| 130 | MemoryAllocator& memory_allocator; | 131 | MemoryAllocator& memory_allocator; |
| 131 | Scheduler& scheduler; | 132 | Scheduler& scheduler; |
| 132 | StagingBufferPool& staging_pool; | 133 | StagingBufferPool& staging_pool; |
| 133 | UpdateDescriptorQueue& update_descriptor_queue; | 134 | GuestDescriptorQueue& guest_descriptor_queue; |
| 134 | 135 | ||
| 135 | std::shared_ptr<QuadArrayIndexBuffer> quad_array_index_buffer; | 136 | std::shared_ptr<QuadArrayIndexBuffer> quad_array_index_buffer; |
| 136 | std::shared_ptr<QuadStripIndexBuffer> quad_strip_index_buffer; | 137 | std::shared_ptr<QuadStripIndexBuffer> quad_strip_index_buffer; |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 1a316b6eb..3bc8553e1 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp | |||
| @@ -200,12 +200,12 @@ ComputePass::~ComputePass() = default; | |||
| 200 | 200 | ||
| 201 | Uint8Pass::Uint8Pass(const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool, | 201 | Uint8Pass::Uint8Pass(const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool, |
| 202 | StagingBufferPool& staging_buffer_pool_, | 202 | StagingBufferPool& staging_buffer_pool_, |
| 203 | UpdateDescriptorQueue& update_descriptor_queue_) | 203 | ComputePassDescriptorQueue& compute_pass_descriptor_queue_) |
| 204 | : ComputePass(device_, descriptor_pool, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS, | 204 | : ComputePass(device_, descriptor_pool, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS, |
| 205 | INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, {}, | 205 | INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, {}, |
| 206 | VULKAN_UINT8_COMP_SPV), | 206 | VULKAN_UINT8_COMP_SPV), |
| 207 | scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, | 207 | scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, |
| 208 | update_descriptor_queue{update_descriptor_queue_} {} | 208 | compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} |
| 209 | 209 | ||
| 210 | Uint8Pass::~Uint8Pass() = default; | 210 | Uint8Pass::~Uint8Pass() = default; |
| 211 | 211 | ||
| @@ -214,10 +214,10 @@ std::pair<VkBuffer, VkDeviceSize> Uint8Pass::Assemble(u32 num_vertices, VkBuffer | |||
| 214 | const u32 staging_size = static_cast<u32>(num_vertices * sizeof(u16)); | 214 | const u32 staging_size = static_cast<u32>(num_vertices * sizeof(u16)); |
| 215 | const auto staging = staging_buffer_pool.Request(staging_size, MemoryUsage::DeviceLocal); | 215 | const auto staging = staging_buffer_pool.Request(staging_size, MemoryUsage::DeviceLocal); |
| 216 | 216 | ||
| 217 | update_descriptor_queue.Acquire(); | 217 | compute_pass_descriptor_queue.Acquire(); |
| 218 | update_descriptor_queue.AddBuffer(src_buffer, src_offset, num_vertices); | 218 | compute_pass_descriptor_queue.AddBuffer(src_buffer, src_offset, num_vertices); |
| 219 | update_descriptor_queue.AddBuffer(staging.buffer, staging.offset, staging_size); | 219 | compute_pass_descriptor_queue.AddBuffer(staging.buffer, staging.offset, staging_size); |
| 220 | const void* const descriptor_data{update_descriptor_queue.UpdateData()}; | 220 | const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; |
| 221 | 221 | ||
| 222 | scheduler.RequestOutsideRenderPassOperationContext(); | 222 | scheduler.RequestOutsideRenderPassOperationContext(); |
| 223 | scheduler.Record([this, descriptor_data, num_vertices](vk::CommandBuffer cmdbuf) { | 223 | scheduler.Record([this, descriptor_data, num_vertices](vk::CommandBuffer cmdbuf) { |
| @@ -242,12 +242,12 @@ std::pair<VkBuffer, VkDeviceSize> Uint8Pass::Assemble(u32 num_vertices, VkBuffer | |||
| 242 | QuadIndexedPass::QuadIndexedPass(const Device& device_, Scheduler& scheduler_, | 242 | QuadIndexedPass::QuadIndexedPass(const Device& device_, Scheduler& scheduler_, |
| 243 | DescriptorPool& descriptor_pool_, | 243 | DescriptorPool& descriptor_pool_, |
| 244 | StagingBufferPool& staging_buffer_pool_, | 244 | StagingBufferPool& staging_buffer_pool_, |
| 245 | UpdateDescriptorQueue& update_descriptor_queue_) | 245 | ComputePassDescriptorQueue& compute_pass_descriptor_queue_) |
| 246 | : ComputePass(device_, descriptor_pool_, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS, | 246 | : ComputePass(device_, descriptor_pool_, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS, |
| 247 | INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, | 247 | INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, |
| 248 | COMPUTE_PUSH_CONSTANT_RANGE<sizeof(u32) * 3>, VULKAN_QUAD_INDEXED_COMP_SPV), | 248 | COMPUTE_PUSH_CONSTANT_RANGE<sizeof(u32) * 3>, VULKAN_QUAD_INDEXED_COMP_SPV), |
| 249 | scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, | 249 | scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, |
| 250 | update_descriptor_queue{update_descriptor_queue_} {} | 250 | compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {} |
| 251 | 251 | ||
| 252 | QuadIndexedPass::~QuadIndexedPass() = default; | 252 | QuadIndexedPass::~QuadIndexedPass() = default; |
| 253 | 253 | ||
| @@ -272,10 +272,10 @@ std::pair<VkBuffer, VkDeviceSize> QuadIndexedPass::Assemble( | |||
| 272 | const std::size_t staging_size = num_tri_vertices * sizeof(u32); | 272 | const std::size_t staging_size = num_tri_vertices * sizeof(u32); |
| 273 | const auto staging = staging_buffer_pool.Request(staging_size, MemoryUsage::DeviceLocal); | 273 | const auto staging = staging_buffer_pool.Request(staging_size, MemoryUsage::DeviceLocal); |
| 274 | 274 | ||
| 275 | update_descriptor_queue.Acquire(); | 275 | compute_pass_descriptor_queue.Acquire(); |
| 276 | update_descriptor_queue.AddBuffer(src_buffer, src_offset, input_size); | 276 | compute_pass_descriptor_queue.AddBuffer(src_buffer, src_offset, input_size); |
| 277 | update_descriptor_queue.AddBuffer(staging.buffer, staging.offset, staging_size); | 277 | compute_pass_descriptor_queue.AddBuffer(staging.buffer, staging.offset, staging_size); |
| 278 | const void* const descriptor_data{update_descriptor_queue.UpdateData()}; | 278 | const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; |
| 279 | 279 | ||
| 280 | scheduler.RequestOutsideRenderPassOperationContext(); | 280 | scheduler.RequestOutsideRenderPassOperationContext(); |
| 281 | scheduler.Record([this, descriptor_data, num_tri_vertices, base_vertex, index_shift, | 281 | scheduler.Record([this, descriptor_data, num_tri_vertices, base_vertex, index_shift, |
| @@ -304,13 +304,14 @@ std::pair<VkBuffer, VkDeviceSize> QuadIndexedPass::Assemble( | |||
| 304 | ASTCDecoderPass::ASTCDecoderPass(const Device& device_, Scheduler& scheduler_, | 304 | ASTCDecoderPass::ASTCDecoderPass(const Device& device_, Scheduler& scheduler_, |
| 305 | DescriptorPool& descriptor_pool_, | 305 | DescriptorPool& descriptor_pool_, |
| 306 | StagingBufferPool& staging_buffer_pool_, | 306 | StagingBufferPool& staging_buffer_pool_, |
| 307 | UpdateDescriptorQueue& update_descriptor_queue_, | 307 | ComputePassDescriptorQueue& compute_pass_descriptor_queue_, |
| 308 | MemoryAllocator& memory_allocator_) | 308 | MemoryAllocator& memory_allocator_) |
| 309 | : ComputePass(device_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, | 309 | : ComputePass(device_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, |
| 310 | ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, | 310 | ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, |
| 311 | COMPUTE_PUSH_CONSTANT_RANGE<sizeof(AstcPushConstants)>, ASTC_DECODER_COMP_SPV), | 311 | COMPUTE_PUSH_CONSTANT_RANGE<sizeof(AstcPushConstants)>, ASTC_DECODER_COMP_SPV), |
| 312 | scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, | 312 | scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, |
| 313 | update_descriptor_queue{update_descriptor_queue_}, memory_allocator{memory_allocator_} {} | 313 | compute_pass_descriptor_queue{compute_pass_descriptor_queue_}, memory_allocator{ |
| 314 | memory_allocator_} {} | ||
| 314 | 315 | ||
| 315 | ASTCDecoderPass::~ASTCDecoderPass() = default; | 316 | ASTCDecoderPass::~ASTCDecoderPass() = default; |
| 316 | 317 | ||
| @@ -358,11 +359,11 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map, | |||
| 358 | const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); | 359 | const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); |
| 359 | const u32 num_dispatches_z = image.info.resources.layers; | 360 | const u32 num_dispatches_z = image.info.resources.layers; |
| 360 | 361 | ||
| 361 | update_descriptor_queue.Acquire(); | 362 | compute_pass_descriptor_queue.Acquire(); |
| 362 | update_descriptor_queue.AddBuffer(map.buffer, input_offset, | 363 | compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset, |
| 363 | image.guest_size_bytes - swizzle.buffer_offset); | 364 | image.guest_size_bytes - swizzle.buffer_offset); |
| 364 | update_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); | 365 | compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); |
| 365 | const void* const descriptor_data{update_descriptor_queue.UpdateData()}; | 366 | const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()}; |
| 366 | 367 | ||
| 367 | // To unswizzle the ASTC data | 368 | // To unswizzle the ASTC data |
| 368 | const auto params = MakeBlockLinearSwizzle2DParams(swizzle, image.info); | 369 | const auto params = MakeBlockLinearSwizzle2DParams(swizzle, image.info); |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index c4c8fa081..dd3927376 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "video_core/engines/maxwell_3d.h" | 10 | #include "video_core/engines/maxwell_3d.h" |
| 11 | #include "video_core/renderer_vulkan/vk_descriptor_pool.h" | 11 | #include "video_core/renderer_vulkan/vk_descriptor_pool.h" |
| 12 | #include "video_core/renderer_vulkan/vk_update_descriptor.h" | ||
| 12 | #include "video_core/vulkan_common/vulkan_memory_allocator.h" | 13 | #include "video_core/vulkan_common/vulkan_memory_allocator.h" |
| 13 | #include "video_core/vulkan_common/vulkan_wrapper.h" | 14 | #include "video_core/vulkan_common/vulkan_wrapper.h" |
| 14 | 15 | ||
| @@ -21,7 +22,6 @@ namespace Vulkan { | |||
| 21 | class Device; | 22 | class Device; |
| 22 | class StagingBufferPool; | 23 | class StagingBufferPool; |
| 23 | class Scheduler; | 24 | class Scheduler; |
| 24 | class UpdateDescriptorQueue; | ||
| 25 | class Image; | 25 | class Image; |
| 26 | struct StagingBufferRef; | 26 | struct StagingBufferRef; |
| 27 | 27 | ||
| @@ -50,7 +50,7 @@ class Uint8Pass final : public ComputePass { | |||
| 50 | public: | 50 | public: |
| 51 | explicit Uint8Pass(const Device& device_, Scheduler& scheduler_, | 51 | explicit Uint8Pass(const Device& device_, Scheduler& scheduler_, |
| 52 | DescriptorPool& descriptor_pool_, StagingBufferPool& staging_buffer_pool_, | 52 | DescriptorPool& descriptor_pool_, StagingBufferPool& staging_buffer_pool_, |
| 53 | UpdateDescriptorQueue& update_descriptor_queue_); | 53 | ComputePassDescriptorQueue& compute_pass_descriptor_queue_); |
| 54 | ~Uint8Pass(); | 54 | ~Uint8Pass(); |
| 55 | 55 | ||
| 56 | /// Assemble uint8 indices into an uint16 index buffer | 56 | /// Assemble uint8 indices into an uint16 index buffer |
| @@ -61,7 +61,7 @@ public: | |||
| 61 | private: | 61 | private: |
| 62 | Scheduler& scheduler; | 62 | Scheduler& scheduler; |
| 63 | StagingBufferPool& staging_buffer_pool; | 63 | StagingBufferPool& staging_buffer_pool; |
| 64 | UpdateDescriptorQueue& update_descriptor_queue; | 64 | ComputePassDescriptorQueue& compute_pass_descriptor_queue; |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | class QuadIndexedPass final : public ComputePass { | 67 | class QuadIndexedPass final : public ComputePass { |
| @@ -69,7 +69,7 @@ public: | |||
| 69 | explicit QuadIndexedPass(const Device& device_, Scheduler& scheduler_, | 69 | explicit QuadIndexedPass(const Device& device_, Scheduler& scheduler_, |
| 70 | DescriptorPool& descriptor_pool_, | 70 | DescriptorPool& descriptor_pool_, |
| 71 | StagingBufferPool& staging_buffer_pool_, | 71 | StagingBufferPool& staging_buffer_pool_, |
| 72 | UpdateDescriptorQueue& update_descriptor_queue_); | 72 | ComputePassDescriptorQueue& compute_pass_descriptor_queue_); |
| 73 | ~QuadIndexedPass(); | 73 | ~QuadIndexedPass(); |
| 74 | 74 | ||
| 75 | std::pair<VkBuffer, VkDeviceSize> Assemble( | 75 | std::pair<VkBuffer, VkDeviceSize> Assemble( |
| @@ -79,7 +79,7 @@ public: | |||
| 79 | private: | 79 | private: |
| 80 | Scheduler& scheduler; | 80 | Scheduler& scheduler; |
| 81 | StagingBufferPool& staging_buffer_pool; | 81 | StagingBufferPool& staging_buffer_pool; |
| 82 | UpdateDescriptorQueue& update_descriptor_queue; | 82 | ComputePassDescriptorQueue& compute_pass_descriptor_queue; |
| 83 | }; | 83 | }; |
| 84 | 84 | ||
| 85 | class ASTCDecoderPass final : public ComputePass { | 85 | class ASTCDecoderPass final : public ComputePass { |
| @@ -87,7 +87,7 @@ public: | |||
| 87 | explicit ASTCDecoderPass(const Device& device_, Scheduler& scheduler_, | 87 | explicit ASTCDecoderPass(const Device& device_, Scheduler& scheduler_, |
| 88 | DescriptorPool& descriptor_pool_, | 88 | DescriptorPool& descriptor_pool_, |
| 89 | StagingBufferPool& staging_buffer_pool_, | 89 | StagingBufferPool& staging_buffer_pool_, |
| 90 | UpdateDescriptorQueue& update_descriptor_queue_, | 90 | ComputePassDescriptorQueue& compute_pass_descriptor_queue_, |
| 91 | MemoryAllocator& memory_allocator_); | 91 | MemoryAllocator& memory_allocator_); |
| 92 | ~ASTCDecoderPass(); | 92 | ~ASTCDecoderPass(); |
| 93 | 93 | ||
| @@ -97,7 +97,7 @@ public: | |||
| 97 | private: | 97 | private: |
| 98 | Scheduler& scheduler; | 98 | Scheduler& scheduler; |
| 99 | StagingBufferPool& staging_buffer_pool; | 99 | StagingBufferPool& staging_buffer_pool; |
| 100 | UpdateDescriptorQueue& update_descriptor_queue; | 100 | ComputePassDescriptorQueue& compute_pass_descriptor_queue; |
| 101 | MemoryAllocator& memory_allocator; | 101 | MemoryAllocator& memory_allocator; |
| 102 | }; | 102 | }; |
| 103 | 103 | ||
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index 2a0f0dbf0..733e70d9d 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp | |||
| @@ -26,13 +26,13 @@ using Tegra::Texture::TexturePair; | |||
| 26 | 26 | ||
| 27 | ComputePipeline::ComputePipeline(const Device& device_, vk::PipelineCache& pipeline_cache_, | 27 | ComputePipeline::ComputePipeline(const Device& device_, vk::PipelineCache& pipeline_cache_, |
| 28 | DescriptorPool& descriptor_pool, | 28 | DescriptorPool& descriptor_pool, |
| 29 | UpdateDescriptorQueue& update_descriptor_queue_, | 29 | GuestDescriptorQueue& guest_descriptor_queue_, |
| 30 | Common::ThreadWorker* thread_worker, | 30 | Common::ThreadWorker* thread_worker, |
| 31 | PipelineStatistics* pipeline_statistics, | 31 | PipelineStatistics* pipeline_statistics, |
| 32 | VideoCore::ShaderNotify* shader_notify, const Shader::Info& info_, | 32 | VideoCore::ShaderNotify* shader_notify, const Shader::Info& info_, |
| 33 | vk::ShaderModule spv_module_) | 33 | vk::ShaderModule spv_module_) |
| 34 | : device{device_}, pipeline_cache(pipeline_cache_), | 34 | : device{device_}, |
| 35 | update_descriptor_queue{update_descriptor_queue_}, info{info_}, | 35 | pipeline_cache(pipeline_cache_), guest_descriptor_queue{guest_descriptor_queue_}, info{info_}, |
| 36 | spv_module(std::move(spv_module_)) { | 36 | spv_module(std::move(spv_module_)) { |
| 37 | if (shader_notify) { | 37 | if (shader_notify) { |
| 38 | shader_notify->MarkShaderBuilding(); | 38 | shader_notify->MarkShaderBuilding(); |
| @@ -99,7 +99,7 @@ ComputePipeline::ComputePipeline(const Device& device_, vk::PipelineCache& pipel | |||
| 99 | void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, | 99 | void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, |
| 100 | Tegra::MemoryManager& gpu_memory, Scheduler& scheduler, | 100 | Tegra::MemoryManager& gpu_memory, Scheduler& scheduler, |
| 101 | BufferCache& buffer_cache, TextureCache& texture_cache) { | 101 | BufferCache& buffer_cache, TextureCache& texture_cache) { |
| 102 | update_descriptor_queue.Acquire(); | 102 | guest_descriptor_queue.Acquire(); |
| 103 | 103 | ||
| 104 | buffer_cache.SetComputeUniformBufferState(info.constant_buffer_mask, &uniform_buffer_sizes); | 104 | buffer_cache.SetComputeUniformBufferState(info.constant_buffer_mask, &uniform_buffer_sizes); |
| 105 | buffer_cache.UnbindComputeStorageBuffers(); | 105 | buffer_cache.UnbindComputeStorageBuffers(); |
| @@ -194,7 +194,7 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, | |||
| 194 | RescalingPushConstant rescaling; | 194 | RescalingPushConstant rescaling; |
| 195 | const VkSampler* samplers_it{samplers.data()}; | 195 | const VkSampler* samplers_it{samplers.data()}; |
| 196 | const VideoCommon::ImageViewInOut* views_it{views.data()}; | 196 | const VideoCommon::ImageViewInOut* views_it{views.data()}; |
| 197 | PushImageDescriptors(texture_cache, update_descriptor_queue, info, rescaling, samplers_it, | 197 | PushImageDescriptors(texture_cache, guest_descriptor_queue, info, rescaling, samplers_it, |
| 198 | views_it); | 198 | views_it); |
| 199 | 199 | ||
| 200 | if (!is_built.load(std::memory_order::relaxed)) { | 200 | if (!is_built.load(std::memory_order::relaxed)) { |
| @@ -204,7 +204,7 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, | |||
| 204 | build_condvar.wait(lock, [this] { return is_built.load(std::memory_order::relaxed); }); | 204 | build_condvar.wait(lock, [this] { return is_built.load(std::memory_order::relaxed); }); |
| 205 | }); | 205 | }); |
| 206 | } | 206 | } |
| 207 | const void* const descriptor_data{update_descriptor_queue.UpdateData()}; | 207 | const void* const descriptor_data{guest_descriptor_queue.UpdateData()}; |
| 208 | const bool is_rescaling = !info.texture_descriptors.empty() || !info.image_descriptors.empty(); | 208 | const bool is_rescaling = !info.texture_descriptors.empty() || !info.image_descriptors.empty(); |
| 209 | scheduler.Record([this, descriptor_data, is_rescaling, | 209 | scheduler.Record([this, descriptor_data, is_rescaling, |
| 210 | rescaling_data = rescaling.Data()](vk::CommandBuffer cmdbuf) { | 210 | rescaling_data = rescaling.Data()](vk::CommandBuffer cmdbuf) { |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.h b/src/video_core/renderer_vulkan/vk_compute_pipeline.h index 78d77027f..d1a1e2c46 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.h | |||
| @@ -30,7 +30,7 @@ class ComputePipeline { | |||
| 30 | public: | 30 | public: |
| 31 | explicit ComputePipeline(const Device& device, vk::PipelineCache& pipeline_cache, | 31 | explicit ComputePipeline(const Device& device, vk::PipelineCache& pipeline_cache, |
| 32 | DescriptorPool& descriptor_pool, | 32 | DescriptorPool& descriptor_pool, |
| 33 | UpdateDescriptorQueue& update_descriptor_queue, | 33 | GuestDescriptorQueue& guest_descriptor_queue, |
| 34 | Common::ThreadWorker* thread_worker, | 34 | Common::ThreadWorker* thread_worker, |
| 35 | PipelineStatistics* pipeline_statistics, | 35 | PipelineStatistics* pipeline_statistics, |
| 36 | VideoCore::ShaderNotify* shader_notify, const Shader::Info& info, | 36 | VideoCore::ShaderNotify* shader_notify, const Shader::Info& info, |
| @@ -48,7 +48,7 @@ public: | |||
| 48 | private: | 48 | private: |
| 49 | const Device& device; | 49 | const Device& device; |
| 50 | vk::PipelineCache& pipeline_cache; | 50 | vk::PipelineCache& pipeline_cache; |
| 51 | UpdateDescriptorQueue& update_descriptor_queue; | 51 | GuestDescriptorQueue& guest_descriptor_queue; |
| 52 | Shader::Info info; | 52 | Shader::Info info; |
| 53 | 53 | ||
| 54 | VideoCommon::ComputeUniformBufferSizes uniform_buffer_sizes{}; | 54 | VideoCommon::ComputeUniformBufferSizes uniform_buffer_sizes{}; |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index baedc4424..f1bcd5cd6 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -236,13 +236,13 @@ GraphicsPipeline::GraphicsPipeline( | |||
| 236 | Scheduler& scheduler_, BufferCache& buffer_cache_, TextureCache& texture_cache_, | 236 | Scheduler& scheduler_, BufferCache& buffer_cache_, TextureCache& texture_cache_, |
| 237 | vk::PipelineCache& pipeline_cache_, VideoCore::ShaderNotify* shader_notify, | 237 | vk::PipelineCache& pipeline_cache_, VideoCore::ShaderNotify* shader_notify, |
| 238 | const Device& device_, DescriptorPool& descriptor_pool, | 238 | const Device& device_, DescriptorPool& descriptor_pool, |
| 239 | UpdateDescriptorQueue& update_descriptor_queue_, Common::ThreadWorker* worker_thread, | 239 | GuestDescriptorQueue& guest_descriptor_queue_, Common::ThreadWorker* worker_thread, |
| 240 | PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache, | 240 | PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache, |
| 241 | const GraphicsPipelineCacheKey& key_, std::array<vk::ShaderModule, NUM_STAGES> stages, | 241 | const GraphicsPipelineCacheKey& key_, std::array<vk::ShaderModule, NUM_STAGES> stages, |
| 242 | const std::array<const Shader::Info*, NUM_STAGES>& infos) | 242 | const std::array<const Shader::Info*, NUM_STAGES>& infos) |
| 243 | : key{key_}, device{device_}, texture_cache{texture_cache_}, buffer_cache{buffer_cache_}, | 243 | : key{key_}, device{device_}, texture_cache{texture_cache_}, buffer_cache{buffer_cache_}, |
| 244 | pipeline_cache(pipeline_cache_), scheduler{scheduler_}, | 244 | pipeline_cache(pipeline_cache_), scheduler{scheduler_}, |
| 245 | update_descriptor_queue{update_descriptor_queue_}, spv_modules{std::move(stages)} { | 245 | guest_descriptor_queue{guest_descriptor_queue_}, spv_modules{std::move(stages)} { |
| 246 | if (shader_notify) { | 246 | if (shader_notify) { |
| 247 | shader_notify->MarkShaderBuilding(); | 247 | shader_notify->MarkShaderBuilding(); |
| 248 | } | 248 | } |
| @@ -449,7 +449,7 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { | |||
| 449 | buffer_cache.UpdateGraphicsBuffers(is_indexed); | 449 | buffer_cache.UpdateGraphicsBuffers(is_indexed); |
| 450 | buffer_cache.BindHostGeometryBuffers(is_indexed); | 450 | buffer_cache.BindHostGeometryBuffers(is_indexed); |
| 451 | 451 | ||
| 452 | update_descriptor_queue.Acquire(); | 452 | guest_descriptor_queue.Acquire(); |
| 453 | 453 | ||
| 454 | RescalingPushConstant rescaling; | 454 | RescalingPushConstant rescaling; |
| 455 | RenderAreaPushConstant render_area; | 455 | RenderAreaPushConstant render_area; |
| @@ -457,7 +457,7 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) { | |||
| 457 | const VideoCommon::ImageViewInOut* views_it{views.data()}; | 457 | const VideoCommon::ImageViewInOut* views_it{views.data()}; |
| 458 | const auto prepare_stage{[&](size_t stage) LAMBDA_FORCEINLINE { | 458 | const auto prepare_stage{[&](size_t stage) LAMBDA_FORCEINLINE { |
| 459 | buffer_cache.BindHostStageBuffers(stage); | 459 | buffer_cache.BindHostStageBuffers(stage); |
| 460 | PushImageDescriptors(texture_cache, update_descriptor_queue, stage_infos[stage], rescaling, | 460 | PushImageDescriptors(texture_cache, guest_descriptor_queue, stage_infos[stage], rescaling, |
| 461 | samplers_it, views_it); | 461 | samplers_it, views_it); |
| 462 | const auto& info{stage_infos[0]}; | 462 | const auto& info{stage_infos[0]}; |
| 463 | if (info.uses_render_area) { | 463 | if (info.uses_render_area) { |
| @@ -499,7 +499,7 @@ void GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling, | |||
| 499 | const bool is_rescaling{texture_cache.IsRescaling()}; | 499 | const bool is_rescaling{texture_cache.IsRescaling()}; |
| 500 | const bool update_rescaling{scheduler.UpdateRescaling(is_rescaling)}; | 500 | const bool update_rescaling{scheduler.UpdateRescaling(is_rescaling)}; |
| 501 | const bool bind_pipeline{scheduler.UpdateGraphicsPipeline(this)}; | 501 | const bool bind_pipeline{scheduler.UpdateGraphicsPipeline(this)}; |
| 502 | const void* const descriptor_data{update_descriptor_queue.UpdateData()}; | 502 | const void* const descriptor_data{guest_descriptor_queue.UpdateData()}; |
| 503 | scheduler.Record([this, descriptor_data, bind_pipeline, rescaling_data = rescaling.Data(), | 503 | scheduler.Record([this, descriptor_data, bind_pipeline, rescaling_data = rescaling.Data(), |
| 504 | is_rescaling, update_rescaling, | 504 | is_rescaling, update_rescaling, |
| 505 | uses_render_area = render_area.uses_render_area, | 505 | uses_render_area = render_area.uses_render_area, |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 67c657d0e..99e56e9ad 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h | |||
| @@ -64,7 +64,6 @@ class RenderPassCache; | |||
| 64 | class RescalingPushConstant; | 64 | class RescalingPushConstant; |
| 65 | class RenderAreaPushConstant; | 65 | class RenderAreaPushConstant; |
| 66 | class Scheduler; | 66 | class Scheduler; |
| 67 | class UpdateDescriptorQueue; | ||
| 68 | 67 | ||
| 69 | class GraphicsPipeline { | 68 | class GraphicsPipeline { |
| 70 | static constexpr size_t NUM_STAGES = Tegra::Engines::Maxwell3D::Regs::MaxShaderStage; | 69 | static constexpr size_t NUM_STAGES = Tegra::Engines::Maxwell3D::Regs::MaxShaderStage; |
| @@ -74,7 +73,7 @@ public: | |||
| 74 | Scheduler& scheduler, BufferCache& buffer_cache, TextureCache& texture_cache, | 73 | Scheduler& scheduler, BufferCache& buffer_cache, TextureCache& texture_cache, |
| 75 | vk::PipelineCache& pipeline_cache, VideoCore::ShaderNotify* shader_notify, | 74 | vk::PipelineCache& pipeline_cache, VideoCore::ShaderNotify* shader_notify, |
| 76 | const Device& device, DescriptorPool& descriptor_pool, | 75 | const Device& device, DescriptorPool& descriptor_pool, |
| 77 | UpdateDescriptorQueue& update_descriptor_queue, Common::ThreadWorker* worker_thread, | 76 | GuestDescriptorQueue& guest_descriptor_queue, Common::ThreadWorker* worker_thread, |
| 78 | PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache, | 77 | PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache, |
| 79 | const GraphicsPipelineCacheKey& key, std::array<vk::ShaderModule, NUM_STAGES> stages, | 78 | const GraphicsPipelineCacheKey& key, std::array<vk::ShaderModule, NUM_STAGES> stages, |
| 80 | const std::array<const Shader::Info*, NUM_STAGES>& infos); | 79 | const std::array<const Shader::Info*, NUM_STAGES>& infos); |
| @@ -133,7 +132,7 @@ private: | |||
| 133 | BufferCache& buffer_cache; | 132 | BufferCache& buffer_cache; |
| 134 | vk::PipelineCache& pipeline_cache; | 133 | vk::PipelineCache& pipeline_cache; |
| 135 | Scheduler& scheduler; | 134 | Scheduler& scheduler; |
| 136 | UpdateDescriptorQueue& update_descriptor_queue; | 135 | GuestDescriptorQueue& guest_descriptor_queue; |
| 137 | 136 | ||
| 138 | void (*configure_func)(GraphicsPipeline*, bool){}; | 137 | void (*configure_func)(GraphicsPipeline*, bool){}; |
| 139 | 138 | ||
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index a318d643e..596996bec 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -277,11 +277,11 @@ bool GraphicsPipelineCacheKey::operator==(const GraphicsPipelineCacheKey& rhs) c | |||
| 277 | 277 | ||
| 278 | PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device_, | 278 | PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device_, |
| 279 | Scheduler& scheduler_, DescriptorPool& descriptor_pool_, | 279 | Scheduler& scheduler_, DescriptorPool& descriptor_pool_, |
| 280 | UpdateDescriptorQueue& update_descriptor_queue_, | 280 | GuestDescriptorQueue& guest_descriptor_queue_, |
| 281 | RenderPassCache& render_pass_cache_, BufferCache& buffer_cache_, | 281 | RenderPassCache& render_pass_cache_, BufferCache& buffer_cache_, |
| 282 | TextureCache& texture_cache_, VideoCore::ShaderNotify& shader_notify_) | 282 | TextureCache& texture_cache_, VideoCore::ShaderNotify& shader_notify_) |
| 283 | : VideoCommon::ShaderCache{rasterizer_}, device{device_}, scheduler{scheduler_}, | 283 | : VideoCommon::ShaderCache{rasterizer_}, device{device_}, scheduler{scheduler_}, |
| 284 | descriptor_pool{descriptor_pool_}, update_descriptor_queue{update_descriptor_queue_}, | 284 | descriptor_pool{descriptor_pool_}, guest_descriptor_queue{guest_descriptor_queue_}, |
| 285 | render_pass_cache{render_pass_cache_}, buffer_cache{buffer_cache_}, | 285 | render_pass_cache{render_pass_cache_}, buffer_cache{buffer_cache_}, |
| 286 | texture_cache{texture_cache_}, shader_notify{shader_notify_}, | 286 | texture_cache{texture_cache_}, shader_notify{shader_notify_}, |
| 287 | use_asynchronous_shaders{Settings::values.use_asynchronous_shaders.GetValue()}, | 287 | use_asynchronous_shaders{Settings::values.use_asynchronous_shaders.GetValue()}, |
| @@ -643,7 +643,7 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline( | |||
| 643 | Common::ThreadWorker* const thread_worker{build_in_parallel ? &workers : nullptr}; | 643 | Common::ThreadWorker* const thread_worker{build_in_parallel ? &workers : nullptr}; |
| 644 | return std::make_unique<GraphicsPipeline>( | 644 | return std::make_unique<GraphicsPipeline>( |
| 645 | scheduler, buffer_cache, texture_cache, vulkan_pipeline_cache, &shader_notify, device, | 645 | scheduler, buffer_cache, texture_cache, vulkan_pipeline_cache, &shader_notify, device, |
| 646 | descriptor_pool, update_descriptor_queue, thread_worker, statistics, render_pass_cache, key, | 646 | descriptor_pool, guest_descriptor_queue, thread_worker, statistics, render_pass_cache, key, |
| 647 | std::move(modules), infos); | 647 | std::move(modules), infos); |
| 648 | 648 | ||
| 649 | } catch (const Shader::Exception& exception) { | 649 | } catch (const Shader::Exception& exception) { |
| @@ -722,7 +722,7 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline( | |||
| 722 | } | 722 | } |
| 723 | Common::ThreadWorker* const thread_worker{build_in_parallel ? &workers : nullptr}; | 723 | Common::ThreadWorker* const thread_worker{build_in_parallel ? &workers : nullptr}; |
| 724 | return std::make_unique<ComputePipeline>(device, vulkan_pipeline_cache, descriptor_pool, | 724 | return std::make_unique<ComputePipeline>(device, vulkan_pipeline_cache, descriptor_pool, |
| 725 | update_descriptor_queue, thread_worker, statistics, | 725 | guest_descriptor_queue, thread_worker, statistics, |
| 726 | &shader_notify, program.info, std::move(spv_module)); | 726 | &shader_notify, program.info, std::move(spv_module)); |
| 727 | 727 | ||
| 728 | } catch (const Shader::Exception& exception) { | 728 | } catch (const Shader::Exception& exception) { |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h index 5171912d7..15aa7e224 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h | |||
| @@ -82,7 +82,6 @@ class PipelineStatistics; | |||
| 82 | class RasterizerVulkan; | 82 | class RasterizerVulkan; |
| 83 | class RenderPassCache; | 83 | class RenderPassCache; |
| 84 | class Scheduler; | 84 | class Scheduler; |
| 85 | class UpdateDescriptorQueue; | ||
| 86 | 85 | ||
| 87 | using VideoCommon::ShaderInfo; | 86 | using VideoCommon::ShaderInfo; |
| 88 | 87 | ||
| @@ -102,7 +101,7 @@ class PipelineCache : public VideoCommon::ShaderCache { | |||
| 102 | public: | 101 | public: |
| 103 | explicit PipelineCache(RasterizerVulkan& rasterizer, const Device& device, Scheduler& scheduler, | 102 | explicit PipelineCache(RasterizerVulkan& rasterizer, const Device& device, Scheduler& scheduler, |
| 104 | DescriptorPool& descriptor_pool, | 103 | DescriptorPool& descriptor_pool, |
| 105 | UpdateDescriptorQueue& update_descriptor_queue, | 104 | GuestDescriptorQueue& guest_descriptor_queue, |
| 106 | RenderPassCache& render_pass_cache, BufferCache& buffer_cache, | 105 | RenderPassCache& render_pass_cache, BufferCache& buffer_cache, |
| 107 | TextureCache& texture_cache, VideoCore::ShaderNotify& shader_notify_); | 106 | TextureCache& texture_cache, VideoCore::ShaderNotify& shader_notify_); |
| 108 | ~PipelineCache(); | 107 | ~PipelineCache(); |
| @@ -144,7 +143,7 @@ private: | |||
| 144 | const Device& device; | 143 | const Device& device; |
| 145 | Scheduler& scheduler; | 144 | Scheduler& scheduler; |
| 146 | DescriptorPool& descriptor_pool; | 145 | DescriptorPool& descriptor_pool; |
| 147 | UpdateDescriptorQueue& update_descriptor_queue; | 146 | GuestDescriptorQueue& guest_descriptor_queue; |
| 148 | RenderPassCache& render_pass_cache; | 147 | RenderPassCache& render_pass_cache; |
| 149 | BufferCache& buffer_cache; | 148 | BufferCache& buffer_cache; |
| 150 | TextureCache& texture_cache; | 149 | TextureCache& texture_cache; |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 628e1376f..64bd2f6a5 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -160,17 +160,16 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra | |||
| 160 | : RasterizerAccelerated{cpu_memory_}, gpu{gpu_}, screen_info{screen_info_}, device{device_}, | 160 | : RasterizerAccelerated{cpu_memory_}, gpu{gpu_}, screen_info{screen_info_}, device{device_}, |
| 161 | memory_allocator{memory_allocator_}, state_tracker{state_tracker_}, scheduler{scheduler_}, | 161 | memory_allocator{memory_allocator_}, state_tracker{state_tracker_}, scheduler{scheduler_}, |
| 162 | staging_pool(device, memory_allocator, scheduler), descriptor_pool(device, scheduler), | 162 | staging_pool(device, memory_allocator, scheduler), descriptor_pool(device, scheduler), |
| 163 | update_descriptor_queue(device, scheduler), | 163 | guest_descriptor_queue(device, scheduler), compute_pass_descriptor_queue(device, scheduler), |
| 164 | blit_image(device, scheduler, state_tracker, descriptor_pool), | 164 | blit_image(device, scheduler, state_tracker, descriptor_pool), render_pass_cache(device), |
| 165 | render_pass_cache(device), texture_cache_runtime{device, scheduler, | 165 | texture_cache_runtime{ |
| 166 | memory_allocator, staging_pool, | 166 | device, scheduler, memory_allocator, staging_pool, |
| 167 | blit_image, render_pass_cache, | 167 | blit_image, render_pass_cache, descriptor_pool, compute_pass_descriptor_queue}, |
| 168 | descriptor_pool, update_descriptor_queue}, | ||
| 169 | texture_cache(texture_cache_runtime, *this), | 168 | texture_cache(texture_cache_runtime, *this), |
| 170 | buffer_cache_runtime(device, memory_allocator, scheduler, staging_pool, | 169 | buffer_cache_runtime(device, memory_allocator, scheduler, staging_pool, |
| 171 | update_descriptor_queue, descriptor_pool), | 170 | guest_descriptor_queue, compute_pass_descriptor_queue, descriptor_pool), |
| 172 | buffer_cache(*this, cpu_memory_, buffer_cache_runtime), | 171 | buffer_cache(*this, cpu_memory_, buffer_cache_runtime), |
| 173 | pipeline_cache(*this, device, scheduler, descriptor_pool, update_descriptor_queue, | 172 | pipeline_cache(*this, device, scheduler, descriptor_pool, guest_descriptor_queue, |
| 174 | render_pass_cache, buffer_cache, texture_cache, gpu.ShaderNotify()), | 173 | render_pass_cache, buffer_cache, texture_cache, gpu.ShaderNotify()), |
| 175 | query_cache{*this, cpu_memory_, device, scheduler}, | 174 | query_cache{*this, cpu_memory_, device, scheduler}, |
| 176 | accelerate_dma(buffer_cache, texture_cache, scheduler), | 175 | accelerate_dma(buffer_cache, texture_cache, scheduler), |
| @@ -669,7 +668,8 @@ void RasterizerVulkan::FlushCommands() { | |||
| 669 | 668 | ||
| 670 | void RasterizerVulkan::TickFrame() { | 669 | void RasterizerVulkan::TickFrame() { |
| 671 | draw_counter = 0; | 670 | draw_counter = 0; |
| 672 | update_descriptor_queue.TickFrame(); | 671 | guest_descriptor_queue.TickFrame(); |
| 672 | compute_pass_descriptor_queue.TickFrame(); | ||
| 673 | fence_manager.TickFrame(); | 673 | fence_manager.TickFrame(); |
| 674 | staging_pool.TickFrame(); | 674 | staging_pool.TickFrame(); |
| 675 | { | 675 | { |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 9bd422850..b39710b3c 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h | |||
| @@ -184,7 +184,8 @@ private: | |||
| 184 | 184 | ||
| 185 | StagingBufferPool staging_pool; | 185 | StagingBufferPool staging_pool; |
| 186 | DescriptorPool descriptor_pool; | 186 | DescriptorPool descriptor_pool; |
| 187 | UpdateDescriptorQueue update_descriptor_queue; | 187 | GuestDescriptorQueue guest_descriptor_queue; |
| 188 | ComputePassDescriptorQueue compute_pass_descriptor_queue; | ||
| 188 | BlitImageHelper blit_image; | 189 | BlitImageHelper blit_image; |
| 189 | RenderPassCache render_pass_cache; | 190 | RenderPassCache render_pass_cache; |
| 190 | 191 | ||
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 9ca7751c5..012d6fa73 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -798,13 +798,13 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched | |||
| 798 | BlitImageHelper& blit_image_helper_, | 798 | BlitImageHelper& blit_image_helper_, |
| 799 | RenderPassCache& render_pass_cache_, | 799 | RenderPassCache& render_pass_cache_, |
| 800 | DescriptorPool& descriptor_pool, | 800 | DescriptorPool& descriptor_pool, |
| 801 | UpdateDescriptorQueue& update_descriptor_queue) | 801 | ComputePassDescriptorQueue& compute_pass_descriptor_queue) |
| 802 | : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, | 802 | : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, |
| 803 | staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, | 803 | staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, |
| 804 | render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} { | 804 | render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} { |
| 805 | if (Settings::values.accelerate_astc) { | 805 | if (Settings::values.accelerate_astc) { |
| 806 | astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, | 806 | astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, |
| 807 | update_descriptor_queue, memory_allocator); | 807 | compute_pass_descriptor_queue, memory_allocator); |
| 808 | } | 808 | } |
| 809 | } | 809 | } |
| 810 | 810 | ||
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index 6f360177a..23473bf9c 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h | |||
| @@ -34,7 +34,6 @@ class ImageView; | |||
| 34 | class Framebuffer; | 34 | class Framebuffer; |
| 35 | class RenderPassCache; | 35 | class RenderPassCache; |
| 36 | class StagingBufferPool; | 36 | class StagingBufferPool; |
| 37 | class UpdateDescriptorQueue; | ||
| 38 | class Scheduler; | 37 | class Scheduler; |
| 39 | 38 | ||
| 40 | class TextureCacheRuntime { | 39 | class TextureCacheRuntime { |
| @@ -45,7 +44,7 @@ public: | |||
| 45 | BlitImageHelper& blit_image_helper_, | 44 | BlitImageHelper& blit_image_helper_, |
| 46 | RenderPassCache& render_pass_cache_, | 45 | RenderPassCache& render_pass_cache_, |
| 47 | DescriptorPool& descriptor_pool, | 46 | DescriptorPool& descriptor_pool, |
| 48 | UpdateDescriptorQueue& update_descriptor_queue); | 47 | ComputePassDescriptorQueue& compute_pass_descriptor_queue); |
| 49 | 48 | ||
| 50 | void Finish(); | 49 | void Finish(); |
| 51 | 50 | ||
diff --git a/src/video_core/renderer_vulkan/vk_update_descriptor.h b/src/video_core/renderer_vulkan/vk_update_descriptor.h index 1c1a7020b..310fb551a 100644 --- a/src/video_core/renderer_vulkan/vk_update_descriptor.h +++ b/src/video_core/renderer_vulkan/vk_update_descriptor.h | |||
| @@ -32,7 +32,7 @@ class UpdateDescriptorQueue final { | |||
| 32 | // This should be plenty for the vast majority of cases. Most desktop platforms only | 32 | // This should be plenty for the vast majority of cases. Most desktop platforms only |
| 33 | // provide up to 3 swapchain images. | 33 | // provide up to 3 swapchain images. |
| 34 | static constexpr size_t FRAMES_IN_FLIGHT = 5; | 34 | static constexpr size_t FRAMES_IN_FLIGHT = 5; |
| 35 | static constexpr size_t FRAME_PAYLOAD_SIZE = 0x10000; | 35 | static constexpr size_t FRAME_PAYLOAD_SIZE = 0x20000; |
| 36 | static constexpr size_t PAYLOAD_SIZE = FRAME_PAYLOAD_SIZE * FRAMES_IN_FLIGHT; | 36 | static constexpr size_t PAYLOAD_SIZE = FRAME_PAYLOAD_SIZE * FRAMES_IN_FLIGHT; |
| 37 | 37 | ||
| 38 | public: | 38 | public: |
| @@ -86,4 +86,8 @@ private: | |||
| 86 | std::array<DescriptorUpdateEntry, PAYLOAD_SIZE> payload; | 86 | std::array<DescriptorUpdateEntry, PAYLOAD_SIZE> payload; |
| 87 | }; | 87 | }; |
| 88 | 88 | ||
| 89 | // TODO: should these be separate classes instead? | ||
| 90 | using GuestDescriptorQueue = UpdateDescriptorQueue; | ||
| 91 | using ComputePassDescriptorQueue = UpdateDescriptorQueue; | ||
| 92 | |||
| 89 | } // namespace Vulkan | 93 | } // namespace Vulkan |