From 1623ab524f54901e154c8b644e2315985d5bd0a0 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Mon, 8 Mar 2021 21:43:39 +0000 Subject: 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. --- Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Ryujinx.Graphics.Shader/CodeGen') diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs index 3bfc0647..fc5b06b1 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs @@ -111,6 +111,9 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions if (texOp.Inst == Instruction.ImageStore) { + int texIndex = context.FindImageDescriptorIndex(texOp); + context.ImageDescriptors[texIndex] = context.ImageDescriptors[texIndex].SetFlag(TextureUsageFlags.ImageStore); + VariableType type = texOp.Format.GetComponentType(); string[] cElems = new string[4]; -- cgit v1.2.3