summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2015-09-30 17:04:23 -0700
committerKenneth Graunke <kenneth@whitecape.org>2015-11-04 10:18:56 -0800
commit3817181a91f517fdf958e46fb27220b7b45bb9a0 (patch)
treed1c62b896abc628d5693648766ac22878949eadc
parent817e9b5c5b284205ee4c0508f5cd0483321392a4 (diff)
i965: Add HS/DS push constant support.
This was probably written by Chris Forbes? Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/mesa/drivers/dri/i965/brw_state.h2
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_upload.c4
-rw-r--r--src/mesa/drivers/dri/i965/gen7_ds_state.c30
-rw-r--r--src/mesa/drivers/dri/i965/gen7_hs_state.c30
4 files changed, 66 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
index 416b62e9a6..194cfdea6b 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -141,8 +141,10 @@ extern const struct brw_tracked_state gen6_wm_push_constants;
extern const struct brw_tracked_state gen6_wm_state;
extern const struct brw_tracked_state gen7_depthbuffer;
extern const struct brw_tracked_state gen7_clip_state;
+extern const struct brw_tracked_state gen7_ds_push_constants;
extern const struct brw_tracked_state gen7_ds_state;
extern const struct brw_tracked_state gen7_gs_state;
+extern const struct brw_tracked_state gen7_hs_push_constants;
extern const struct brw_tracked_state gen7_hs_state;
extern const struct brw_tracked_state gen7_ps_state;
extern const struct brw_tracked_state gen7_push_constant_space;
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index d8b21339db..7272eb8974 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -201,6 +201,8 @@ static const struct brw_tracked_state *gen7_render_atoms[] =
&brw_wm_image_surfaces, /* Before wm push/pull constants and binding table */
&gen6_vs_push_constants, /* Before vs_state */
+ &gen7_hs_push_constants, /* Before hs_state */
+ &gen7_ds_push_constants, /* Before ds_state */
&gen6_gs_push_constants, /* Before gs_state */
&gen6_wm_push_constants, /* Before wm_surfaces and constant_buffer */
@@ -303,6 +305,8 @@ static const struct brw_tracked_state *gen8_render_atoms[] =
&brw_wm_image_surfaces, /* Before wm push/pull constants and binding table */
&gen6_vs_push_constants, /* Before vs_state */
+ &gen7_hs_push_constants, /* Before hs_state */
+ &gen7_ds_push_constants, /* Before ds_state */
&gen6_gs_push_constants, /* Before gs_state */
&gen6_wm_push_constants, /* Before wm_surfaces and constant_buffer */
diff --git a/src/mesa/drivers/dri/i965/gen7_ds_state.c b/src/mesa/drivers/dri/i965/gen7_ds_state.c
index 79993b6d9f..aed8f115ac 100644
--- a/src/mesa/drivers/dri/i965/gen7_ds_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_ds_state.c
@@ -27,6 +27,36 @@
#include "intel_batchbuffer.h"
static void
+gen7_upload_ds_push_constants(struct brw_context *brw)
+{
+ struct brw_stage_state *stage_state = &brw->ds.base;
+ /* BRW_NEW_TESS_EVAL_PROGRAM */
+ const struct brw_tess_eval_program *dp =
+ (struct brw_tess_eval_program *) brw->tess_eval_program;
+
+ if (dp) {
+ /* BRW_NEW_DS_PROG_DATA */
+ const struct brw_stage_prog_data *prog_data = &brw->ds.prog_data->base.base;
+ gen6_upload_push_constants(brw, &dp->program.Base, prog_data,
+ stage_state, AUB_TRACE_VS_CONSTANTS);
+ }
+
+ gen7_upload_constant_state(brw, stage_state, dp, _3DSTATE_CONSTANT_DS);
+}
+
+const struct brw_tracked_state gen7_ds_push_constants = {
+ .dirty = {
+ .mesa = _NEW_PROGRAM_CONSTANTS |
+ _NEW_TRANSFORM,
+ .brw = BRW_NEW_BATCH |
+ BRW_NEW_DS_PROG_DATA |
+ BRW_NEW_PUSH_CONSTANT_ALLOCATION |
+ BRW_NEW_TESS_EVAL_PROGRAM,
+ },
+ .emit = gen7_upload_ds_push_constants,
+};
+
+static void
gen7_upload_ds_state(struct brw_context *brw)
{
/* Disable the DS Unit */
diff --git a/src/mesa/drivers/dri/i965/gen7_hs_state.c b/src/mesa/drivers/dri/i965/gen7_hs_state.c
index ae55f340f5..dc81884905 100644
--- a/src/mesa/drivers/dri/i965/gen7_hs_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_hs_state.c
@@ -27,6 +27,36 @@
#include "intel_batchbuffer.h"
static void
+gen7_upload_hs_push_constants(struct brw_context *brw)
+{
+ struct brw_stage_state *stage_state = &brw->hs.base;
+ /* BRW_NEW_TESS_CTRL_PROGRAM */
+ const struct brw_tess_ctrl_program *hp =
+ (struct brw_tess_ctrl_program *) brw->tess_ctrl_program;
+
+ if (hp) {
+ /* BRW_NEW_HS_PROG_DATA */
+ const struct brw_stage_prog_data *prog_data = &brw->hs.prog_data->base.base;
+ gen6_upload_push_constants(brw, &hp->program.Base, prog_data,
+ stage_state, AUB_TRACE_VS_CONSTANTS);
+ }
+
+ gen7_upload_constant_state(brw, stage_state, hp, _3DSTATE_CONSTANT_HS);
+}
+
+const struct brw_tracked_state gen7_hs_push_constants = {
+ .dirty = {
+ .mesa = _NEW_PROGRAM_CONSTANTS |
+ _NEW_TRANSFORM,
+ .brw = BRW_NEW_BATCH |
+ BRW_NEW_HS_PROG_DATA |
+ BRW_NEW_PUSH_CONSTANT_ALLOCATION |
+ BRW_NEW_TESS_CTRL_PROGRAM,
+ },
+ .emit = gen7_upload_hs_push_constants,
+};
+
+static void
gen7_upload_hs_state(struct brw_context *brw)
{
/* Disable the HS Unit */