[Mesa-dev] [PATCH 03/46] mesa: add tessellation shader structs

Kenneth Graunke kenneth at whitecape.org
Fri Jun 19 03:44:23 PDT 2015


On Wednesday, June 17, 2015 01:00:59 AM Marek Olšák wrote:
> From: Fabian Bieler <fabianbieler at fastmail.fm>
> 
> Marek: remove unused members, cleanup
> ---
>  src/mesa/main/mtypes.h | 105 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 105 insertions(+)
> 
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 086f553..12789f1 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -2163,6 +2163,29 @@ struct gl_vertex_program
>  };
>  
>  
> +/** Tessellation control program object */
> +struct gl_tess_ctrl_program
> +{
> +   struct gl_program Base;   /**< base class */
> +
> +   /* output layout */
> +   GLint VerticesOut;
> +};
> +
> +
> +/** Tessellation evaluation program object */
> +struct gl_tess_eval_program
> +{
> +   struct gl_program Base;   /**< base class */
> +
> +   /* input layout */
> +   GLenum PrimitiveMode; /* GL_TRIANGLES, GL_QUADS or GL_ISOLINES */
> +   GLenum Spacing;       /* GL_EQUAL, GL_FRACTIONAL_EVEN, GL_FRACTIONAL_ODD */
> +   GLenum VertexOrder;   /* GL_CW or GL_CCW */
> +   bool PointMode;
> +};
> +
> +
>  /** Geometry program object */
>  struct gl_geometry_program
>  {
> @@ -2265,6 +2288,27 @@ struct gl_vertex_program_state
>     GLboolean _Overriden;
>  };
>  
> +/**
> + * Context state for tessellation control programs.
> + */
> +struct gl_tess_ctrl_program_state
> +{
> +   /** Currently bound and valid shader. */
> +   struct gl_tess_ctrl_program *_Current;
> +
> +   GLint patch_vertices;
> +   GLfloat patch_default_outer_level[4];
> +   GLfloat patch_default_inner_level[2];
> +};
> +
> +/**
> + * Context state for tessellation evaluation programs.
> + */
> +struct gl_tess_eval_program_state
> +{
> +   /** Currently bound and valid shader. */
> +   struct gl_tess_eval_program *_Current;
> +};
>  
>  /**
>   * Context state for geometry programs.
> @@ -2445,6 +2489,41 @@ struct gl_shader
>     bool pixel_center_integer;
>  
>     /**
> +    * Tessellation Control shader state from layout qualifiers.
> +    */
> +   struct {
> +      /**
> +       * 0 - vertices not declared in shader, or
> +       * 1 .. GL_MAX_PATCH_VERTICES
> +       */
> +      GLint VerticesOut;
> +   } TessCtrl;
> +
> +   /**
> +    * Tessellation Evaluation shader state from layout qualifiers.
> +    */
> +   struct {
> +      /**
> +       * GL_TRIANGLES, GL_QUADS, GL_ISOLINES or PRIM_UNKNOWN if it's not set
> +       * in this shader.
> +       */
> +      GLenum PrimitiveMode;
> +      /**
> +       * GL_EQUAL, GL_FRACTIONAL_ODD, GL_FRACTIONAL_EVEN, or 0 if it's not set
> +       * in this shader.
> +       */
> +      GLenum Spacing;
> +      /**
> +       * GL_CW, GL_CCW, or 0 if it's not set in this shader.
> +       */
> +      GLenum VertexOrder;
> +      /**
> +       * 1, 0, or -1 if it's not set in this shader.
> +       */
> +      int PointMode;
> +   } TessEval;
> +
> +   /**
>      * Geometry shader state from GLSL 1.50 layout qualifiers.
>      */
>     struct {
> @@ -2668,6 +2747,30 @@ struct gl_shader_program
>     enum gl_frag_depth_layout FragDepthLayout;
>  
>     /**
> +    * Tessellation Control shader state from layout qualifiers.
> +    */
> +   struct {
> +      /**
> +       * 0 - vertices not declared in shader, or
> +       * 1 .. GL_MAX_PATCH_VERTICES
> +       */
> +      GLint VerticesOut;
> +   } TessCtrl;
> +
> +   /**
> +    * Tessellation Evaluation shader state from layout qualifiers.
> +    */
> +   struct {
> +      /** GL_TRIANGLES, GL_QUADS or GL_ISOLINES */
> +      GLenum PrimitiveMode;
> +      /** GL_EQUAL, GL_FRACTIONAL_ODD or GL_FRACTIONAL_EVEN */
> +      GLenum Spacing;
> +      /** GL_CW or GL_CCW */
> +      GLenum VertexOrder;
> +      bool PointMode;
> +   } TessEval;

Seems a little odd that we've basically represented this same struct 2-3
times now.  Perhaps give it an actual type and reuse it?  Though I
suppose it doesn't matter much...

> +
> +   /**
>      * Geometry shader state - copied into gl_geometry_program by
>      * _mesa_copy_linked_program_data().
>      */
> @@ -4201,6 +4304,8 @@ struct gl_context
>     struct gl_fragment_program_state FragmentProgram;
>     struct gl_geometry_program_state GeometryProgram;
>     struct gl_compute_program_state ComputeProgram;
> +   struct gl_tess_ctrl_program_state TessCtrlProgram;
> +   struct gl_tess_eval_program_state TessEvalProgram;
>     struct gl_ati_fragment_shader_state ATIFragmentShader;
>  
>     struct gl_pipeline_shader_state Pipeline; /**< GLSL pipeline shader object state */
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150619/934ef3a4/attachment.sig>


More information about the mesa-dev mailing list