aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-10-25 16:39:18 +0200
committerMarek Olšák <[email protected]>2011-10-25 19:12:33 +0200
commitdc651aff0c725846c86a32c1c076d66b3b38318f (patch)
treeb5c415e3fa55e46660e4cc1d429b2510fe50e551
parent05720e14ba1072c547fc2388738ed4f70a6630b6 (diff)
r600g: don't render if pipe_draw_info::count is 0
Also call r600_conv_pipe_prim earlier.
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 37e666a0924..8cb70ded3c3 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -35,7 +35,7 @@
static void r600_spi_update(struct r600_pipe_context *rctx);
-static int r600_conv_pipe_prim(unsigned pprim, unsigned *prim)
+static bool r600_conv_pipe_prim(unsigned pprim, unsigned *prim)
{
static const int prim_conv[] = {
V_008958_DI_PT_POINTLIST,
@@ -57,9 +57,9 @@ static int r600_conv_pipe_prim(unsigned pprim, unsigned *prim)
*prim = prim_conv[pprim];
if (*prim == -1) {
fprintf(stderr, "%s:%d unsupported %d\n", __func__, __LINE__, pprim);
- return -1;
+ return false;
}
- return 0;
+ return true;
}
/* common state between evergreen and r600 */
@@ -560,6 +560,11 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
struct r600_drawl draw;
unsigned prim, mask;
+ if (!info->count ||
+ !r600_conv_pipe_prim(info->mode, &prim)) {
+ return;
+ }
+
if (!rctx->blit) {
if (rctx->have_depth_fb || rctx->have_depth_texture)
r600_flush_depth_textures(rctx);
@@ -601,9 +606,6 @@ void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
draw.info.index_bias = info->start;
}
- if (r600_conv_pipe_prim(draw.info.mode, &prim))
- return;
-
if (rctx->vs_shader->shader.clamp_color != rctx->clamp_vertex_color)
r600_shader_rebuild(ctx, rctx->vs_shader);