From dd915ae67b643955c30a9599fc83d1687d598bcc Mon Sep 17 00:00:00 2001 From: gdk Date: Mon, 11 Apr 2022 18:19:35 -0300 Subject: [PATCH] Allow null samplers on OpenGL backend --- Ryujinx.Graphics.OpenGL/Pipeline.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs index fb6713360..1bfc0d1cf 100644 --- a/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -1177,20 +1177,22 @@ namespace Ryujinx.Graphics.OpenGL public void SetTextureAndSampler(int binding, ITexture texture, ISampler sampler) { - if (texture != null && sampler != null) + if (texture != null) { if (binding == 0) { _unit0Texture = (TextureBase)texture; - _unit0Sampler = (Sampler)sampler; } else { ((TextureBase)texture).Bind(binding); } - - ((Sampler)sampler).Bind(binding); } + + Sampler glSampler = (Sampler)sampler; + + glSampler?.Bind(binding); + _unit0Sampler = glSampler; }