renderer_vulkan: Allocate descriptor sets during reinterpretation

This commit is contained in:
emufan4568
2022-10-11 19:22:18 +03:00
committed by GPUCode
parent 42af22f8fd
commit 009d73fdf6
3 changed files with 9 additions and 18 deletions

View File

@ -99,13 +99,6 @@ void main() {
compute_pipeline_layout = device.createPipelineLayout(layout_info);
const vk::DescriptorSetAllocateInfo alloc_info = {.descriptorPool =
scheduler.GetPersistentDescriptorPool(),
.descriptorSetCount = 1,
.pSetLayouts = &descriptor_layout};
descriptor_set = device.allocateDescriptorSets(alloc_info)[0];
const vk::PipelineShaderStageCreateInfo compute_stage = {
.stage = vk::ShaderStageFlagBits::eCompute, .module = compute_shader, .pName = "main"};
@ -144,10 +137,16 @@ void D24S8toRGBA8::Reinterpret(Surface& source, VideoCore::Rect2D src_rect, Surf
vk::DescriptorImageInfo{.imageView = dest.GetImageView(),
.imageLayout = vk::ImageLayout::eGeneral}};
const vk::DescriptorSetAllocateInfo alloc_info = {.descriptorPool =
scheduler.GetDescriptorPool(),
.descriptorSetCount = 1,
.pSetLayouts = &descriptor_layout};
descriptor_set = device.allocateDescriptorSets(alloc_info)[0];
device.updateDescriptorSetWithTemplate(descriptor_set, update_template, textures[0]);
command_buffer.bindDescriptorSets(vk::PipelineBindPoint::eCompute, compute_pipeline_layout, 0,
1, &descriptor_set, 0, nullptr);
command_buffer.bindPipeline(vk::PipelineBindPoint::eCompute, compute_pipeline);
const auto src_offset = Common::MakeVec(src_rect.left, src_rect.bottom);

View File

@ -35,15 +35,14 @@ TaskScheduler::TaskScheduler(const Instance& instance, RendererVulkan& renderer)
vk::DescriptorPoolSize{vk::DescriptorType::eSampledImage, 2048},
vk::DescriptorPoolSize{vk::DescriptorType::eCombinedImageSampler, 512},
vk::DescriptorPoolSize{vk::DescriptorType::eSampler, 2048},
vk::DescriptorPoolSize{vk::DescriptorType::eUniformTexelBuffer, 1024}};
vk::DescriptorPoolSize{vk::DescriptorType::eUniformTexelBuffer, 1024},
vk::DescriptorPoolSize{vk::DescriptorType::eStorageImage, 1024}};
const vk::DescriptorPoolCreateInfo descriptor_pool_info = {
.maxSets = 2048,
.poolSizeCount = static_cast<u32>(pool_sizes.size()),
.pPoolSizes = pool_sizes.data()};
persistent_descriptor_pool = device.createDescriptorPool(descriptor_pool_info);
const vk::CommandBufferAllocateInfo buffer_info = {.commandPool = command_pool,
.level = vk::CommandBufferLevel::ePrimary,
.commandBufferCount =
@ -86,7 +85,6 @@ TaskScheduler::~TaskScheduler() {
}
device.destroyCommandPool(command_pool);
device.destroyDescriptorPool(persistent_descriptor_pool);
}
void TaskScheduler::Synchronize(u32 slot) {

View File

@ -52,11 +52,6 @@ public:
return commands[current_command].descriptor_pool;
}
/// Returns the persistent descriptor pool
vk::DescriptorPool GetPersistentDescriptorPool() const {
return persistent_descriptor_pool;
}
/// Returns the index of the current command slot
u32 GetCurrentSlotIndex() const {
return current_command;
@ -97,7 +92,6 @@ private:
vk::CommandPool command_pool{};
vk::Semaphore timeline{};
vk::DescriptorPool persistent_descriptor_pool;
std::array<ExecutionSlot, SCHEDULER_COMMAND_COUNT> commands{};
u32 current_command = 0;
};