mesa: added glGet queries for transform_feedback
authorBrian Paul <brianp@vmware.com>
Wed, 31 Mar 2010 01:55:08 +0000 (19:55 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 31 Mar 2010 02:04:05 +0000 (20:04 -0600)
src/mesa/main/get.c
src/mesa/main/get_gen.py

index 266fda40ec51668c78eebf02a75212a463be5e35..eaa6d7f7307ce2814b44f2a49abf5f76ded29e54 100644 (file)
@@ -1922,6 +1922,26 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
          CHECK_EXT1(ARB_sync, "GetBooleanv");
          params[0] = INT64_TO_BOOLEAN(ctx->Const.MaxServerWaitTimeout);
          break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+         CHECK_EXT1(EXT_transform_feedback, "GetBooleanv");
+         params[0] = INT_TO_BOOLEAN(ctx->TransformFeedback.CurrentBuffer->Name);
+         break;
+      case GL_RASTERIZER_DISCARD:
+         CHECK_EXT1(EXT_transform_feedback, "GetBooleanv");
+         params[0] = ctx->TransformFeedback.RasterDiscard;
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:
+         CHECK_EXT1(EXT_transform_feedback, "GetBooleanv");
+         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTransformFeedbackInterleavedComponents);
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
+         CHECK_EXT1(EXT_transform_feedback, "GetBooleanv");
+         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTransformFeedbackSeparateAttribs);
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:
+         CHECK_EXT1(EXT_transform_feedback, "GetBooleanv");
+         params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTransformFeedbackSeparateComponents);
+         break;
       case GL_NUM_EXTENSIONS:
          params[0] = INT_TO_BOOLEAN(_mesa_get_extension_count(ctx));
          break;
@@ -3793,6 +3813,26 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
          CHECK_EXT1(ARB_sync, "GetFloatv");
          params[0] = (GLfloat)(ctx->Const.MaxServerWaitTimeout);
          break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+         CHECK_EXT1(EXT_transform_feedback, "GetFloatv");
+         params[0] = (GLfloat)(ctx->TransformFeedback.CurrentBuffer->Name);
+         break;
+      case GL_RASTERIZER_DISCARD:
+         CHECK_EXT1(EXT_transform_feedback, "GetFloatv");
+         params[0] = BOOLEAN_TO_FLOAT(ctx->TransformFeedback.RasterDiscard);
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:
+         CHECK_EXT1(EXT_transform_feedback, "GetFloatv");
+         params[0] = (GLfloat)(ctx->Const.MaxTransformFeedbackInterleavedComponents);
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
+         CHECK_EXT1(EXT_transform_feedback, "GetFloatv");
+         params[0] = (GLfloat)(ctx->Const.MaxTransformFeedbackSeparateAttribs);
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:
+         CHECK_EXT1(EXT_transform_feedback, "GetFloatv");
+         params[0] = (GLfloat)(ctx->Const.MaxTransformFeedbackSeparateComponents);
+         break;
       case GL_NUM_EXTENSIONS:
          params[0] = (GLfloat)(_mesa_get_extension_count(ctx));
          break;
@@ -5664,6 +5704,26 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
          CHECK_EXT1(ARB_sync, "GetIntegerv");
          params[0] = INT64_TO_INT(ctx->Const.MaxServerWaitTimeout);
          break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+         CHECK_EXT1(EXT_transform_feedback, "GetIntegerv");
+         params[0] = ctx->TransformFeedback.CurrentBuffer->Name;
+         break;
+      case GL_RASTERIZER_DISCARD:
+         CHECK_EXT1(EXT_transform_feedback, "GetIntegerv");
+         params[0] = BOOLEAN_TO_INT(ctx->TransformFeedback.RasterDiscard);
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:
+         CHECK_EXT1(EXT_transform_feedback, "GetIntegerv");
+         params[0] = ctx->Const.MaxTransformFeedbackInterleavedComponents;
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
+         CHECK_EXT1(EXT_transform_feedback, "GetIntegerv");
+         params[0] = ctx->Const.MaxTransformFeedbackSeparateAttribs;
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:
+         CHECK_EXT1(EXT_transform_feedback, "GetIntegerv");
+         params[0] = ctx->Const.MaxTransformFeedbackSeparateComponents;
+         break;
       case GL_NUM_EXTENSIONS:
          params[0] = _mesa_get_extension_count(ctx);
          break;
@@ -7536,6 +7596,26 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
          CHECK_EXT1(ARB_sync, "GetInteger64v");
          params[0] = ctx->Const.MaxServerWaitTimeout;
          break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+         CHECK_EXT1(EXT_transform_feedback, "GetInteger64v");
+         params[0] = (GLint64)(ctx->TransformFeedback.CurrentBuffer->Name);
+         break;
+      case GL_RASTERIZER_DISCARD:
+         CHECK_EXT1(EXT_transform_feedback, "GetInteger64v");
+         params[0] = BOOLEAN_TO_INT64(ctx->TransformFeedback.RasterDiscard);
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:
+         CHECK_EXT1(EXT_transform_feedback, "GetInteger64v");
+         params[0] = (GLint64)(ctx->Const.MaxTransformFeedbackInterleavedComponents);
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
+         CHECK_EXT1(EXT_transform_feedback, "GetInteger64v");
+         params[0] = (GLint64)(ctx->Const.MaxTransformFeedbackSeparateAttribs);
+         break;
+      case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:
+         CHECK_EXT1(EXT_transform_feedback, "GetInteger64v");
+         params[0] = (GLint64)(ctx->Const.MaxTransformFeedbackSeparateComponents);
+         break;
       case GL_NUM_EXTENSIONS:
          params[0] = (GLint64)(_mesa_get_extension_count(ctx));
          break;
@@ -7606,6 +7686,30 @@ _mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params )
          params[2] = INT_TO_BOOLEAN(ctx->Color.ColorMask[index][BCOMP] ? 1 : 0);
          params[3] = INT_TO_BOOLEAN(ctx->Color.ColorMask[index][ACOMP] ? 1 : 0);
          break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_START:
+         CHECK_EXT1(EXT_transform_feedback, "GetBooleanIndexedv");
+         if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+            _mesa_error(ctx, GL_INVALID_VALUE, "glGetBooleanIndexedv(index=%u), index", pname);
+            return;
+         }
+         params[0] = INT64_TO_BOOLEAN(ctx->TransformFeedback.Offset[index]);
+         break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
+         CHECK_EXT1(EXT_transform_feedback, "GetBooleanIndexedv");
+         if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+            _mesa_error(ctx, GL_INVALID_VALUE, "glGetBooleanIndexedv(index=%u), index", pname);
+            return;
+         }
+         params[0] = INT64_TO_BOOLEAN(ctx->TransformFeedback.Size[index]);
+         break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+         CHECK_EXT1(EXT_transform_feedback, "GetBooleanIndexedv");
+         if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+            _mesa_error(ctx, GL_INVALID_VALUE, "glGetBooleanIndexedv(index=%u), index", pname);
+            return;
+         }
+         params[0] = INT_TO_BOOLEAN(ctx->TransformFeedback.Buffers[index]->Name);
+         break;
       default:
          _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanIndexedv(pname=0x%x)", pname);
    }
@@ -7640,6 +7744,30 @@ _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params )
          params[2] = ctx->Color.ColorMask[index][BCOMP] ? 1 : 0;
          params[3] = ctx->Color.ColorMask[index][ACOMP] ? 1 : 0;
          break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_START:
+         CHECK_EXT1(EXT_transform_feedback, "GetIntegerIndexedv");
+         if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+            _mesa_error(ctx, GL_INVALID_VALUE, "glGetIntegerIndexedv(index=%u), index", pname);
+            return;
+         }
+         params[0] = INT64_TO_INT(ctx->TransformFeedback.Offset[index]);
+         break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
+         CHECK_EXT1(EXT_transform_feedback, "GetIntegerIndexedv");
+         if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+            _mesa_error(ctx, GL_INVALID_VALUE, "glGetIntegerIndexedv(index=%u), index", pname);
+            return;
+         }
+         params[0] = INT64_TO_INT(ctx->TransformFeedback.Size[index]);
+         break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+         CHECK_EXT1(EXT_transform_feedback, "GetIntegerIndexedv");
+         if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+            _mesa_error(ctx, GL_INVALID_VALUE, "glGetIntegerIndexedv(index=%u), index", pname);
+            return;
+         }
+         params[0] = ctx->TransformFeedback.Buffers[index]->Name;
+         break;
       default:
          _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerIndexedv(pname=0x%x)", pname);
    }
@@ -7675,6 +7803,30 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params )
          params[2] = (GLint64)(ctx->Color.ColorMask[index][BCOMP] ? 1 : 0);
          params[3] = (GLint64)(ctx->Color.ColorMask[index][ACOMP] ? 1 : 0);
          break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_START:
+         CHECK_EXT1(EXT_transform_feedback, "GetInteger64Indexedv");
+         if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+            _mesa_error(ctx, GL_INVALID_VALUE, "glGetInteger64Indexedv(index=%u), index", pname);
+            return;
+         }
+         params[0] = ctx->TransformFeedback.Offset[index];
+         break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
+         CHECK_EXT1(EXT_transform_feedback, "GetInteger64Indexedv");
+         if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+            _mesa_error(ctx, GL_INVALID_VALUE, "glGetInteger64Indexedv(index=%u), index", pname);
+            return;
+         }
+         params[0] = ctx->TransformFeedback.Size[index];
+         break;
+      case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+         CHECK_EXT1(EXT_transform_feedback, "GetInteger64Indexedv");
+         if (index >= ctx->Const.MaxTransformFeedbackSeparateAttribs) {
+            _mesa_error(ctx, GL_INVALID_VALUE, "glGetInteger64Indexedv(index=%u), index", pname);
+            return;
+         }
+         params[0] = (GLint64)(ctx->TransformFeedback.Buffers[index]->Name);
+         break;
       default:
          _mesa_error(ctx, GL_INVALID_ENUM, "glGetInteger64Indexedv(pname=0x%x)", pname);
    }
index cecb86d76a164f47ac27cb57ae0b77a48141b140..bfaca1536d15babe0b63485300c02a3ba811fb92 100644 (file)
@@ -1122,6 +1122,23 @@ StateVars = [
        ( "GL_MAX_SERVER_WAIT_TIMEOUT", GLint64, ["ctx->Const.MaxServerWaitTimeout"], "",
          NoState, ["ARB_sync"] ),
 
+       # GL_EXT_transform_feedback
+       ( "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING", GLint,
+         ["ctx->TransformFeedback.CurrentBuffer->Name"], "",
+         NoState, ["EXT_transform_feedback"] ),
+       ( "GL_RASTERIZER_DISCARD", GLboolean,
+         ["ctx->TransformFeedback.RasterDiscard"], "",
+         NoState, ["EXT_transform_feedback"] ),
+       ( "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", GLint,
+         ["ctx->Const.MaxTransformFeedbackInterleavedComponents"], "",
+         NoState, ["EXT_transform_feedback"] ),
+       ( "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", GLint,
+         ["ctx->Const.MaxTransformFeedbackSeparateAttribs"], "",
+         NoState, ["EXT_transform_feedback"] ),
+       ( "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", GLint,
+         ["ctx->Const.MaxTransformFeedbackSeparateComponents"], "",
+         NoState, ["EXT_transform_feedback"] ),
+
        # GL3
        ( "GL_NUM_EXTENSIONS", GLint, ["_mesa_get_extension_count(ctx)"], "", NoState, NoExt ),
        ( "GL_MAJOR_VERSION", GLint, ["ctx->VersionMajor"], "", NoState, NoExt ),
@@ -1134,6 +1151,7 @@ StateVars = [
 # The tuples are the same as above, with one exception: the "optional"
 # code field is instead the max legal index value.
 IndexedStateVars = [
+       # GL_EXT_draw_buffers2 / GL3
        ( "GL_BLEND", GLint, ["((ctx->Color.BlendEnabled >> index) & 1)"],
          "ctx->Const.MaxDrawBuffers", NoState, ["EXT_draw_buffers2"] ),
        ( "GL_COLOR_WRITEMASK", GLint,
@@ -1142,6 +1160,21 @@ IndexedStateVars = [
                "ctx->Color.ColorMask[index][BCOMP] ? 1 : 0",
                "ctx->Color.ColorMask[index][ACOMP] ? 1 : 0" ],
          "ctx->Const.MaxDrawBuffers", NoState, ["EXT_draw_buffers2"] ),
+
+       # GL_EXT_transform_feedback
+       ( "GL_TRANSFORM_FEEDBACK_BUFFER_START", GLint64,
+         ["ctx->TransformFeedback.Offset[index]"],
+         "ctx->Const.MaxTransformFeedbackSeparateAttribs",
+         NoState, ["EXT_transform_feedback"] ),
+       ( "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE", GLint64,
+         ["ctx->TransformFeedback.Size[index]"],
+         "ctx->Const.MaxTransformFeedbackSeparateAttribs",
+         NoState, ["EXT_transform_feedback"] ),
+       ( "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING", GLint,
+         ["ctx->TransformFeedback.Buffers[index]->Name"],
+         "ctx->Const.MaxTransformFeedbackSeparateAttribs",
+         NoState, ["EXT_transform_feedback"] ),
+
        # XXX more to come...
 ]