summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Pohjolainen <topi.pohjolainen@intel.com>2015-02-12 12:36:31 +0200
committerTopi Pohjolainen <topi.pohjolainen@intel.com>2015-03-30 10:27:20 +0300
commit4186334f545fe4f1eaa76c5bba193fe0d7a2e772 (patch)
treebb1f9c78023d2d3d426bddd612a028686cabe3de
parent43f8ca480b61236ed2daa2e8b0ba34c2f9a49e71 (diff)
i965/wm/gen6: Refactor push constant uploading
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h6
-rw-r--r--src/mesa/drivers/dri/i965/gen6_wm_state.c29
2 files changed, 25 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 28af282631..2d36e3350b 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1924,6 +1924,12 @@ brw_setup_vue_key_clip_info(struct brw_context *brw,
bool program_uses_clip_distance);
void
+gen6_upload_wm_push_constants(struct brw_context *brw,
+ const struct gl_program *fp,
+ struct brw_stage_state *stage_state,
+ const struct brw_stage_prog_data *prog_data);
+
+void
gen6_upload_push_constants(struct brw_context *brw,
const struct gl_program *prog,
const struct brw_stage_prog_data *prog_data,
diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c
index 8e673a4204..7cca5d2a90 100644
--- a/src/mesa/drivers/dri/i965/gen6_wm_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c
@@ -35,23 +35,32 @@
#include "program/prog_statevars.h"
#include "intel_batchbuffer.h"
+void
+gen6_upload_wm_push_constants(struct brw_context *brw,
+ const struct gl_program *fp,
+ struct brw_stage_state *stage_state,
+ const struct brw_stage_prog_data *prog_data)
+{
+ gen6_upload_push_constants(brw, fp, prog_data,
+ stage_state, AUB_TRACE_WM_CONSTANTS);
+
+ if (brw->gen >= 7) {
+ gen7_upload_constant_state(brw, stage_state, true,
+ _3DSTATE_CONSTANT_PS);
+ }
+}
+
static void
-gen6_upload_wm_push_constants(struct brw_context *brw)
+upload_wm_push_constants(struct brw_context *brw)
{
- struct brw_stage_state *stage_state = &brw->wm.base;
/* BRW_NEW_FRAGMENT_PROGRAM */
const struct brw_fragment_program *fp =
brw_fragment_program_const(brw->fragment_program);
/* BRW_NEW_FS_PROG_DATA */
const struct brw_wm_prog_data *prog_data = brw->wm.prog_data;
- gen6_upload_push_constants(brw, &fp->program.Base, &prog_data->base,
- stage_state, AUB_TRACE_WM_CONSTANTS);
-
- if (brw->gen >= 7) {
- gen7_upload_constant_state(brw, &brw->wm.base, true,
- _3DSTATE_CONSTANT_PS);
- }
+ gen6_upload_wm_push_constants(brw, &fp->program.Base, &brw->wm.base,
+ &prog_data->base);
}
const struct brw_tracked_state gen6_wm_push_constants = {
@@ -62,7 +71,7 @@ const struct brw_tracked_state gen6_wm_push_constants = {
BRW_NEW_FS_PROG_DATA |
BRW_NEW_PUSH_CONSTANT_ALLOCATION,
},
- .emit = gen6_upload_wm_push_constants,
+ .emit = upload_wm_push_constants,
};
static void