From 4c0eb91d7e6bdbe42ffa6e950e3288f8066de089 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Tue, 20 Sep 2022 22:38:48 +0100 Subject: Convert Quads to Triangles in Vulkan (#3715) * Add Index Buffer conversion for quads to Vulkan Also adds a reusable repeating pattern index buffer to use for non-indexed draws, and generalizes the conversion cache for buffers. * Fix some issues * End render pass before conversion * Resume transform feedback after we ensure we're in a pass. * Always generate UInt32 type indices for topology conversion * No it's not. * Remove unused code * Rely on TopologyRemap to convert quads to tris. * Remove double newline * Ensure render pass ends before stride or I8 conversion --- Ryujinx.Graphics.Vulkan/BufferState.cs | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'Ryujinx.Graphics.Vulkan/BufferState.cs') diff --git a/Ryujinx.Graphics.Vulkan/BufferState.cs b/Ryujinx.Graphics.Vulkan/BufferState.cs index 1790017a..88858e86 100644 --- a/Ryujinx.Graphics.Vulkan/BufferState.cs +++ b/Ryujinx.Graphics.Vulkan/BufferState.cs @@ -1,5 +1,4 @@ -using Silk.NET.Vulkan; -using System; +using System; namespace Ryujinx.Graphics.Vulkan { @@ -9,38 +8,17 @@ namespace Ryujinx.Graphics.Vulkan private readonly int _offset; private readonly int _size; - private readonly IndexType _type; private readonly Auto _buffer; - public BufferState(Auto buffer, int offset, int size, IndexType type) - { - _buffer = buffer; - - _offset = offset; - _size = size; - _type = type; - buffer?.IncrementReferenceCount(); - } - public BufferState(Auto buffer, int offset, int size) { _buffer = buffer; - _offset = offset; _size = size; - _type = IndexType.Uint16; buffer?.IncrementReferenceCount(); } - public void BindIndexBuffer(Vk api, CommandBufferScoped cbs) - { - if (_buffer != null) - { - api.CmdBindIndexBuffer(cbs.CommandBuffer, _buffer.Get(cbs, _offset, _size).Value, (ulong)_offset, _type); - } - } - public void BindTransformFeedbackBuffer(VulkanRenderer gd, CommandBufferScoped cbs, uint binding) { if (_buffer != null) -- cgit v1.2.3