Vulkan: Add Render Pass / Framebuffer Cache (#6182)

* Vulkan: Add Render Pass / Framebuffer Cache

Cache is owned by each texture view.

- Window's way of getting framebuffer cache for swapchain images is really messy - it creates a TextureView out of just a vk image view, with invalid info and no storage.

* Clear up limited use of alternate TextureView constructor

* Formatting and messages

* More formatting and messages

I apologize for `_colorsCanonical[index]?.Storage?.InsertReadToWriteBarrier`, the compiler made me do it

* Self review, change GetFramebuffer to GetPassAndFramebuffer

* Avoid allocations on Remove for HashTableSlim

* Member can be readonly

* Generate texture create info for swapchain images

* Improve hashcode

* Remove format, samples, size and isDepthStencil when possible

Tested in a number of games, seems fine.

* Removed load op barriers

These can be introduced later.

* Reintroduce UpdateModifications

Technically meant to be replaced by load op stuff.
This commit is contained in:
riperiperi 2024-01-31 22:49:50 +00:00 committed by GitHub
parent d1b30fbe08
commit c94f0fbb83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 515 additions and 234 deletions

View file

@ -51,7 +51,7 @@ namespace Ryujinx.Graphics.Vulkan
{
// We can't use CmdClearAttachments if not writing all components,
// because on Vulkan, the pipeline state does not affect clears.
var dstTexture = FramebufferParams.GetAttachment(index);
var dstTexture = FramebufferParams.GetColorView(index);
if (dstTexture == null)
{
return;
@ -71,7 +71,6 @@ namespace Ryujinx.Graphics.Vulkan
componentMask,
(int)FramebufferParams.Width,
(int)FramebufferParams.Height,
FramebufferParams.AttachmentFormats[index],
FramebufferParams.GetAttachmentComponentType(index),
ClearScissor);
}
@ -92,7 +91,7 @@ namespace Ryujinx.Graphics.Vulkan
{
// We can't use CmdClearAttachments if not clearing all (mask is all ones, 0xFF) or none (mask is 0) of the stencil bits,
// because on Vulkan, the pipeline state does not affect clears.
var dstTexture = FramebufferParams.GetDepthStencilAttachment();
var dstTexture = FramebufferParams.GetDepthStencilView();
if (dstTexture == null)
{
return;