[Piglit] [PATCH] gl-1.5-vertex-buffer-offsets: test unusual vertex offsets/strides

Ilia Mirkin imirkin at alum.mit.edu
Fri Jun 19 08:01:07 PDT 2015


On Fri, Jun 19, 2015 at 10:56 AM, Brian Paul <brianp at vmware.com> wrote:
> On 06/19/2015 08:52 AM, Ilia Mirkin wrote:
>>
>> On Fri, Jun 19, 2015 at 10:48 AM, Brian Paul <brianp at vmware.com> wrote:
> vbuf is used via CSO so drivers don't have to worry about it.

Right, but nouveau is one of the few (only?) drivers to report
PIPE_CAP_USER_VERTEX_BUFFERS, and it reports 0 for all the 4byte
things, so vbuf doesn't get installed.

>
> I tested it with our in-house driver code (full piglit run) and also with
> softpipe by returning
> PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY=1 and adding some
> assertions:
>
> diff --git a/src/gallium/drivers/softpipe/sp_screen.c
> b/src/gallium/drivers/softpipe/sp_screen.c
> index efa46f3..94a4ff0 100644
> --- a/src/gallium/drivers/softpipe/sp_screen.c
> +++ b/src/gallium/drivers/softpipe/sp_screen.c
> @@ -169,9 +169,10 @@ softpipe_get_param(struct pipe_screen *screen, enum
> pipe_cap param)
>     case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
>     case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
>     case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
> -   case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
>     case PIPE_CAP_TEXTURE_MULTISAMPLE:
>        return 0;
> +   case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
> +      return 1;
>     case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
>        return 64;
>     case PIPE_CAP_QUERY_TIMESTAMP:
> diff --git a/src/gallium/drivers/softpipe/sp_state_vertex.c
> b/src/gallium/drivers/softpipe/sp_state_vertex.c
> index 48c8d2c..d5e73aa 100644
> --- a/src/gallium/drivers/softpipe/sp_state_vertex.c
> +++ b/src/gallium/drivers/softpipe/sp_state_vertex.c
> @@ -45,7 +45,13 @@ softpipe_create_vertex_elements_state(struct pipe_context
> *pipe,
>                                        const struct pipe_vertex_element
> *attribs)
>  {
>     struct sp_velems_state *velems;
> +   unsigned i;
> +
>     assert(count <= PIPE_MAX_ATTRIBS);
> +   for (i = 0; i < count; i++) {
> +      assert(attribs[i].src_offset % 4 == 0);
> +   }
> +
>     velems = (struct sp_velems_state *) MALLOC(sizeof(struct
> sp_velems_state));
>     if (velems) {
>        velems->count = count;
>
>
> I'll wait for another review.  Thanks.
>
> -Brian
>


More information about the Piglit mailing list