Skip to content

Commit

Permalink
[dxvk] Set layer count to one when no attachments are present (doitsu…
Browse files Browse the repository at this point in the history
…jin#3)

set layer count to 1 without attachments

Insipred by CX Hack 20098 and needed for Apple's tiled GPUs and certain
titles (most notably ffxiv)
  • Loading branch information
marzent authored and Gcenx committed Apr 2, 2023
1 parent 90c1bbb commit 1d039a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dxvk/dxvk_framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ namespace dxvk {
fbInfo.width = info.size().width;
fbInfo.height = info.size().height;
fbInfo.layers = info.size().layers;

/* Insipred by CX Hack 20098: Force layer count to 1 so Apple's tiled GPUs don't preallocate
* huge amounts of memory for rasterization when there are no attachments. */
if (!attachmentCount)
fbInfo.layers = 1;

if (m_vkd->vkCreateFramebuffer(m_vkd->device(), &fbInfo, nullptr, &m_handle) != VK_SUCCESS)
Logger::err("DxvkFramebuffer: Failed to create framebuffer object");
Expand Down

0 comments on commit 1d039a2

Please sign in to comment.