Commit 5bf97084 by Alexis Hetu Committed by Alexis Hétu

Fix for glBindTransformFeedback and glDeleteTransformFeedbacks

Added proper checks for invalid operations. Fixes all remaining failures in dEQP-GLES3.functional.lifetime* Change-Id: Ia91ffdb8ced53f1f787b82ada0de22caf9ee9206 Reviewed-on: https://swiftshader-review.googlesource.com/13748Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent a0ef97a3
...@@ -1511,6 +1511,11 @@ TransformFeedback *Context::getTransformFeedback(GLuint transformFeedback) const ...@@ -1511,6 +1511,11 @@ TransformFeedback *Context::getTransformFeedback(GLuint transformFeedback) const
return mTransformFeedbackNameSpace.find(transformFeedback); return mTransformFeedbackNameSpace.find(transformFeedback);
} }
bool Context::isTransformFeedback(GLuint array) const
{
return mTransformFeedbackNameSpace.isReserved(array);
}
Sampler *Context::getSampler(GLuint sampler) const Sampler *Context::getSampler(GLuint sampler) const
{ {
return mResourceManager->getSampler(sampler); return mResourceManager->getSampler(sampler);
......
...@@ -632,6 +632,7 @@ public: ...@@ -632,6 +632,7 @@ public:
VertexArray *getCurrentVertexArray() const; VertexArray *getCurrentVertexArray() const;
bool isVertexArray(GLuint array) const; bool isVertexArray(GLuint array) const;
TransformFeedback *getTransformFeedback(GLuint transformFeedback) const; TransformFeedback *getTransformFeedback(GLuint transformFeedback) const;
bool isTransformFeedback(GLuint transformFeedback) const;
TransformFeedback *getTransformFeedback() const; TransformFeedback *getTransformFeedback() const;
Sampler *getSampler(GLuint sampler) const; Sampler *getSampler(GLuint sampler) const;
bool isSampler(GLuint sampler) const; bool isSampler(GLuint sampler) const;
......
...@@ -3487,6 +3487,11 @@ GL_APICALL void GL_APIENTRY glBindTransformFeedback(GLenum target, GLuint id) ...@@ -3487,6 +3487,11 @@ GL_APICALL void GL_APIENTRY glBindTransformFeedback(GLenum target, GLuint id)
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
if(!context->isTransformFeedback(id))
{
return error(GL_INVALID_OPERATION);
}
context->bindTransformFeedback(id); context->bindTransformFeedback(id);
} }
} }
...@@ -3508,6 +3513,13 @@ GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks(GLsizei n, const GLuint * ...@@ -3508,6 +3513,13 @@ GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks(GLsizei n, const GLuint *
{ {
if(ids[i] != 0) if(ids[i] != 0)
{ {
es2::TransformFeedback *transformFeedbackObject = context->getTransformFeedback(ids[i]);
if(transformFeedbackObject && transformFeedbackObject->isActive())
{
return error(GL_INVALID_OPERATION);
}
context->deleteTransformFeedback(ids[i]); context->deleteTransformFeedback(ids[i]);
} }
} }
......
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