aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Image
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2021-03-08 21:43:39 +0000
committerGitHub <noreply@github.com>2021-03-08 18:43:39 -0300
commit1623ab524f54901e154c8b644e2315985d5bd0a0 (patch)
treeccfc6473f380e30a596e97742d2fd0995ecf2dd1 /Ryujinx.Graphics.OpenGL/Image
parentda283ff3c37629769324926e24a7b203f9901890 (diff)
Improve Buffer Textures and flush Image Stores (#2088)
* Improve Buffer Textures and flush Image Stores Fixes a number of issues with buffer textures: - Reworked Buffer Textures to create their buffers in the TextureManager, then bind them with the BufferManager later. - Fixes an issue where a buffer texture's buffer could be invalidated after it is bound, but before use. - Fixed width unpacking for large buffer textures. The width is now 32-bit rather than 16. - Force buffer textures to be rebound whenever any buffer is created, as using the handle id wasn't reliable, and the cost of binding isn't too high. Fixes vertex explosions and flickering animations in UE4 games. * Set ImageStore flag... for ImageStore. * Check the offset and size.
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Image')
-rw-r--r--Ryujinx.Graphics.OpenGL/Image/TextureBuffer.cs14
1 files changed, 11 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Image/TextureBuffer.cs b/Ryujinx.Graphics.OpenGL/Image/TextureBuffer.cs
index 5607fb40..f49a0647 100644
--- a/Ryujinx.Graphics.OpenGL/Image/TextureBuffer.cs
+++ b/Ryujinx.Graphics.OpenGL/Image/TextureBuffer.cs
@@ -6,12 +6,17 @@ namespace Ryujinx.Graphics.OpenGL.Image
{
class TextureBuffer : TextureBase, ITexture
{
+ private Renderer _renderer;
private int _bufferOffset;
private int _bufferSize;
+ private int _bufferCount;
private BufferHandle _buffer;
- public TextureBuffer(TextureCreateInfo info) : base(info) {}
+ public TextureBuffer(Renderer renderer, TextureCreateInfo info) : base(info)
+ {
+ _renderer = renderer;
+ }
public void CopyTo(ITexture destination, int firstLayer, int firstLevel)
{
@@ -50,16 +55,19 @@ namespace Ryujinx.Graphics.OpenGL.Image
public void SetStorage(BufferRange buffer)
{
- if (buffer.Handle == _buffer &&
+ if (_buffer != BufferHandle.Null &&
buffer.Offset == _bufferOffset &&
- buffer.Size == _bufferSize)
+ buffer.Size == _bufferSize &&
+ _renderer.BufferCount == _bufferCount)
{
+ // Only rebind the buffer when more have been created.
return;
}
_buffer = buffer.Handle;
_bufferOffset = buffer.Offset;
_bufferSize = buffer.Size;
+ _bufferCount = _renderer.BufferCount;
Bind(0);