vk: Force explicit minimum size declaration for scratch buffers

This commit is contained in:
kd-11 2021-07-26 22:32:29 +03:00 committed by kd-11
parent 99bbcd15e1
commit a4cd9e022a
3 changed files with 4 additions and 4 deletions

View File

@ -1955,7 +1955,7 @@ void VKGSRender::load_program_env()
if (vk::emulate_conditional_rendering())
{
auto predicate = m_cond_render_buffer ? m_cond_render_buffer->value : vk::get_scratch_buffer()->value;
auto predicate = m_cond_render_buffer ? m_cond_render_buffer->value : vk::get_scratch_buffer(4)->value;
m_program->bind_buffer({ predicate, 0, 4 }, binding_table.conditional_render_predicate_slot, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, m_current_frame->descriptor_set);
}
@ -2558,7 +2558,7 @@ void VKGSRender::begin_conditional_rendering(const std::vector<rsx::reports::occ
}
}
auto scratch = vk::get_scratch_buffer();
auto scratch = vk::get_scratch_buffer(OCCLUSION_MAX_POOL_SIZE * 4);
u32 dst_offset = 0;
usz first = 0;
usz last;

View File

@ -544,7 +544,7 @@ namespace vk
const auto dst_w = dst_rect.width();
const auto dst_h = dst_rect.height();
auto scratch_buf = vk::get_scratch_buffer();
auto scratch_buf = vk::get_scratch_buffer(std::max(src_w, dst_w) * std::max(src_h, dst_h) * 4);
//1. Copy unscaled to typeless surface
VkBufferImageCopy info{};

View File

@ -6,7 +6,7 @@ namespace vk
VkSampler null_sampler();
image_view* null_image_view(command_buffer&, VkImageViewType type);
image* get_typeless_helper(VkFormat format, rsx::format_class format_class, u32 requested_width, u32 requested_height);
buffer* get_scratch_buffer(u32 min_required_size = 0);
buffer* get_scratch_buffer(u32 min_required_size);
void clear_scratch_resources();
}