diff options
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_context.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_context.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c index f8c69585e6a..74436f98016 100644 --- a/src/gallium/auxiliary/draw/draw_context.c +++ b/src/gallium/auxiliary/draw/draw_context.c @@ -464,6 +464,32 @@ draw_set_mapped_constant_buffer(struct draw_context *draw, } } +void +draw_set_mapped_shader_buffer(struct draw_context *draw, + enum pipe_shader_type 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_SHADER_BUFFERS); + + draw_do_flush(draw, DRAW_FLUSH_PARAMETER_CHANGE); + + switch (shader_type) { + case PIPE_SHADER_VERTEX: + draw->pt.user.vs_ssbos[slot] = buffer; + draw->pt.user.vs_ssbos_size[slot] = size; + break; + case PIPE_SHADER_GEOMETRY: + draw->pt.user.gs_ssbos[slot] = buffer; + draw->pt.user.gs_ssbos_size[slot] = size; + break; + default: + assert(0 && "invalid shader type in draw_set_mapped_shader_buffer"); + } +} /** * Tells the draw module to draw points with triangles if their size |