mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-27 17:31:31 +00:00
Add small_vector to CopyMSAA with reserve image on upload path
This commit is contained in:
@@ -2015,7 +2015,7 @@ void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset,
|
|||||||
});
|
});
|
||||||
|
|
||||||
const auto [samples_x, samples_y] = VideoCommon::SamplesLog2(info.num_samples);
|
const auto [samples_x, samples_y] = VideoCommon::SamplesLog2(info.num_samples);
|
||||||
std::vector<VideoCommon::ImageCopy> image_copies;
|
boost::container::small_vector<VideoCommon::ImageCopy, 16> image_copies;
|
||||||
image_copies.reserve(copies.size());
|
image_copies.reserve(copies.size());
|
||||||
for (const auto& copy : copies) {
|
for (const auto& copy : copies) {
|
||||||
VideoCommon::ImageCopy image_copy{};
|
VideoCommon::ImageCopy image_copy{};
|
||||||
@@ -2032,12 +2032,13 @@ void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset,
|
|||||||
if (msaa_upload_is_depth) {
|
if (msaa_upload_is_depth) {
|
||||||
runtime->blit_image_helper.CopyMSAADepth(runtime->render_pass_cache, Handle(),
|
runtime->blit_image_helper.CopyMSAADepth(runtime->render_pass_cache, Handle(),
|
||||||
info.format, temp_vk_image, info.format,
|
info.format, temp_vk_image, info.format,
|
||||||
info.num_samples, image_copies,
|
info.num_samples,
|
||||||
|
{image_copies.data(), image_copies.size()},
|
||||||
msaa_upload_copies_stencil, false);
|
msaa_upload_copies_stencil, false);
|
||||||
} else {
|
} else {
|
||||||
runtime->blit_image_helper.CopyMSAA(runtime->render_pass_cache, Handle(), info.format,
|
runtime->blit_image_helper.CopyMSAA(runtime->render_pass_cache, Handle(), info.format,
|
||||||
temp_vk_image, info.format, info.num_samples,
|
temp_vk_image, info.format, info.num_samples,
|
||||||
image_copies, false);
|
{image_copies.data(), image_copies.size()}, false);
|
||||||
}
|
}
|
||||||
initialized = true;
|
initialized = true;
|
||||||
runtime->ReleaseMsaaScratchImage(temp_vk_image);
|
runtime->ReleaseMsaaScratchImage(temp_vk_image);
|
||||||
@@ -2148,7 +2149,8 @@ void Image::DownloadMemory(std::span<VkBuffer> buffers_span, std::span<size_t> o
|
|||||||
init_barrier);
|
init_barrier);
|
||||||
});
|
});
|
||||||
|
|
||||||
std::vector<VideoCommon::ImageCopy> image_copies;
|
boost::container::small_vector<VideoCommon::ImageCopy, 16> image_copies;
|
||||||
|
image_copies.reserve(copies.size());
|
||||||
for (const auto& copy : copies) {
|
for (const auto& copy : copies) {
|
||||||
VideoCommon::ImageCopy image_copy;
|
VideoCommon::ImageCopy image_copy;
|
||||||
image_copy.src_offset = copy.image_offset;
|
image_copy.src_offset = copy.image_offset;
|
||||||
@@ -2162,11 +2164,14 @@ void Image::DownloadMemory(std::span<VkBuffer> buffers_span, std::span<size_t> o
|
|||||||
if (msaa_download_is_depth) {
|
if (msaa_download_is_depth) {
|
||||||
runtime->blit_image_helper.CopyMSAADepth(
|
runtime->blit_image_helper.CopyMSAADepth(
|
||||||
runtime->render_pass_cache, temp_vk_image, info.format, Handle(), info.format,
|
runtime->render_pass_cache, temp_vk_image, info.format, Handle(), info.format,
|
||||||
info.num_samples, image_copies, msaa_download_copies_stencil, true);
|
info.num_samples, {image_copies.data(), image_copies.size()},
|
||||||
|
msaa_download_copies_stencil, true);
|
||||||
} else {
|
} else {
|
||||||
runtime->blit_image_helper.CopyMSAA(runtime->render_pass_cache, temp_vk_image,
|
runtime->blit_image_helper.CopyMSAA(runtime->render_pass_cache, temp_vk_image,
|
||||||
info.format, Handle(), info.format,
|
info.format, Handle(), info.format,
|
||||||
info.num_samples, image_copies, true);
|
info.num_samples,
|
||||||
|
{image_copies.data(), image_copies.size()},
|
||||||
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::container::small_vector<VkBuffer, 8> buffers_vector{};
|
boost::container::small_vector<VkBuffer, 8> buffers_vector{};
|
||||||
|
|||||||
Reference in New Issue
Block a user