Commit 2baa6288 by Shahbaz Youssefi Committed by Commit Bot

Fix validation of glCreateShaderProgramv for geometry/tessellation

Bug: angleproject:5557 Bug: angleproject:5579 Change-Id: I581d7485d0e8771f3f23dea4255139d56052bee9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2653910 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent 53105997
...@@ -1823,12 +1823,33 @@ bool ValidateCreateShaderProgramvBase(const Context *context, ...@@ -1823,12 +1823,33 @@ bool ValidateCreateShaderProgramvBase(const Context *context,
GLsizei count, GLsizei count,
const GLchar *const *strings) const GLchar *const *strings)
{ {
// GL_INVALID_ENUM is generated if type is not an accepted shader type. switch (type)
if ((type != ShaderType::Vertex) && (type != ShaderType::Fragment) &&
(type != ShaderType::Compute))
{ {
context->validationError(GL_INVALID_ENUM, kInvalidShaderType); case ShaderType::InvalidEnum:
return false; context->validationError(GL_INVALID_ENUM, kInvalidShaderType);
return false;
case ShaderType::Vertex:
case ShaderType::Fragment:
case ShaderType::Compute:
break;
case ShaderType::Geometry:
if (!context->getExtensions().geometryShader && context->getClientVersion() < ES_3_2)
{
context->validationError(GL_INVALID_ENUM, kInvalidShaderType);
return false;
}
break;
case ShaderType::TessControl:
case ShaderType::TessEvaluation:
if (!context->getExtensions().tessellationShaderEXT &&
context->getClientVersion() < ES_3_2)
{
context->validationError(GL_INVALID_ENUM, kInvalidShaderType);
return false;
}
break;
default:
UNREACHABLE();
} }
// GL_INVALID_VALUE is generated if count is negative. // GL_INVALID_VALUE is generated if count is negative.
......
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