diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-03-05 18:18:31 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-03-05 18:20:47 +0100 |
commit | c229dd141bdac914afd11fca9a3d280c8e842805 (patch) | |
tree | 699c37848de96f300be171c98d6f8f7491e5e2ca | |
parent | 6ddfb94ce049ee092dbf9b39efa39fcc39167a7a (diff) |
hw hates mefor-jakob
-rw-r--r-- | src/gallium/drivers/i915/i915_prim_vbuf.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/gallium/drivers/i915/i915_prim_vbuf.c b/src/gallium/drivers/i915/i915_prim_vbuf.c index fb4c0516dd..0930c9a8ed 100644 --- a/src/gallium/drivers/i915/i915_prim_vbuf.c +++ b/src/gallium/drivers/i915/i915_prim_vbuf.c @@ -51,6 +51,7 @@ #include "i915_batch.h" #include "i915_state.h" +#include <stdio.h> #define VBUF_MAP_BUFFER @@ -474,12 +475,17 @@ draw_arrays_fallback(struct vbuf_render *render, i915_emit_hardware_state(i915); i915->vbo_flushed = 1; - if (!BEGIN_BATCH(1 + (nr_indices + 1)/2)) { + if (!BEGIN_BATCH(2 * (nr_indices + 1)/2)) { assert(0); goto out; } } + if (i915_render->hwprim == PRIM3D_LINELIST) { + //fprintf(stderr, "gorramit, in fallback\n"); + return; + } + OUT_BATCH(_3DPRIMITIVE | PRIM_INDIRECT | i915_render->hwprim | @@ -644,12 +650,27 @@ i915_vbuf_render_draw_elements(struct vbuf_render *render, i915_emit_hardware_state(i915); i915->vbo_flushed = 1; - if (!BEGIN_BATCH(1 + (nr_indices + 1)/2)) { + if (!BEGIN_BATCH(2 * (nr_indices + 1)/2)) { assert(0); goto out; } } + if (i915_render->hwprim == PRIM3D_LINELIST) { + int i; + unsigned o = i915_render->vbo_index; + //fprintf(stderr, "gorramit, %i\n", nr_indices); + for (i = 0; i + 1 < nr_indices; i += 2) { + OUT_BATCH(_3DPRIMITIVE | + PRIM_INDIRECT | + i915_render->hwprim | + PRIM_INDIRECT_ELTS | + 2); + OUT_BATCH((o+indices[i]) | (o+indices[i+1]) << 16); + } + return; + } + OUT_BATCH(_3DPRIMITIVE | PRIM_INDIRECT | i915_render->hwprim | |