Allow null samplers on OpenGL backend

This commit is contained in:
gdk 2022-04-11 18:19:35 -03:00 committed by riperiperi
parent dc0a00f93c
commit dd915ae67b

View file

@ -1177,20 +1177,22 @@ namespace Ryujinx.Graphics.OpenGL
public void SetTextureAndSampler(int binding, ITexture texture, ISampler sampler) public void SetTextureAndSampler(int binding, ITexture texture, ISampler sampler)
{ {
if (texture != null && sampler != null) if (texture != null)
{ {
if (binding == 0) if (binding == 0)
{ {
_unit0Texture = (TextureBase)texture; _unit0Texture = (TextureBase)texture;
_unit0Sampler = (Sampler)sampler;
} }
else else
{ {
((TextureBase)texture).Bind(binding); ((TextureBase)texture).Bind(binding);
} }
((Sampler)sampler).Bind(binding);
} }
Sampler glSampler = (Sampler)sampler;
glSampler?.Bind(binding);
_unit0Sampler = glSampler;
} }