i965: Implement the GL_ARB_base_instance extension.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 18 Jan 2013 19:11:10 +0000 (11:11 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 22 Jan 2013 23:41:30 +0000 (15:41 -0800)
Thanks to Fredrik Höglund, all the hard work was already done.

Tested using a modified oglconform (that actually runs these tests on
our driver); it looks like there may be some bugs when using client
arrays.  All applicable non-compatibility tests passed.

For now, only enable it in core profiles.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Ian Romanick <idr@freedesktop.org>
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/intel/intel_extensions.c

index faa29d124fc5fb561eb627f604ef1a379ea4d328..2c2b826d1966375cdd9033b97f03790a3ec33efc 100644 (file)
@@ -193,7 +193,7 @@ static void brw_emit_prim(struct brw_context *brw,
    OUT_BATCH(verts_per_instance);
    OUT_BATCH(start_vertex_location);
    OUT_BATCH(prim->num_instances);
-   OUT_BATCH(0); // start instance location
+   OUT_BATCH(prim->base_instance);
    OUT_BATCH(base_vertex_location);
    ADVANCE_BATCH();
 
@@ -249,7 +249,7 @@ static void gen7_emit_prim(struct brw_context *brw,
    OUT_BATCH(verts_per_instance);
    OUT_BATCH(start_vertex_location);
    OUT_BATCH(prim->num_instances);
-   OUT_BATCH(0); // start instance location
+   OUT_BATCH(prim->base_instance);
    OUT_BATCH(base_vertex_location);
    ADVANCE_BATCH();
 
index 4e7b5da7accdaac1b67139f6b7f3eb0ecab5b225..e237e022f269589c96e656c4da5248e740b49fe8 100755 (executable)
@@ -120,6 +120,8 @@ intelInitExtensions(struct gl_context *ctx)
    }
 
    if (intel->gen >= 4) {
+      if (ctx->API == API_OPENGL_CORE)
+         ctx->Extensions.ARB_base_instance = true;
       ctx->Extensions.ARB_color_buffer_float = true;
       ctx->Extensions.ARB_depth_buffer_float = true;
       ctx->Extensions.ARB_depth_clamp = true;