Commit a7441353 by Jamie Madill

Fix missing texture target validations.

We were missing this in a few places, and this was giving runtime errors in dEQP negative tests. BUG=angleproject:901 Change-Id: I9de5b055dcfe4ad5c13c800a31b4a0b424863bee Reviewed-on: https://chromium-review.googlesource.com/266888Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 48d33aef
......@@ -2512,6 +2512,12 @@ void GL_APIENTRY GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidTextureTarget(context, target))
{
context->recordError(Error(GL_INVALID_ENUM, "Invalid texture target"));
return;
}
Texture *texture = context->getTargetTexture(target);
if (!texture)
......@@ -2644,6 +2650,12 @@ void GL_APIENTRY GetTexParameteriv(GLenum target, GLenum pname, GLint* params)
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidTextureTarget(context, target))
{
context->recordError(Error(GL_INVALID_ENUM, "Invalid texture target"));
return;
}
Texture *texture = context->getTargetTexture(target);
if (!texture)
......@@ -3648,6 +3660,12 @@ void GL_APIENTRY TexParameterf(GLenum target, GLenum pname, GLfloat param)
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidTextureTarget(context, target))
{
context->recordError(Error(GL_INVALID_ENUM, "Invalid texture target"));
return;
}
if (!ValidateTexParamParameters(context, pname, static_cast<GLint>(param)))
{
return;
......@@ -3697,6 +3715,12 @@ void GL_APIENTRY TexParameteri(GLenum target, GLenum pname, GLint param)
Context *context = GetValidGlobalContext();
if (context)
{
if (!ValidTextureTarget(context, target))
{
context->recordError(Error(GL_INVALID_ENUM, "Invalid Texture target"));
return;
}
if (!ValidateTexParamParameters(context, pname, param))
{
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