diff options
author | Andreas Baierl <ichgeh@imkreisrum.de> | 2019-09-27 08:32:12 +0200 |
---|---|---|
committer | Vasily Khoruzhick <anarsoul@gmail.com> | 2019-10-16 16:45:05 +0000 |
commit | 0ee931c1de82507131ea2f327d47342cbfc0c64d (patch) | |
tree | a809246b85ddeec935257bd2dec17c5dd57a710f /src/gallium/drivers | |
parent | f906f5f05398de3142713cdea0828def2032a749 (diff) |
lima: Fix crash when there are no vertex shader attributes
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/lima/lima_draw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/lima/lima_draw.c b/src/gallium/drivers/lima/lima_draw.c index bd6b62a3bb6..3d22ae92781 100644 --- a/src/gallium/drivers/lima/lima_draw.c +++ b/src/gallium/drivers/lima/lima_draw.c @@ -741,13 +741,13 @@ lima_pack_vs_cmd(struct lima_context *ctx, const struct pipe_draw_info *info) int num_varryings = ctx->vs->num_varying; int num_attributes = ctx->vertex_elements->num_elements; - VS_CMD_VARYING_ATTRIBUTE_COUNT(num_varryings, num_attributes); + VS_CMD_VARYING_ATTRIBUTE_COUNT(num_varryings, MAX2(1, num_attributes)); VS_CMD_UNKNOWN1(); VS_CMD_ATTRIBUTES_ADDRESS( lima_ctx_buff_va(ctx, lima_ctx_buff_gp_attribute_info, LIMA_CTX_BUFF_SUBMIT_GP), - num_attributes); + MAX2(1, num_attributes)); VS_CMD_VARYINGS_ADDRESS( lima_ctx_buff_va(ctx, lima_ctx_buff_gp_varying_info, LIMA_CTX_BUFF_SUBMIT_GP), @@ -1140,7 +1140,7 @@ lima_update_gp_attribute_info(struct lima_context *ctx, const struct pipe_draw_i uint32_t *attribute = lima_ctx_buff_alloc(ctx, lima_ctx_buff_gp_attribute_info, - ve->num_elements * 8, true); + MAX2(1, ve->num_elements) * 8, true); int n = 0; for (int i = 0; i < ve->num_elements; i++) { |