summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state_draw.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-09-06 00:09:17 +0200
committerMarek Olšák <marek.olsak@amd.com>2016-09-07 11:13:13 +0200
commita8e7ea6abce1913ac64143f5a83f82c35b2975d6 (patch)
treebfa6c3567f20e8c1d4b7838baf19252162381276 /src/gallium/drivers/radeonsi/si_state_draw.c
parent53d74e055e3596a05b9a306ea867dac0d4591f95 (diff)
downloadexternal_mesa3d-a8e7ea6abce1913ac64143f5a83f82c35b2975d6.zip
external_mesa3d-a8e7ea6abce1913ac64143f5a83f82c35b2975d6.tar.gz
external_mesa3d-a8e7ea6abce1913ac64143f5a83f82c35b2975d6.tar.bz2
radeonsi: skip draws with instance_count == 0
loosely ported from Vulkan Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state_draw.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_draw.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index 0a91291..9469bb4 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -882,9 +882,19 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
struct pipe_index_buffer ib = {};
unsigned mask, dirty_fb_counter, dirty_tex_counter, rast_prim;
- if (!info->count && !info->indirect &&
- (info->indexed || !info->count_from_stream_output))
- return;
+ if (likely(!info->indirect)) {
+ /* SI-CI treat instance_count==0 as instance_count==1. There is
+ * no workaround for indirect draws, but we can at least skip
+ * direct draws.
+ */
+ if (unlikely(!info->instance_count))
+ return;
+
+ /* Handle count == 0. */
+ if (unlikely(!info->count &&
+ (info->indexed || !info->count_from_stream_output)))
+ return;
+ }
if (!sctx->vs_shader.cso) {
assert(0);