video_core: Replace VKUpdateDescriptorQueue with UpdateDescriptorQueue

This commit is contained in:
german77 2022-06-25 23:51:37 -05:00
parent b5d6194f6d
commit c34a95fa25
14 changed files with 33 additions and 33 deletions

View File

@ -168,7 +168,7 @@ private:
}; };
inline void PushImageDescriptors(TextureCache& texture_cache, inline void PushImageDescriptors(TextureCache& texture_cache,
VKUpdateDescriptorQueue& update_descriptor_queue, UpdateDescriptorQueue& update_descriptor_queue,
const Shader::Info& info, RescalingPushConstant& rescaling, const Shader::Info& info, RescalingPushConstant& rescaling,
const VkSampler*& samplers, const VkSampler*& samplers,
const VideoCommon::ImageViewInOut*& views) { const VideoCommon::ImageViewInOut*& views) {

View File

@ -125,7 +125,7 @@ VkBufferView Buffer::View(u32 offset, u32 size, VideoCore::Surface::PixelFormat
BufferCacheRuntime::BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_allocator_, BufferCacheRuntime::BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_allocator_,
Scheduler& scheduler_, StagingBufferPool& staging_pool_, Scheduler& scheduler_, StagingBufferPool& staging_pool_,
VKUpdateDescriptorQueue& update_descriptor_queue_, UpdateDescriptorQueue& update_descriptor_queue_,
DescriptorPool& descriptor_pool) DescriptorPool& descriptor_pool)
: device{device_}, memory_allocator{memory_allocator_}, scheduler{scheduler_}, : device{device_}, memory_allocator{memory_allocator_}, scheduler{scheduler_},
staging_pool{staging_pool_}, update_descriptor_queue{update_descriptor_queue_}, staging_pool{staging_pool_}, update_descriptor_queue{update_descriptor_queue_},

View File

@ -59,7 +59,7 @@ class BufferCacheRuntime {
public: public:
explicit BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_manager_, explicit BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_manager_,
Scheduler& scheduler_, StagingBufferPool& staging_pool_, Scheduler& scheduler_, StagingBufferPool& staging_pool_,
VKUpdateDescriptorQueue& update_descriptor_queue_, UpdateDescriptorQueue& update_descriptor_queue_,
DescriptorPool& descriptor_pool); DescriptorPool& descriptor_pool);
void Finish(); void Finish();
@ -126,7 +126,7 @@ private:
MemoryAllocator& memory_allocator; MemoryAllocator& memory_allocator;
Scheduler& scheduler; Scheduler& scheduler;
StagingBufferPool& staging_pool; StagingBufferPool& staging_pool;
VKUpdateDescriptorQueue& update_descriptor_queue; UpdateDescriptorQueue& update_descriptor_queue;
vk::Buffer quad_array_lut; vk::Buffer quad_array_lut;
MemoryCommit quad_array_lut_commit; MemoryCommit quad_array_lut_commit;

View File

@ -202,7 +202,7 @@ ComputePass::~ComputePass() = default;
Uint8Pass::Uint8Pass(const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool, Uint8Pass::Uint8Pass(const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool,
StagingBufferPool& staging_buffer_pool_, StagingBufferPool& staging_buffer_pool_,
VKUpdateDescriptorQueue& update_descriptor_queue_) UpdateDescriptorQueue& update_descriptor_queue_)
: ComputePass(device_, descriptor_pool, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS, : ComputePass(device_, descriptor_pool, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS,
INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, {}, INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, {},
VULKAN_UINT8_COMP_SPV), VULKAN_UINT8_COMP_SPV),
@ -244,7 +244,7 @@ std::pair<VkBuffer, VkDeviceSize> Uint8Pass::Assemble(u32 num_vertices, VkBuffer
QuadIndexedPass::QuadIndexedPass(const Device& device_, Scheduler& scheduler_, QuadIndexedPass::QuadIndexedPass(const Device& device_, Scheduler& scheduler_,
DescriptorPool& descriptor_pool_, DescriptorPool& descriptor_pool_,
StagingBufferPool& staging_buffer_pool_, StagingBufferPool& staging_buffer_pool_,
VKUpdateDescriptorQueue& update_descriptor_queue_) UpdateDescriptorQueue& update_descriptor_queue_)
: ComputePass(device_, descriptor_pool_, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS, : ComputePass(device_, descriptor_pool_, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS,
INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO,
COMPUTE_PUSH_CONSTANT_RANGE<sizeof(u32) * 2>, VULKAN_QUAD_INDEXED_COMP_SPV), COMPUTE_PUSH_CONSTANT_RANGE<sizeof(u32) * 2>, VULKAN_QUAD_INDEXED_COMP_SPV),
@ -306,7 +306,7 @@ std::pair<VkBuffer, VkDeviceSize> QuadIndexedPass::Assemble(
ASTCDecoderPass::ASTCDecoderPass(const Device& device_, Scheduler& scheduler_, ASTCDecoderPass::ASTCDecoderPass(const Device& device_, Scheduler& scheduler_,
DescriptorPool& descriptor_pool_, DescriptorPool& descriptor_pool_,
StagingBufferPool& staging_buffer_pool_, StagingBufferPool& staging_buffer_pool_,
VKUpdateDescriptorQueue& update_descriptor_queue_, UpdateDescriptorQueue& update_descriptor_queue_,
MemoryAllocator& memory_allocator_) MemoryAllocator& memory_allocator_)
: ComputePass(device_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, : ComputePass(device_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS,
ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO,

View File

@ -21,7 +21,7 @@ namespace Vulkan {
class Device; class Device;
class StagingBufferPool; class StagingBufferPool;
class Scheduler; class Scheduler;
class VKUpdateDescriptorQueue; class UpdateDescriptorQueue;
class Image; class Image;
struct StagingBufferRef; struct StagingBufferRef;
@ -50,7 +50,7 @@ class Uint8Pass final : public ComputePass {
public: public:
explicit Uint8Pass(const Device& device_, Scheduler& scheduler_, explicit Uint8Pass(const Device& device_, Scheduler& scheduler_,
DescriptorPool& descriptor_pool_, StagingBufferPool& staging_buffer_pool_, DescriptorPool& descriptor_pool_, StagingBufferPool& staging_buffer_pool_,
VKUpdateDescriptorQueue& update_descriptor_queue_); UpdateDescriptorQueue& update_descriptor_queue_);
~Uint8Pass(); ~Uint8Pass();
/// Assemble uint8 indices into an uint16 index buffer /// Assemble uint8 indices into an uint16 index buffer
@ -61,7 +61,7 @@ public:
private: private:
Scheduler& scheduler; Scheduler& scheduler;
StagingBufferPool& staging_buffer_pool; StagingBufferPool& staging_buffer_pool;
VKUpdateDescriptorQueue& update_descriptor_queue; UpdateDescriptorQueue& update_descriptor_queue;
}; };
class QuadIndexedPass final : public ComputePass { class QuadIndexedPass final : public ComputePass {
@ -69,7 +69,7 @@ public:
explicit QuadIndexedPass(const Device& device_, Scheduler& scheduler_, explicit QuadIndexedPass(const Device& device_, Scheduler& scheduler_,
DescriptorPool& descriptor_pool_, DescriptorPool& descriptor_pool_,
StagingBufferPool& staging_buffer_pool_, StagingBufferPool& staging_buffer_pool_,
VKUpdateDescriptorQueue& update_descriptor_queue_); UpdateDescriptorQueue& update_descriptor_queue_);
~QuadIndexedPass(); ~QuadIndexedPass();
std::pair<VkBuffer, VkDeviceSize> Assemble( std::pair<VkBuffer, VkDeviceSize> Assemble(
@ -79,7 +79,7 @@ public:
private: private:
Scheduler& scheduler; Scheduler& scheduler;
StagingBufferPool& staging_buffer_pool; StagingBufferPool& staging_buffer_pool;
VKUpdateDescriptorQueue& update_descriptor_queue; UpdateDescriptorQueue& update_descriptor_queue;
}; };
class ASTCDecoderPass final : public ComputePass { class ASTCDecoderPass final : public ComputePass {
@ -87,7 +87,7 @@ public:
explicit ASTCDecoderPass(const Device& device_, Scheduler& scheduler_, explicit ASTCDecoderPass(const Device& device_, Scheduler& scheduler_,
DescriptorPool& descriptor_pool_, DescriptorPool& descriptor_pool_,
StagingBufferPool& staging_buffer_pool_, StagingBufferPool& staging_buffer_pool_,
VKUpdateDescriptorQueue& update_descriptor_queue_, UpdateDescriptorQueue& update_descriptor_queue_,
MemoryAllocator& memory_allocator_); MemoryAllocator& memory_allocator_);
~ASTCDecoderPass(); ~ASTCDecoderPass();
@ -97,7 +97,7 @@ public:
private: private:
Scheduler& scheduler; Scheduler& scheduler;
StagingBufferPool& staging_buffer_pool; StagingBufferPool& staging_buffer_pool;
VKUpdateDescriptorQueue& update_descriptor_queue; UpdateDescriptorQueue& update_descriptor_queue;
MemoryAllocator& memory_allocator; MemoryAllocator& memory_allocator;
}; };

View File

@ -25,7 +25,7 @@ using Shader::Backend::SPIRV::RESCALING_LAYOUT_WORDS_OFFSET;
using Tegra::Texture::TexturePair; using Tegra::Texture::TexturePair;
ComputePipeline::ComputePipeline(const Device& device_, DescriptorPool& descriptor_pool, ComputePipeline::ComputePipeline(const Device& device_, DescriptorPool& descriptor_pool,
VKUpdateDescriptorQueue& update_descriptor_queue_, UpdateDescriptorQueue& update_descriptor_queue_,
Common::ThreadWorker* thread_worker, Common::ThreadWorker* thread_worker,
PipelineStatistics* pipeline_statistics, PipelineStatistics* pipeline_statistics,
VideoCore::ShaderNotify* shader_notify, const Shader::Info& info_, VideoCore::ShaderNotify* shader_notify, const Shader::Info& info_,

View File

@ -29,7 +29,7 @@ class Scheduler;
class ComputePipeline { class ComputePipeline {
public: public:
explicit ComputePipeline(const Device& device, DescriptorPool& descriptor_pool, explicit ComputePipeline(const Device& device, DescriptorPool& descriptor_pool,
VKUpdateDescriptorQueue& update_descriptor_queue, UpdateDescriptorQueue& update_descriptor_queue,
Common::ThreadWorker* thread_worker, Common::ThreadWorker* thread_worker,
PipelineStatistics* pipeline_statistics, PipelineStatistics* pipeline_statistics,
VideoCore::ShaderNotify* shader_notify, const Shader::Info& info, VideoCore::ShaderNotify* shader_notify, const Shader::Info& info,
@ -46,7 +46,7 @@ public:
private: private:
const Device& device; const Device& device;
VKUpdateDescriptorQueue& update_descriptor_queue; UpdateDescriptorQueue& update_descriptor_queue;
Shader::Info info; Shader::Info info;
VideoCommon::ComputeUniformBufferSizes uniform_buffer_sizes{}; VideoCommon::ComputeUniformBufferSizes uniform_buffer_sizes{};

View File

@ -218,7 +218,7 @@ GraphicsPipeline::GraphicsPipeline(
Tegra::Engines::Maxwell3D& maxwell3d_, Tegra::MemoryManager& gpu_memory_, Scheduler& scheduler_, Tegra::Engines::Maxwell3D& maxwell3d_, Tegra::MemoryManager& gpu_memory_, Scheduler& scheduler_,
BufferCache& buffer_cache_, TextureCache& texture_cache_, BufferCache& buffer_cache_, TextureCache& texture_cache_,
VideoCore::ShaderNotify* shader_notify, const Device& device_, DescriptorPool& descriptor_pool, VideoCore::ShaderNotify* shader_notify, const Device& device_, DescriptorPool& descriptor_pool,
VKUpdateDescriptorQueue& update_descriptor_queue_, Common::ThreadWorker* worker_thread, UpdateDescriptorQueue& update_descriptor_queue_, Common::ThreadWorker* worker_thread,
PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache, PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache,
const GraphicsPipelineCacheKey& key_, std::array<vk::ShaderModule, NUM_STAGES> stages, const GraphicsPipelineCacheKey& key_, std::array<vk::ShaderModule, NUM_STAGES> stages,
const std::array<const Shader::Info*, NUM_STAGES>& infos) const std::array<const Shader::Info*, NUM_STAGES>& infos)

View File

@ -63,7 +63,7 @@ class PipelineStatistics;
class RenderPassCache; class RenderPassCache;
class RescalingPushConstant; class RescalingPushConstant;
class Scheduler; class Scheduler;
class VKUpdateDescriptorQueue; class UpdateDescriptorQueue;
class GraphicsPipeline { class GraphicsPipeline {
static constexpr size_t NUM_STAGES = Tegra::Engines::Maxwell3D::Regs::MaxShaderStage; static constexpr size_t NUM_STAGES = Tegra::Engines::Maxwell3D::Regs::MaxShaderStage;
@ -73,7 +73,7 @@ public:
Tegra::Engines::Maxwell3D& maxwell3d, Tegra::MemoryManager& gpu_memory, Tegra::Engines::Maxwell3D& maxwell3d, Tegra::MemoryManager& gpu_memory,
Scheduler& scheduler, BufferCache& buffer_cache, TextureCache& texture_cache, Scheduler& scheduler, BufferCache& buffer_cache, TextureCache& texture_cache,
VideoCore::ShaderNotify* shader_notify, const Device& device, VideoCore::ShaderNotify* shader_notify, const Device& device,
DescriptorPool& descriptor_pool, VKUpdateDescriptorQueue& update_descriptor_queue, DescriptorPool& descriptor_pool, UpdateDescriptorQueue& update_descriptor_queue,
Common::ThreadWorker* worker_thread, PipelineStatistics* pipeline_statistics, Common::ThreadWorker* worker_thread, PipelineStatistics* pipeline_statistics,
RenderPassCache& render_pass_cache, const GraphicsPipelineCacheKey& key, RenderPassCache& render_pass_cache, const GraphicsPipelineCacheKey& key,
std::array<vk::ShaderModule, NUM_STAGES> stages, std::array<vk::ShaderModule, NUM_STAGES> stages,
@ -126,7 +126,7 @@ private:
TextureCache& texture_cache; TextureCache& texture_cache;
BufferCache& buffer_cache; BufferCache& buffer_cache;
Scheduler& scheduler; Scheduler& scheduler;
VKUpdateDescriptorQueue& update_descriptor_queue; UpdateDescriptorQueue& update_descriptor_queue;
void (*configure_func)(GraphicsPipeline*, bool){}; void (*configure_func)(GraphicsPipeline*, bool){};

View File

@ -263,7 +263,7 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, Tegra::Engines::Maxw
Tegra::Engines::KeplerCompute& kepler_compute_, Tegra::Engines::KeplerCompute& kepler_compute_,
Tegra::MemoryManager& gpu_memory_, const Device& device_, Tegra::MemoryManager& gpu_memory_, const Device& device_,
Scheduler& scheduler_, DescriptorPool& descriptor_pool_, Scheduler& scheduler_, DescriptorPool& descriptor_pool_,
VKUpdateDescriptorQueue& update_descriptor_queue_, UpdateDescriptorQueue& update_descriptor_queue_,
RenderPassCache& render_pass_cache_, BufferCache& buffer_cache_, RenderPassCache& render_pass_cache_, BufferCache& buffer_cache_,
TextureCache& texture_cache_, VideoCore::ShaderNotify& shader_notify_) TextureCache& texture_cache_, VideoCore::ShaderNotify& shader_notify_)
: VideoCommon::ShaderCache{rasterizer_, gpu_memory_, maxwell3d_, kepler_compute_}, : VideoCommon::ShaderCache{rasterizer_, gpu_memory_, maxwell3d_, kepler_compute_},

View File

@ -82,7 +82,7 @@ class PipelineStatistics;
class RasterizerVulkan; class RasterizerVulkan;
class RenderPassCache; class RenderPassCache;
class Scheduler; class Scheduler;
class VKUpdateDescriptorQueue; class UpdateDescriptorQueue;
using VideoCommon::ShaderInfo; using VideoCommon::ShaderInfo;
@ -104,7 +104,7 @@ public:
Tegra::Engines::KeplerCompute& kepler_compute, Tegra::Engines::KeplerCompute& kepler_compute,
Tegra::MemoryManager& gpu_memory, const Device& device, Tegra::MemoryManager& gpu_memory, const Device& device,
Scheduler& scheduler, DescriptorPool& descriptor_pool, Scheduler& scheduler, DescriptorPool& descriptor_pool,
VKUpdateDescriptorQueue& update_descriptor_queue, UpdateDescriptorQueue& update_descriptor_queue,
RenderPassCache& render_pass_cache, BufferCache& buffer_cache, RenderPassCache& render_pass_cache, BufferCache& buffer_cache,
TextureCache& texture_cache, VideoCore::ShaderNotify& shader_notify_); TextureCache& texture_cache, VideoCore::ShaderNotify& shader_notify_);
~PipelineCache(); ~PipelineCache();
@ -140,7 +140,7 @@ private:
const Device& device; const Device& device;
Scheduler& scheduler; Scheduler& scheduler;
DescriptorPool& descriptor_pool; DescriptorPool& descriptor_pool;
VKUpdateDescriptorQueue& update_descriptor_queue; UpdateDescriptorQueue& update_descriptor_queue;
RenderPassCache& render_pass_cache; RenderPassCache& render_pass_cache;
BufferCache& buffer_cache; BufferCache& buffer_cache;
TextureCache& texture_cache; TextureCache& texture_cache;

View File

@ -146,7 +146,7 @@ private:
StagingBufferPool staging_pool; StagingBufferPool staging_pool;
DescriptorPool descriptor_pool; DescriptorPool descriptor_pool;
VKUpdateDescriptorQueue update_descriptor_queue; UpdateDescriptorQueue update_descriptor_queue;
BlitImageHelper blit_image; BlitImageHelper blit_image;
ASTCDecoderPass astc_decoder_pass; ASTCDecoderPass astc_decoder_pass;
RenderPassCache render_pass_cache; RenderPassCache render_pass_cache;

View File

@ -12,18 +12,18 @@
namespace Vulkan { namespace Vulkan {
VKUpdateDescriptorQueue::VKUpdateDescriptorQueue(const Device& device_, Scheduler& scheduler_) UpdateDescriptorQueue::UpdateDescriptorQueue(const Device& device_, Scheduler& scheduler_)
: device{device_}, scheduler{scheduler_} { : device{device_}, scheduler{scheduler_} {
payload_cursor = payload.data(); payload_cursor = payload.data();
} }
VKUpdateDescriptorQueue::~VKUpdateDescriptorQueue() = default; UpdateDescriptorQueue::~UpdateDescriptorQueue() = default;
void VKUpdateDescriptorQueue::TickFrame() { void UpdateDescriptorQueue::TickFrame() {
payload_cursor = payload.data(); payload_cursor = payload.data();
} }
void VKUpdateDescriptorQueue::Acquire() { void UpdateDescriptorQueue::Acquire() {
// Minimum number of entries required. // Minimum number of entries required.
// This is the maximum number of entries a single draw call migth use. // This is the maximum number of entries a single draw call migth use.
static constexpr size_t MIN_ENTRIES = 0x400; static constexpr size_t MIN_ENTRIES = 0x400;

View File

@ -28,10 +28,10 @@ struct DescriptorUpdateEntry {
}; };
}; };
class VKUpdateDescriptorQueue final { class UpdateDescriptorQueue final {
public: public:
explicit VKUpdateDescriptorQueue(const Device& device_, Scheduler& scheduler_); explicit UpdateDescriptorQueue(const Device& device_, Scheduler& scheduler_);
~VKUpdateDescriptorQueue(); ~UpdateDescriptorQueue();
void TickFrame(); void TickFrame();