[Mesa-dev] [PATCH 3/5] mesa: Disable certain error checks when transform feedback is paused

Paul Berry stereotype441 at gmail.com
Wed Dec 21 13:39:08 PST 2011


When transform feedback is paused, it is legal to change programs or
to perform drawing operations using a drawing mode that doesn't match
the transform feedback mode.
---
 src/mesa/main/shaderapi.c         |    5 +++--
 src/mesa/main/transformfeedback.c |    3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index c4d01ab..b71b44b 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1436,7 +1436,7 @@ _mesa_UseProgramObjectARB(GLhandleARB program)
 
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
-   if (obj->Active) {
+   if (obj->Active && !obj->Paused) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "glUseProgram(transform feedback active)");
       return;
@@ -1638,7 +1638,8 @@ _mesa_UseShaderProgramEXT(GLenum type, GLuint program)
       return;
    }
 
-   if (ctx->TransformFeedback.CurrentObject->Active) {
+   if (ctx->TransformFeedback.CurrentObject->Active &&
+       !ctx->TransformFeedback.CurrentObject->Paused) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "glUseShaderProgramEXT(transform feedback is active)");
       return;
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
index fea711a..be0d0ff 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -98,7 +98,8 @@ reference_transform_feedback_object(struct gl_transform_feedback_object **ptr,
 GLboolean
 _mesa_validate_primitive_mode(struct gl_context *ctx, GLenum mode)
 {
-   if (ctx->TransformFeedback.CurrentObject->Active) {
+   if (ctx->TransformFeedback.CurrentObject->Active &&
+       !ctx->TransformFeedback.CurrentObject->Paused) {
       switch (mode) {
       case GL_POINTS:
          return ctx->TransformFeedback.Mode == GL_POINTS;
-- 
1.7.6.4



More information about the mesa-dev mailing list