RenderVulkan Experiments: DO-NOT-MERGE: Only recreate when necessary and NEAREST

This commit is contained in:
MrPurple666 2025-04-12 03:57:08 -03:00
parent 2a793d610d
commit ce1a1912ae

View file

@ -184,11 +184,17 @@ class BooleanSetting {
}; };
// Check if we need to recreate the destination frame // Check if we need to recreate the destination frame
bool needs_recreation = true; bool needs_recreation = false; // Only recreate when necessary
if (interpolated_frame->image_view) { if (!interpolated_frame->image_view) {
// Get image extent from framebuffer layout since we can't query it directly needs_recreation = true; // Need to create initially
} else {
// Check if dimensions have changed
if (interpolated_frame->framebuffer) {
needs_recreation = (framebuffer_layout.width / 2 != dst_extent.width) || needs_recreation = (framebuffer_layout.width / 2 != dst_extent.width) ||
(framebuffer_layout.height / 2 != dst_extent.height); (framebuffer_layout.height / 2 != dst_extent.height);
} else {
needs_recreation = true;
}
} }
if (needs_recreation) { if (needs_recreation) {
@ -227,7 +233,7 @@ class BooleanSetting {
cmdbuf.BlitImage( cmdbuf.BlitImage(
*prev_frame->image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *prev_frame->image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
*interpolated_frame->image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, *interpolated_frame->image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
blit_region, VK_FILTER_LINEAR blit_region, VK_FILTER_NEAREST
); );
// Transition back to general layout // Transition back to general layout