diff options
author | Michal Krol <[email protected]> | 2010-01-25 12:36:50 +0100 |
---|---|---|
committer | Michal Krol <[email protected]> | 2010-01-28 14:07:53 +0100 |
commit | 9851644435f991a1a1bbb145333a97601627b37d (patch) | |
tree | 20351d0e1cdf5e0bb80d928cad27b77fbb7015af /src/gallium/auxiliary/draw/draw_context.c | |
parent | 44ac4c4e2c7890236ee7e9cd0cf82b58710d57ef (diff) |
gallium: Enable multiple constant buffers for vertex and geometry shaders.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_context.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_context.c | 11 |
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 16390438323..a52b93e1229 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); } } |