[Mesa-dev] [PATCH 4/4] i965/state: Add compute pipeline with empty atom lists

Jordan Justen jordan.l.justen at intel.com
Tue Mar 10 10:49:57 PDT 2015


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_context.h      |  1 +
 src/mesa/drivers/dri/i965/brw_state.h        |  1 +
 src/mesa/drivers/dri/i965/brw_state_upload.c | 28 ++++++++++++++++++++++++++--
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 902de18..6c08c68 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -151,6 +151,7 @@ struct brw_wm_prog_data;
 
 enum brw_pipeline {
    BRW_RENDER_PIPELINE,
+   BRW_COMPUTE_PIPELINE,
 
    BRW_NUM_PIPELINES
 };
diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
index ae5ef1f..5e4599d 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -169,6 +169,7 @@ brw_depthbuffer_format(struct brw_context *brw);
  * brw_state.c
  */
 void brw_upload_render_state(struct brw_context *brw);
+void brw_upload_compute_state(struct brw_context *brw);
 void brw_clear_dirty_bits(struct brw_context *brw);
 void brw_init_state(struct brw_context *brw);
 void brw_destroy_state(struct brw_context *brw);
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 6966f06..0b818d0 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -246,6 +246,10 @@ static const struct brw_tracked_state *gen7_atoms[] =
    &haswell_cut_index,
 };
 
+static const struct brw_tracked_state *gen7_compute_atoms[] =
+{
+};
+
 static const struct brw_tracked_state *gen8_atoms[] =
 {
    /* Command packets: */
@@ -322,6 +326,10 @@ static const struct brw_tracked_state *gen8_atoms[] =
    &gen8_pma_fix,
 };
 
+static const struct brw_tracked_state *gen8_compute_atoms[] =
+{
+};
+
 static void
 brw_upload_initial_gpu_state(struct brw_context *brw)
 {
@@ -381,17 +389,27 @@ void brw_init_state( struct brw_context *brw )
 
    STATIC_ASSERT(ARRAY_SIZE(gen4_atoms) <= ARRAY_SIZE(brw->atoms));
    STATIC_ASSERT(ARRAY_SIZE(gen6_atoms) <= ARRAY_SIZE(brw->atoms));
-   STATIC_ASSERT(ARRAY_SIZE(gen7_atoms) <= ARRAY_SIZE(brw->atoms));
-   STATIC_ASSERT(ARRAY_SIZE(gen8_atoms) <= ARRAY_SIZE(brw->atoms));
+   STATIC_ASSERT(ARRAY_SIZE(gen7_atoms) +
+                 ARRAY_SIZE(gen7_compute_atoms) <=
+                 ARRAY_SIZE(brw->atoms));
+   STATIC_ASSERT(ARRAY_SIZE(gen8_atoms) +
+                 ARRAY_SIZE(gen8_compute_atoms) <=
+                 ARRAY_SIZE(brw->atoms));
 
    brw_init_caches(brw);
 
    if (brw->gen >= 8) {
       brw_add_pipeline_atoms(brw, BRW_RENDER_PIPELINE,
                              gen8_atoms, ARRAY_SIZE(gen8_atoms));
+      brw_add_pipeline_atoms(brw, BRW_COMPUTE_PIPELINE,
+                             gen8_compute_atoms,
+                             ARRAY_SIZE(gen8_compute_atoms));
    } else if (brw->gen == 7) {
       brw_add_pipeline_atoms(brw, BRW_RENDER_PIPELINE,
                              gen7_atoms, ARRAY_SIZE(gen7_atoms));
+      brw_add_pipeline_atoms(brw, BRW_COMPUTE_PIPELINE,
+                             gen7_compute_atoms,
+                             ARRAY_SIZE(gen7_compute_atoms));
    } else if (brw->gen == 6) {
       brw_add_pipeline_atoms(brw, BRW_RENDER_PIPELINE,
                              gen6_atoms, ARRAY_SIZE(gen6_atoms));
@@ -727,3 +745,9 @@ brw_clear_dirty_bits(struct brw_context *brw)
    struct brw_state_flags *state = &brw->state.dirty;
    memset(state, 0, sizeof(*state));
 }
+
+void
+brw_upload_compute_state(struct brw_context *brw)
+{
+   brw_upload_pipeline_state(brw, BRW_COMPUTE_PIPELINE);
+}
-- 
2.1.4



More information about the mesa-dev mailing list