Commit 38488767 by Nicolas Capens Committed by Nicolas Capens

Guard against clearing null depth/stencil buffers.

Change-Id: Ic0a16ac68582e398a02eef722d52a77a1ebde877 Reviewed-on: https://swiftshader-review.googlesource.com/18508Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 329747ca
......@@ -3356,7 +3356,15 @@ namespace sw
void Surface::clearDepth(float depth, int x0, int y0, int width, int height)
{
if(width == 0 || height == 0) return;
if(width == 0 || height == 0)
{
return;
}
if(internal.format == FORMAT_NULL)
{
return;
}
// Not overlapping
if(x0 > internal.width) return;
......@@ -3479,7 +3487,15 @@ namespace sw
void Surface::clearStencil(unsigned char s, unsigned char mask, int x0, int y0, int width, int height)
{
if(mask == 0 || width == 0 || height == 0) return;
if(mask == 0 || width == 0 || height == 0)
{
return;
}
if(stencil.format == FORMAT_NULL)
{
return;
}
// Not overlapping
if(x0 > internal.width) return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment