mesa: initial data structures for transform feedback
authorBrian Paul <brianp@vmware.com>
Wed, 31 Mar 2010 01:59:51 +0000 (19:59 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 31 Mar 2010 02:04:03 +0000 (20:04 -0600)
src/mesa/main/config.h
src/mesa/main/mfeatures.h
src/mesa/main/mtypes.h

index 2eac1cc2ed9bfcc3eeee501961011ca901cd6c80..30b48e4bd085f962a82fc0bc6a1185d1a7b77908 100644 (file)
 /** For GL_ATI_envmap_bump - support bump mapping on first 8 units */
 #define SUPPORTED_ATI_BUMP_UNITS 0xff
 
+/** For GL_EXT_transform_feedback */
+#define MAX_FEEDBACK_ATTRIBS 32
+
+
+
 /**
  * \name Mesa-specific parameters
  */
index 54edf9e7f01df2c3dc542bf82c1899612c7a1cc0..6ed05da7ac84446683e0b2115cf4c68c91382731 100644 (file)
 #define FEATURE_EXT_framebuffer_object    1
 #define FEATURE_EXT_pixel_buffer_object   1
 #define FEATURE_EXT_texture_sRGB          FEATURE_GL
+#define FEATURE_EXT_transform_feedback    FEATURE_GL
 
 #define FEATURE_APPLE_object_purgeable    FEATURE_GL
 #define FEATURE_ATI_fragment_shader       FEATURE_GL
index 82e004f34868c5a945fcd33abc4d4222de9f4e17..7657efb07737db55fecd8b7aec36f6ad16d4a206 100644 (file)
@@ -1910,6 +1910,11 @@ struct gl_query_state
 
    /** GL_NV_conditional_render */
    struct gl_query_object *CondRenderQuery;
+
+   /** GL_EXT_transform_feedback */
+   struct gl_query_object *PrimitivesGenerated;
+   struct gl_query_object *PrimitivesWritten;
+
    GLenum CondRenderMode;
 };
 
@@ -1976,6 +1981,13 @@ struct gl_shader_program
    /** User-defined attribute bindings (glBindAttribLocation) */
    struct gl_program_parameter_list *Attributes;
 
+   /** Transform feedback varyings */
+   struct {
+      GLenum BufferMode;
+      GLuint NumVarying;
+      GLchar **VaryingNames;  /**< Array [NumVarying] of char * */
+   } TransformFeedback;
+
    /* post-link info: */
    struct gl_vertex_program *VertexProgram;     /**< Linked vertex program */
    struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */
@@ -2016,6 +2028,29 @@ struct gl_shader_state
 };
 
 
+/**
+ * Context state for transform feedback.
+ */
+struct gl_transform_feedback
+{
+   GLboolean Active;  /**< Is transform feedback enabled? */
+   GLenum Mode;       /**< GL_POINTS, GL_LINES or GL_TRIANGLES */
+   /** Start of feedback data in dest buffer */
+   GLintptr Offset[MAX_FEEDBACK_ATTRIBS];
+   /** Max data to put into dest buffer (in bytes) */
+   GLsizeiptr Size[MAX_FEEDBACK_ATTRIBS];
+   GLboolean RasterDiscard;  /**< GL_RASTERIZER_DISCARD */
+
+   /** The general binding point (GL_TRANSFORM_FEEDBACK_BUFFER) */
+   struct gl_buffer_object *CurrentBuffer;
+
+   /** The feedback buffers */
+   GLuint BufferNames[MAX_FEEDBACK_ATTRIBS];
+   struct gl_buffer_object *Buffers[MAX_FEEDBACK_ATTRIBS];
+};
+
+
+
 /**
  * State which can be shared by multiple contexts:
  */
@@ -2388,6 +2423,11 @@ struct gl_constants
 
    /**< OpenGL version 3.x */
    GLbitfield ContextFlags;  /**< Ex: GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT */
+
+   /** GL_EXT_transform_feedback */
+   GLuint MaxTransformFeedbackSeparateAttribs;
+   GLuint MaxTransformFeedbackSeparateComponents;
+   GLuint MaxTransformFeedbackInterleavedComponents;
 };
 
 
@@ -2489,6 +2529,7 @@ struct gl_extensions
    GLboolean EXT_texture_mirror_clamp;
    GLboolean EXT_texture_sRGB;
    GLboolean EXT_texture_swizzle;
+   GLboolean EXT_transform_feedback;
    GLboolean EXT_timer_query;
    GLboolean EXT_vertex_array;
    GLboolean EXT_vertex_array_bgra;
@@ -2956,6 +2997,8 @@ struct __GLcontextRec
 
    struct gl_query_state Query;  /**< occlusion, timer queries */
 
+   struct gl_transform_feedback TransformFeedback;
+
    struct gl_buffer_object *CopyReadBuffer; /**< GL_ARB_copy_buffer */
    struct gl_buffer_object *CopyWriteBuffer; /**< GL_ARB_copy_buffer */
    /*@}*/