[Mesa-dev] [PATCH 2/2] i965/draw state: Allow state upload to proceed when inputs are not set

Kenneth Graunke kenneth at whitecape.org
Sat Nov 22 17:33:54 PST 2014


On Saturday, November 22, 2014 12:02:31 PM Jordan Justen wrote:
> For drawing the OpenGL API should validate this before we try to upload the
> state.
> 
> For compute, these might not be set.
> 
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
> index 5a12439..28136e2 100644
> --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
> +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
> @@ -433,6 +433,10 @@ brw_prepare_vertices(struct brw_context *brw)
>        struct brw_vertex_element *input = &brw->vb.inputs[i];
>  
>        vs_inputs &= ~BITFIELD64_BIT(i);
> +
> +      if (!input->glarray)
> +         continue;
> +
>        brw->vb.enabled[brw->vb.nr_enabled++] = input;
>     }
>  
> 

Seems like you don't want to be calling this code at all when doing compute.

The draw upload code is already complicated and difficult to understand;
although this is a small addition, the "Inputs can be NULL?!?!?" question
readers might have could add to the confusion.  Which is fine, if compute
needs to hit this code...but if it doesn't need it, skipping it altogether
would be clearer and simpler.

Does compute actually want 3DSTATE_VERTEX_BUFFERS/ELEMENTS?  Does it use
3DPRIMITIVE?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141122/a8e482b7/attachment.sig>


More information about the mesa-dev mailing list