mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-30 02:06:25 +02:00
Change image format view handling to allow view incompatible formats (#7311)
* Allow creating texture aliases on texture pool * Delete old image format override code * New format incompatible alias * Missing bounds check * GetForBinding now takes FormatInfo * Make FormatInfo struct more compact
This commit is contained in:
parent
ccf96bf5e6
commit
eb8132b627
31 changed files with 294 additions and 279 deletions
|
@ -16,7 +16,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
private int _offset;
|
||||
private int _size;
|
||||
private Auto<DisposableBufferView> _bufferView;
|
||||
private Dictionary<Format, Auto<DisposableBufferView>> _selfManagedViews;
|
||||
|
||||
private int _bufferCount;
|
||||
|
||||
|
@ -80,16 +79,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
private void ReleaseImpl()
|
||||
{
|
||||
if (_selfManagedViews != null)
|
||||
{
|
||||
foreach (var bufferView in _selfManagedViews.Values)
|
||||
{
|
||||
bufferView.Dispose();
|
||||
}
|
||||
|
||||
_selfManagedViews = null;
|
||||
}
|
||||
|
||||
_bufferView?.Dispose();
|
||||
_bufferView = null;
|
||||
}
|
||||
|
@ -137,28 +126,5 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
return _bufferView?.Get(cbs, _offset, _size, write).Value ?? default;
|
||||
}
|
||||
|
||||
public BufferView GetBufferView(CommandBufferScoped cbs, Format format, bool write)
|
||||
{
|
||||
var vkFormat = FormatTable.GetFormat(format);
|
||||
if (vkFormat == VkFormat)
|
||||
{
|
||||
return GetBufferView(cbs, write);
|
||||
}
|
||||
|
||||
if (_selfManagedViews != null && _selfManagedViews.TryGetValue(format, out var bufferView))
|
||||
{
|
||||
return bufferView.Get(cbs, _offset, _size, write).Value;
|
||||
}
|
||||
|
||||
bufferView = _gd.BufferManager.CreateView(_bufferHandle, vkFormat, _offset, _size, ReleaseImpl);
|
||||
|
||||
if (bufferView != null)
|
||||
{
|
||||
(_selfManagedViews ??= new Dictionary<Format, Auto<DisposableBufferView>>()).Add(format, bufferView);
|
||||
}
|
||||
|
||||
return bufferView?.Get(cbs, _offset, _size, write).Value ?? default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue