summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_context.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 1639043832..a52b93e122 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -234,17 +234,20 @@ draw_set_mapped_vertex_buffer(struct draw_context *draw,
void
draw_set_mapped_constant_buffer(struct draw_context *draw,
unsigned shader_type,
+ unsigned slot,
const void *buffer,
unsigned size )
{
debug_assert(shader_type == PIPE_SHADER_VERTEX ||
shader_type == PIPE_SHADER_GEOMETRY);
+ debug_assert(slot < PIPE_MAX_CONSTANT);
+
if (shader_type == PIPE_SHADER_VERTEX) {
- draw->pt.user.vs_constants = buffer;
- draw_vs_set_constants( draw, (const float (*)[4])buffer, size );
+ draw->pt.user.vs_constants[slot] = buffer;
+ draw_vs_set_constants(draw, slot, buffer, size);
} else if (shader_type == PIPE_SHADER_GEOMETRY) {
- draw->pt.user.gs_constants = buffer;
- draw_gs_set_constants( draw, (const float (*)[4])buffer, size );
+ draw->pt.user.gs_constants[slot] = buffer;
+ draw_gs_set_constants(draw, slot, buffer, size);
}
}