diff options
author | Marek Olšák <[email protected]> | 2017-08-17 02:38:23 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-09-11 02:10:23 +0200 |
commit | 43247c440e65e41ea8a7d48249aef66f508601e3 (patch) | |
tree | a758eb7f1f6f67c29fc2fac984870052cda337b7 /src/gallium/drivers/radeon | |
parent | 7aaf4c73de1ad2526b5cd3ddbeecb687b66f6747 (diff) |
gallium/u_blitter: use draw_rectangle callback for layered clears
They are done with instancing.
Reviewed-by: Nicolai Hähnle <[email protected]>
Tested-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 13 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.h | 3 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 1cfab31ea33..f5f15246176 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -211,7 +211,8 @@ void r600_gfx_wait_fence(struct r600_common_context *ctx, } void r600_draw_rectangle(struct blitter_context *blitter, - int x1, int y1, int x2, int y2, float depth, + int x1, int y1, int x2, int y2, + float depth, unsigned num_instances, enum blitter_attrib_type type, const union blitter_attrib *attrib) { @@ -277,8 +278,14 @@ void r600_draw_rectangle(struct blitter_context *blitter, } /* draw */ - util_draw_vertex_buffer(&rctx->b, NULL, buf, blitter->vb_slot, offset, - R600_PRIM_RECTANGLE_LIST, 3, 2); + struct pipe_vertex_buffer vbuffer = {}; + vbuffer.buffer.resource = buf; + vbuffer.stride = 2 * 4 * sizeof(float); /* vertex size */ + vbuffer.buffer_offset = offset; + + rctx->b.set_vertex_buffers(&rctx->b, blitter->vb_slot, 1, &vbuffer); + util_draw_arrays_instanced(&rctx->b, R600_PRIM_RECTANGLE_LIST, 0, 3, + 0, num_instances); pipe_resource_reference(&buf, NULL); } diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 48536723b6c..08220bdfd8d 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -765,7 +765,8 @@ unsigned r600_gfx_write_fence_dwords(struct r600_common_screen *screen); void r600_gfx_wait_fence(struct r600_common_context *ctx, uint64_t va, uint32_t ref, uint32_t mask); void r600_draw_rectangle(struct blitter_context *blitter, - int x1, int y1, int x2, int y2, float depth, + int x1, int y1, int x2, int y2, + float depth, unsigned num_instances, enum blitter_attrib_type type, const union blitter_attrib *attrib); bool r600_common_screen_init(struct r600_common_screen *rscreen, |