Commit 23e02843 by Geoff Lang Committed by Commit Bot

Only validate texture layer if texture is non-zero.

From the ES3.0 spec: The error INVALID_VALUE is generated if texture is non-zero and layer is negative. BUG=765919 Change-Id: I0ac9bd0335ab4d55701d6def0158297d5add993e Reviewed-on: https://chromium-review.googlesource.com/723741Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent d0ef13a2
...@@ -1103,12 +1103,6 @@ bool ValidateFramebufferTextureLayer(Context *context, ...@@ -1103,12 +1103,6 @@ bool ValidateFramebufferTextureLayer(Context *context,
return false; return false;
} }
if (layer < 0)
{
context->handleError(InvalidValue());
return false;
}
if (!ValidateFramebufferTextureBase(context, target, attachment, texture, level)) if (!ValidateFramebufferTextureBase(context, target, attachment, texture, level))
{ {
return false; return false;
...@@ -1117,6 +1111,12 @@ bool ValidateFramebufferTextureLayer(Context *context, ...@@ -1117,6 +1111,12 @@ bool ValidateFramebufferTextureLayer(Context *context,
const gl::Caps &caps = context->getCaps(); const gl::Caps &caps = context->getCaps();
if (texture != 0) if (texture != 0)
{ {
if (layer < 0)
{
context->handleError(InvalidValue());
return false;
}
gl::Texture *tex = context->getTexture(texture); gl::Texture *tex = context->getTexture(texture);
ASSERT(tex); ASSERT(tex);
......
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