summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_program.h
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-07-19 20:24:55 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2007-07-19 20:24:55 +0100
commit4824c342c864e870251a7d343c95e51274e50d23 (patch)
tree483fa4e4aaf87d37fd5005032f27584110de595d /src/mesa/state_tracker/st_program.h
parent6101fe641cd506422d0b2735dfcaa61174684ec4 (diff)
Trigger tgsi compilation for fragment programs.
Not sure the generated program looks correct though...
Diffstat (limited to 'src/mesa/state_tracker/st_program.h')
-rw-r--r--src/mesa/state_tracker/st_program.h38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h
index a47059d7a6..b28887946d 100644
--- a/src/mesa/state_tracker/st_program.h
+++ b/src/mesa/state_tracker/st_program.h
@@ -34,6 +34,12 @@
#ifndef ST_PROGRAM_H
#define ST_PROGRAM_H
+#include "mtypes.h"
+#include "pipe/tgsi/core/tgsi_token.h"
+
+#define ST_FP_MAX_TOKENS 1024
+
+
struct st_fragment_program
{
struct gl_fragment_program Base;
@@ -43,6 +49,11 @@ struct st_fragment_program
* ProgramStringNotify changes.
*/
+
+ struct tgsi_token tokens[ST_FP_MAX_TOKENS];
+ GLboolean dirty;
+
+
#if 0
GLfloat (*cbuffer)[4];
GLuint nr_constants;
@@ -56,13 +67,38 @@ struct st_fragment_program
const GLfloat *values; /* Pointer to tracked values */
} *param;
GLuint nr_params;
+#endif
GLuint param_state;
-#endif
};
+struct st_vertex_program
+{
+ struct gl_vertex_program Base;
+ GLboolean error; /* If program is malformed for any reason. */
+
+ GLuint id; /* String id, for tracking
+ * ProgramStringNotify changes.
+ */
+
+ GLboolean dirty;
+ GLuint param_state;
+};
+
void st_init_cb_program( struct st_context *st );
void st_destroy_cb_program( struct st_context *st );
+static inline struct st_fragment_program *
+st_fragment_program( struct gl_fragment_program *fp )
+{
+ return (struct st_fragment_program *)fp;
+}
+
+static inline struct st_vertex_program *
+st_vertex_program( struct gl_vertex_program *vp )
+{
+ return (struct st_vertex_program *)vp;
+}
+
#endif