i965: Get vp-tri batchbuffers running (no rendering).
authorEric Anholt <eric@anholt.net>
Thu, 3 Dec 2009 23:04:37 +0000 (15:04 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 25 Feb 2010 18:53:06 +0000 (10:53 -0800)
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/gen6_gs_state.c
src/mesa/drivers/dri/i965/gen6_vs_state.c

index 9f5d789e1ef9e8de213fb26d251785c693136880..f5446ed73bc6bce42043bf1edcb00979eb2b62d1 100644 (file)
@@ -106,10 +106,10 @@ const struct brw_tracked_state *gen6_atoms[] =
 {
    &brw_check_fallback,
 
-#if 0
    &brw_wm_input_sizes,
    &brw_vs_prog,
    &brw_gs_prog,
+#if 0
    &brw_sf_prog,
    &brw_wm_prog,
 
index 3a16bd368ceefed59dc70a00baa46e6c8d09f81a..31da0dc088d0a5c693f07c6e0ba006bf82d37e69 100644 (file)
@@ -38,19 +38,33 @@ upload_gs_state(struct brw_context *brw)
 {
    struct intel_context *intel = &brw->intel;
 
-   BEGIN_BATCH(6);
-   OUT_BATCH(CMD_3D_GS_STATE << 16 | (6 - 2));
-   OUT_BATCH(0); /* prog_bo */
-   /* OUT_RELOC(brw->gs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); */
-   OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) |
-            (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
-   OUT_BATCH(0); /* scratch space base offset */
-   OUT_BATCH((1 << GEN6_GS_DISPATCH_START_GRF_SHIFT) |
-            (brw->gs.prog_data->urb_read_length << GEN6_GS_URB_READ_LENGTH_SHIFT) |
-            (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT));
-   OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) |
-            GEN6_GS_STATISTICS_ENABLE);
-   ADVANCE_BATCH();
+   if (brw->gs.prog_bo) {
+      BEGIN_BATCH(6);
+      OUT_BATCH(CMD_3D_GS_STATE << 16 | (6 - 2));
+      OUT_RELOC(brw->gs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
+      OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) |
+               (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
+      OUT_BATCH(0); /* scratch space base offset */
+      OUT_BATCH((1 << GEN6_GS_DISPATCH_START_GRF_SHIFT) |
+               (brw->gs.prog_data->urb_read_length << GEN6_GS_URB_READ_LENGTH_SHIFT) |
+               (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT));
+      OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) |
+               GEN6_GS_STATISTICS_ENABLE);
+      ADVANCE_BATCH();
+   } else {
+      BEGIN_BATCH(6);
+      OUT_BATCH(CMD_3D_GS_STATE << 16 | (6 - 2));
+      OUT_BATCH(0); /* prog_bo */
+      OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) |
+               (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
+      OUT_BATCH(0); /* scratch space base offset */
+      OUT_BATCH((1 << GEN6_GS_DISPATCH_START_GRF_SHIFT) |
+               (0 << GEN6_GS_URB_READ_LENGTH_SHIFT) |
+               (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT));
+      OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) |
+               GEN6_GS_STATISTICS_ENABLE);
+      ADVANCE_BATCH();
+   }
 
    /* Disable all the constant buffers. */
    BEGIN_BATCH(5);
index 4caabf32b0e7a0e936278403510197694c3ebcda..d82319afa7e27cd3039f5b119a61573bc8589db5 100644 (file)
@@ -40,8 +40,7 @@ upload_vs_state(struct brw_context *brw)
 
    BEGIN_BATCH(6);
    OUT_BATCH(CMD_3D_VS_STATE << 16 | (6 - 2));
-   OUT_BATCH(0); /* prog_bo */
-   /* OUT_RELOC(brw->vs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); */
+   OUT_RELOC(brw->vs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
    OUT_BATCH((0 << GEN6_VS_SAMPLER_COUNT_SHIFT) |
             (brw->vs.nr_surfaces << GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
    OUT_BATCH(0); /* scratch space base offset */