summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_program.h
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-09-28 15:39:09 -0600
committerBrian <[email protected]>2007-09-28 15:39:39 -0600
commit636480cc9c7836daf879cb45644900922cf31f47 (patch)
treeb795e3dc8681bff9b3689efc8a1adb735eee7ebb /src/mesa/state_tracker/st_program.h
parentf14ece2d2c9add5ebf21171746f34ce60ff0df3b (diff)
Instead of linked program pairs, keep a list of vertex programs translated for each fragment program.
Diffstat (limited to 'src/mesa/state_tracker/st_program.h')
-rw-r--r--src/mesa/state_tracker/st_program.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h
index 2b792013131..a714f3f5b01 100644
--- a/src/mesa/state_tracker/st_program.h
+++ b/src/mesa/state_tracker/st_program.h
@@ -38,20 +38,28 @@
#include "pipe/tgsi/exec/tgsi_token.h"
#include "x86/rtasm/x86sse.h"
-#define ST_FP_MAX_TOKENS 1024
+
+#define ST_MAX_SHADER_TOKENS 1024
+
struct cso_fragment_shader;
struct cso_vertex_shader;
+struct translated_vertex_program;
+
+/**
+ * Derived from Mesa gl_fragment_program:
+ */
struct st_fragment_program
{
struct gl_fragment_program Base;
- GLboolean error; /* If program is malformed for any reason. */
-
GLuint serialNo;
+ GLuint input_to_slot[FRAG_ATTRIB_MAX]; /**< Maps FRAG_ATTRIB_x to slot */
+ GLuint num_input_slots;
+
/** The program in TGSI format */
- struct tgsi_token tokens[ST_FP_MAX_TOKENS];
+ struct tgsi_token tokens[ST_MAX_SHADER_TOKENS];
#if defined(__i386__) || defined(__386__)
struct x86_function sse2_program;
@@ -61,23 +69,29 @@ struct st_fragment_program
const struct cso_fragment_shader *fs;
GLuint param_state;
+
+ /** List of vertex programs which have been translated such that their
+ * outputs match this fragment program's inputs.
+ */
+ struct translated_vertex_program *vertex_programs;
};
+/**
+ * Derived from Mesa gl_fragment_program:
+ */
struct st_vertex_program
{
struct gl_vertex_program Base; /**< The Mesa vertex program */
- GLboolean error; /**< Set if program is malformed for any reason. */
-
GLuint serialNo;
/** maps a Mesa VERT_ATTRIB_x to a packed TGSI input index */
GLuint input_to_index[MAX_VERTEX_PROGRAM_ATTRIBS];
/** maps a TGSI input index back to a Mesa VERT_ATTRIB_x */
- GLuint index_to_input[MAX_VERTEX_PROGRAM_ATTRIBS];
+ GLuint index_to_input[PIPE_MAX_SHADER_INPUTS];
/** The program in TGSI format */
- struct tgsi_token tokens[ST_FP_MAX_TOKENS];
+ struct tgsi_token tokens[ST_MAX_SHADER_TOKENS];
/** Pointer to the corresponding cached shader */
const struct cso_vertex_shader *vs;