summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_program.h
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2010-06-28 17:31:21 -0400
committerZack Rusin <zackr@vmware.com>2010-06-28 22:53:21 -0400
commitda7bd6a90e1fee5c16327338fd251c0f6be34e36 (patch)
tree5f7e3d8f6d30799033afd78beec3e643ef4c7d6c /src/mesa/state_tracker/st_program.h
parent0b50fcbd556ead8d35c2b543f13de433996a5822 (diff)
mesa: initial support for ARB_geometry_shader4
laying down the foundation for everything and implementing most of the stuff. linking, gl_VerticesIn and multidimensional inputs are left.
Diffstat (limited to 'src/mesa/state_tracker/st_program.h')
-rw-r--r--src/mesa/state_tracker/st_program.h48
1 files changed, 45 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h
index d4b7151e92..d779d5a6dd 100644
--- a/src/mesa/state_tracker/st_program.h
+++ b/src/mesa/state_tracker/st_program.h
@@ -41,7 +41,6 @@
struct cso_fragment_shader;
struct cso_vertex_shader;
-struct translated_vertex_program;
/**
@@ -99,8 +98,6 @@ struct st_vp_varient
};
-
-
/**
* Derived from Mesa gl_fragment_program:
*/
@@ -126,6 +123,33 @@ struct st_vertex_program
struct st_vp_varient *varients;
};
+/**
+ * Derived from Mesa gl_geometry_program:
+ */
+struct st_geometry_program
+{
+ struct gl_geometry_program Base; /**< The Mesa geometry program */
+ GLuint serialNo;
+
+ /** map GP input back to VP output */
+ GLuint input_map[PIPE_MAX_SHADER_INPUTS];
+
+ /** maps a Mesa GEOM_ATTRIB_x to a packed TGSI input index */
+ GLuint input_to_index[GEOM_ATTRIB_MAX];
+ /** maps a TGSI input index back to a Mesa GEOM_ATTRIB_x */
+ GLuint index_to_input[PIPE_MAX_SHADER_INPUTS];
+
+ GLuint num_inputs;
+
+ GLuint input_to_slot[GEOM_ATTRIB_MAX]; /**< Maps GEOM_ATTRIB_x to slot */
+ GLuint num_input_slots;
+
+ ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS];
+ ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS];
+
+ struct pipe_shader_state tgsi;
+ void *driver_shader;
+};
static INLINE struct st_fragment_program *
st_fragment_program( struct gl_fragment_program *fp )
@@ -140,6 +164,11 @@ st_vertex_program( struct gl_vertex_program *vp )
return (struct st_vertex_program *)vp;
}
+static INLINE struct st_geometry_program *
+st_geometry_program( struct gl_geometry_program *vp )
+{
+ return (struct st_geometry_program *)vp;
+}
static INLINE void
st_reference_vertprog(struct st_context *st,
@@ -152,6 +181,16 @@ st_reference_vertprog(struct st_context *st,
}
static INLINE void
+st_reference_geomprog(struct st_context *st,
+ struct st_geometry_program **ptr,
+ struct st_geometry_program *prog)
+{
+ _mesa_reference_program(st->ctx,
+ (struct gl_program **) ptr,
+ (struct gl_program *) prog);
+}
+
+static INLINE void
st_reference_fragprog(struct st_context *st,
struct st_fragment_program **ptr,
struct st_fragment_program *prog)
@@ -166,6 +205,9 @@ extern void
st_translate_fragment_program(struct st_context *st,
struct st_fragment_program *fp);
+extern void
+st_translate_geometry_program(struct st_context *st,
+ struct st_geometry_program *stgp);
/* Called after program string change, discard all previous
* compilation results.