Skip to content

Commit

Permalink
vulkan: slightly improve memory placement for fullscreen canvases.
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Sep 29, 2024
1 parent 8e6efac commit 6d40eab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/graphics/vulkan/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ bool Texture::loadVolatile()

VmaAllocationCreateInfo imageAllocationCreateInfo{};

// Dedicated allocations are recommended for fullscreen RTs.
if (renderTarget && pixelWidth >= vgfx->getPixelWidth() && pixelHeight >= vgfx->getPixelHeight())
imageAllocationCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT;

imageAllocationCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;

if (vmaCreateImage(allocator, &imageInfo, &imageAllocationCreateInfo, &textureImage, &textureImageAllocation, nullptr) != VK_SUCCESS)
throw love::Exception("failed to create image");

Expand Down

0 comments on commit 6d40eab

Please sign in to comment.