mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-11-24 10:10:12 +01:00
OpenGL: Fix clears of unbound color targets (#3564)
This commit is contained in:
parent
2bb9b33da1
commit
66e7fdb871
@ -147,7 +147,7 @@ namespace Ryujinx.Graphics.OpenGL
|
||||
|
||||
public int GetColorLayerCount(int index)
|
||||
{
|
||||
return _colors[index].Info.GetDepthOrLayers();
|
||||
return _colors[index]?.Info.GetDepthOrLayers() ?? 0;
|
||||
}
|
||||
|
||||
public int GetDepthStencilLayerCount()
|
||||
|
@ -112,6 +112,8 @@ namespace Ryujinx.Graphics.OpenGL
|
||||
|
||||
public void ClearRenderTargetColor(int index, int layer, int layerCount, uint componentMask, ColorF color)
|
||||
{
|
||||
EnsureFramebuffer();
|
||||
|
||||
GL.ColorMask(
|
||||
index,
|
||||
(componentMask & 1) != 0,
|
||||
@ -142,6 +144,8 @@ namespace Ryujinx.Graphics.OpenGL
|
||||
|
||||
public void ClearRenderTargetDepthStencil(int layer, int layerCount, float depthValue, bool depthMask, int stencilValue, int stencilMask)
|
||||
{
|
||||
EnsureFramebuffer();
|
||||
|
||||
bool stencilMaskChanged =
|
||||
stencilMask != 0 &&
|
||||
stencilMask != _stencilFrontMask;
|
||||
|
Loading…
Reference in New Issue
Block a user