i965: Enable the GL_ARB_draw_instanced extension.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 9 Feb 2012 00:40:31 +0000 (16:40 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 29 Feb 2012 22:57:26 +0000 (14:57 -0800)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/intel/intel_extensions.c

index e919f3e5e8a257d3d00962d795cd4e24ae7bd0fc..da37b181f6e8131e821223cb5253d3aaac92bbb9 100644 (file)
@@ -191,7 +191,7 @@ static void brw_emit_prim(struct brw_context *brw,
             vertex_access_type);
    OUT_BATCH(verts_per_instance);
    OUT_BATCH(start_vertex_location);
-   OUT_BATCH(1); // instance count
+   OUT_BATCH(prim->num_instances);
    OUT_BATCH(0); // start instance location
    OUT_BATCH(base_vertex_location);
    ADVANCE_BATCH();
@@ -247,7 +247,7 @@ static void gen7_emit_prim(struct brw_context *brw,
    OUT_BATCH(hw_prim | vertex_access_type);
    OUT_BATCH(verts_per_instance);
    OUT_BATCH(start_vertex_location);
-   OUT_BATCH(1); // instance count
+   OUT_BATCH(prim->num_instances);
    OUT_BATCH(0); // start instance location
    OUT_BATCH(base_vertex_location);
    ADVANCE_BATCH();
index 0ce452fe0be8ccd21bc973ade10a6d0cfd465d57..c4c32ffde5d915347c864dc88c3041ce57b95489 100644 (file)
@@ -43,6 +43,7 @@ intelInitExtensions(struct gl_context *ctx)
    struct intel_context *intel = intel_context(ctx);
 
    ctx->Extensions.ARB_draw_elements_base_vertex = true;
+   ctx->Extensions.ARB_draw_instanced = true;
    ctx->Extensions.ARB_explicit_attrib_location = true;
    ctx->Extensions.ARB_framebuffer_object = true;
    ctx->Extensions.ARB_half_float_pixel = true;