summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/draw
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-22 12:24:51 -0600
committerBrian <[email protected]>2007-08-22 12:26:46 -0600
commitc0bb4ba9e665e40a325d82aa2ee48d7b8abd603b (patch)
tree48338074f07042599856e95b4529e0ffbca4be63 /src/mesa/pipe/draw
parentd1fbf621dc48a488c0f860c5851332d269e6d637 (diff)
Rework of shader constant buffers.
They're now totally independent of the actual shaders. Also, implemented in terms of pipe_buffer_handles/objects.
Diffstat (limited to 'src/mesa/pipe/draw')
-rw-r--r--src/mesa/pipe/draw/draw_context.h2
-rw-r--r--src/mesa/pipe/draw/draw_prim.c9
-rw-r--r--src/mesa/pipe/draw/draw_private.h2
3 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/pipe/draw/draw_context.h b/src/mesa/pipe/draw/draw_context.h
index 2fce1322c50..893db1e0c65 100644
--- a/src/mesa/pipe/draw/draw_context.h
+++ b/src/mesa/pipe/draw/draw_context.h
@@ -103,6 +103,8 @@ void draw_set_mapped_element_buffer( struct draw_context *draw,
void draw_set_mapped_vertex_buffer(struct draw_context *draw,
unsigned attr, const void *buffer);
+void draw_set_mapped_constant_buffer(struct draw_context *draw,
+ const void *buffer);
void
draw_set_vertex_buffer(struct draw_context *draw,
diff --git a/src/mesa/pipe/draw/draw_prim.c b/src/mesa/pipe/draw/draw_prim.c
index 97484d5fb95..94cedb02a97 100644
--- a/src/mesa/pipe/draw/draw_prim.c
+++ b/src/mesa/pipe/draw/draw_prim.c
@@ -165,7 +165,7 @@ run_vertex_program(struct draw_context *draw,
NULL /*samplers*/ );
/* Consts does not require 16 byte alignment. */
- machine.Consts = draw->vertex_shader.constants->constant;
+ machine.Consts = (float (*)[4]) draw->mapped_constants;
machine.Inputs = ALIGN16_ASSIGN(inputs);
machine.Outputs = ALIGN16_ASSIGN(outputs);
@@ -742,6 +742,13 @@ void draw_set_mapped_vertex_buffer(struct draw_context *draw,
}
+void draw_set_mapped_constant_buffer(struct draw_context *draw,
+ const void *buffer)
+{
+ draw->mapped_constants = buffer;
+}
+
+
unsigned
draw_prim_info(unsigned prim, unsigned *first, unsigned *incr)
{
diff --git a/src/mesa/pipe/draw/draw_private.h b/src/mesa/pipe/draw/draw_private.h
index 85feb146882..75f7c5d84e6 100644
--- a/src/mesa/pipe/draw/draw_private.h
+++ b/src/mesa/pipe/draw/draw_private.h
@@ -167,6 +167,8 @@ struct draw_context
unsigned eltSize; /**< bytes per index (0, 1, 2 or 4) */
/** The mapped vertex arrays */
const void *mapped_vbuffer[PIPE_ATTRIB_MAX];
+ /** The mapped constant buffers (for vertex shader) */
+ const void *mapped_constants;
/* Clip derived state:
*/