aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/r300_context.h
diff options
context:
space:
mode:
authorNicolai Haehnle <[email protected]>2007-03-19 23:32:36 +0100
committerNicolai Haehnle <[email protected]>2007-03-19 23:59:59 +0100
commit61821a41c07b6b383a275acf31ade56af2ecfb3c (patch)
tree4918cc33e757e71be301b0efa3249d90c1c4b6bc /src/mesa/drivers/dri/r300/r300_context.h
parent5a6547878373798113f8b55b912abc5bfb93add5 (diff)
r300: Cleanup fragment program constant allocation, share constants
The constant/parameter allocation was significantly simplified, removing one unnecessary copy operation of parameters. The dirty state tracking is unchanged and far from optimal, since all state is always re-fetched. Constants and parameters are now emitted only once, which significantly reduces the resource pressure on larger programs.
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_context.h')
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index 29436ab9e0a..bbe44f5e7f9 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -767,23 +767,21 @@ struct r300_fragment_program {
int tex_offset;
int tex_end;
- /* Hardware constants */
- GLfloat constant[PFS_NUM_CONST_REGS][4];
+ /* Hardware constants.
+ * Contains a pointer to the value. The destination of the pointer
+ * is supposed to be updated when GL state changes.
+ * Typically, this is either a pointer into
+ * gl_program_parameter_list::ParameterValues, or a pointer to a
+ * global constant (e.g. for sin/cos-approximation)
+ */
+ const GLfloat* constant[PFS_NUM_CONST_REGS];
int const_nr;
- /* Tracked parameters */
- struct {
- int idx; /* hardware index */
- GLfloat *values; /* pointer to values */
- } param[PFS_NUM_CONST_REGS];
- int param_nr;
- GLboolean params_uptodate;
-
int max_temp_idx;
/* the index of the sin constant is stored here */
GLint const_sin[2];
-
+
GLuint optimization;
};