From 7373ec579226e198d3d7825811eb592489acee1c Mon Sep 17 00:00:00 2001 From: riperiperi Date: Sat, 19 Nov 2022 02:11:34 +0000 Subject: [PATCH] Vulkan: Clear dummy texture to (0,0,0,0) on creation (#3867) This might fix an issue with AMD gpus on linux where the data could contain random garbage data. On the switch, it always samples as 0. --- Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs | 6 ++++++ Ryujinx.Graphics.Vulkan/PipelineBase.cs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs b/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs index e0d5d286..8479bcf7 100644 --- a/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs +++ b/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs @@ -130,6 +130,12 @@ namespace Ryujinx.Graphics.Vulkan 1f)); } + public void Initialize() + { + Span dummyTextureData = stackalloc byte[4]; + _dummyTexture.SetData(dummyTextureData); + } + public void SetProgram(ShaderCollection program) { _program = program; diff --git a/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/Ryujinx.Graphics.Vulkan/PipelineBase.cs index 4efe61bf..5d2263aa 100644 --- a/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -114,6 +114,8 @@ namespace Ryujinx.Graphics.Vulkan public void Initialize() { + _descriptorSetUpdater.Initialize(); + SupportBufferUpdater = new SupportBufferUpdater(Gd); SupportBufferUpdater.UpdateRenderScale(_renderScale, 0, SupportBuffer.RenderScaleMaxCount);