[Mesa-dev] [PATCH] i965: Implement the GL_ARB_base_instance extension.

Kenneth Graunke kenneth at whitecape.org
Fri Jan 18 11:11:10 PST 2013


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.
---
 src/mesa/drivers/dri/i965/brw_draw.c          | 4 ++--
 src/mesa/drivers/dri/intel/intel_extensions.c | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index faa29d1..2c2b826 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -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();
 
diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c
index 8d92df2..97324d7 100755
--- a/src/mesa/drivers/dri/intel/intel_extensions.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -118,6 +118,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;
-- 
1.8.1



More information about the mesa-dev mailing list