i965/gs: Add a case to brwNewProgram() for geometry shaders.
[mesa.git] / src / mesa / drivers / dri / i965 / gen7_disable.c
index 4fbbfe72e3b6b5e042c3eadc6423b133261693ff..c9564c696145759a37454b59fb227eeb9dcaf6f3 100644 (file)
@@ -29,9 +29,7 @@
 static void
 disable_stages(struct brw_context *brw)
 {
-   struct intel_context *intel = &brw->intel;
-
-   assert(brw->gs.prog_bo == NULL);
+   assert(!brw->gs.prog_active);
 
    /* Disable the Geometry Shader (GS) Unit */
    BEGIN_BATCH(7);
@@ -59,6 +57,11 @@ disable_stages(struct brw_context *brw)
    OUT_BATCH(0);
    ADVANCE_BATCH();
 
+   BEGIN_BATCH(2);
+   OUT_BATCH(_3DSTATE_BINDING_TABLE_POINTERS_GS << 16 | (2 - 2));
+   OUT_BATCH(0);
+   ADVANCE_BATCH();
+
    /* Disable the HS Unit */
    BEGIN_BATCH(7);
    OUT_BATCH(_3DSTATE_CONSTANT_HS << 16 | (7 - 2));
@@ -80,6 +83,11 @@ disable_stages(struct brw_context *brw)
    OUT_BATCH(0);
    ADVANCE_BATCH();
 
+   BEGIN_BATCH(2);
+   OUT_BATCH(_3DSTATE_BINDING_TABLE_POINTERS_HS << 16 | (2 - 2));
+   OUT_BATCH(0);
+   ADVANCE_BATCH();
+
    /* Disable the TE */
    BEGIN_BATCH(4);
    OUT_BATCH(_3DSTATE_TE << 16 | (4 - 2));
@@ -108,10 +116,8 @@ disable_stages(struct brw_context *brw)
    OUT_BATCH(0);
    ADVANCE_BATCH();
 
-   /* Disable the SOL stage */
-   BEGIN_BATCH(3);
-   OUT_BATCH(_3DSTATE_STREAMOUT << 16 | (3 - 2));
-   OUT_BATCH(0);
+   BEGIN_BATCH(2);
+   OUT_BATCH(_3DSTATE_BINDING_TABLE_POINTERS_DS << 16 | (2 - 2));
    OUT_BATCH(0);
    ADVANCE_BATCH();
 }
@@ -119,7 +125,7 @@ disable_stages(struct brw_context *brw)
 const struct brw_tracked_state gen7_disable_stages = {
    .dirty = {
       .mesa  = 0,
-      .brw   = BRW_NEW_BATCH,
+      .brw   = BRW_NEW_CONTEXT,
       .cache = 0,
    },
    .emit = disable_stages,