[1/2] panfrost: Fix indexed draws

Submitted by Boris Brezillon on Sept. 18, 2019, 1:54 p.m.

Details

Message ID 20190918135438.31935-1-boris.brezillon@collabora.com
State Accepted
Commit 055497fa84d6b17797ca5a2ae90a8f7b8b3d3374
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Boris Brezillon Sept. 18, 2019, 1:54 p.m.
->padded_count should be large enough to cover all vertices pointed by
the index array. Use the local vertex_count variable that contains the
updated vertex_count value for the indexed draw case.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 src/gallium/drivers/panfrost/pan_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 08b799b66bf8..1b8558c1c2c1 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1601,7 +1601,7 @@  panfrost_draw_vbo(
 
                 ctx->padded_count = pan_expand_shift_odd(so);
         } else {
-                ctx->padded_count = ctx->vertex_count;
+                ctx->padded_count = vertex_count;
 
                 /* Reset instancing state */
                 ctx->payloads[PIPE_SHADER_VERTEX].instance_shift = 0;

Comments

R-b

On Wed, Sep 18, 2019 at 03:54:37PM +0200, Boris Brezillon wrote:
> ->padded_count should be large enough to cover all vertices pointed by
> the index array. Use the local vertex_count variable that contains the
> updated vertex_count value for the indexed draw case.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  src/gallium/drivers/panfrost/pan_context.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
> index 08b799b66bf8..1b8558c1c2c1 100644
> --- a/src/gallium/drivers/panfrost/pan_context.c
> +++ b/src/gallium/drivers/panfrost/pan_context.c
> @@ -1601,7 +1601,7 @@ panfrost_draw_vbo(
>  
>                  ctx->padded_count = pan_expand_shift_odd(so);
>          } else {
> -                ctx->padded_count = ctx->vertex_count;
> +                ctx->padded_count = vertex_count;
>  
>                  /* Reset instancing state */
>                  ctx->payloads[PIPE_SHADER_VERTEX].instance_shift = 0;
> -- 
> 2.21.0