Mesa (instanced-arrays): gallium: Add interfaces needed for instanced drawing.

Michał Król michal at kemper.freedesktop.org
Wed Dec 23 10:43:36 PST 2009


Module: Mesa
Branch: instanced-arrays
Commit: d0b55120beb4848be5e7ef24f0301f8397baa8be
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d0b55120beb4848be5e7ef24f0301f8397baa8be

Author: Michal Krol <michal at vmware.com>
Date:   Wed Dec 23 19:37:18 2009 +0100

gallium: Add interfaces needed for instanced drawing.

---

 src/gallium/include/pipe/p_context.h       |   16 ++++++++++++++++
 src/gallium/include/pipe/p_shader_tokens.h |    3 ++-
 src/gallium/include/pipe/p_state.h         |    1 +
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 11bcdc0..d5d1e0e 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -69,6 +69,22 @@ struct pipe_context {
 			     unsigned indexSize,
 			     unsigned mode, unsigned start, unsigned count);
 
+   boolean (*draw_arrays_instanced)(struct pipe_context *pipe,
+                                    unsigned mode,
+                                    unsigned start,
+                                    unsigned count,
+                                    unsigned startInstance,
+                                    unsigned instanceCount);
+
+   boolean (*draw_elements_instanced)(struct pipe_context *pipe,
+                                      struct pipe_buffer *indexBuffer,
+                                      unsigned indexSize,
+                                      unsigned mode,
+                                      unsigned start,
+                                      unsigned count,
+                                      unsigned startInstance,
+                                      unsigned instanceCount);
+
    /* XXX: this is (probably) a temporary entrypoint, as the range
     * information should be available from the vertex_buffer state.
     * Using this to quickly evaluate a specialized path in the draw
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index 5da85bb..d791248 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -130,7 +130,8 @@ struct tgsi_declaration_range
 #define TGSI_SEMANTIC_NORMAL   6
 #define TGSI_SEMANTIC_FACE     7
 #define TGSI_SEMANTIC_EDGEFLAG 8
-#define TGSI_SEMANTIC_COUNT    9 /**< number of semantic values */
+#define TGSI_SEMANTIC_INSTANCEID 9
+#define TGSI_SEMANTIC_COUNT      10 /**< number of semantic values */
 
 struct tgsi_declaration_semantic
 {
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 60e96b9..4d38bbc 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -364,6 +364,7 @@ struct pipe_vertex_buffer
    unsigned stride;    /**< stride to same attrib in next vertex, in bytes */
    unsigned max_index;   /**< number of vertices in this buffer */
    unsigned buffer_offset;  /**< offset to start of data in buffer, in bytes */
+   unsigned instance_divisor;    /**< instance data rate divisor, 0 means per-vertex data */
    struct pipe_buffer *buffer;  /**< the actual buffer */
 };
 



More information about the mesa-commit mailing list