[Mesa-dev] [PATCH 3/7] nvc0: simplify draw parameters upload for vertex shaders

Ilia Mirkin imirkin at alum.mit.edu
Mon Nov 7 03:36:54 UTC 2016


On Tue, Oct 25, 2016 at 3:41 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
> index 138e24d..11fd7eb 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
> @@ -974,19 +974,17 @@ nvc0_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
>
>     nvc0_state_validate_3d(nvc0, ~0);
>
> -   if (nvc0->vertprog->vp.need_draw_parameters) {
> +   if (nvc0->vertprog->vp.need_draw_parameters && !info->indirect) {
>        PUSH_SPACE(push, 9);
>        BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
>        PUSH_DATA (push, NVC0_CB_AUX_SIZE);
>        PUSH_DATAh(push, screen->uniform_bo->offset + NVC0_CB_AUX_INFO(0));
>        PUSH_DATA (push, screen->uniform_bo->offset + NVC0_CB_AUX_INFO(0));
> -      if (!info->indirect) {
> -         BEGIN_1IC0(push, NVC0_3D(CB_POS), 1 + 3);
> -         PUSH_DATA (push, NVC0_CB_AUX_DRAW_INFO);
> -         PUSH_DATA (push, info->index_bias);
> -         PUSH_DATA (push, info->start_instance);
> -         PUSH_DATA (push, info->drawid);
> -      }
> +      BEGIN_1IC0(push, NVC0_3D(CB_POS), 4);

I'd very much prefer this to stay as "1 + 3". Otherwise, this is

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

> +      PUSH_DATA (push, NVC0_CB_AUX_DRAW_INFO);
> +      PUSH_DATA (push, info->index_bias);
> +      PUSH_DATA (push, info->start_instance);
> +      PUSH_DATA (push, info->drawid);
>     }
>
>     if (nvc0->screen->base.class_3d < NVE4_3D_CLASS &&
> --
> 2.10.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list