[Mesa-dev] [PATCH] mesa: use uint32_t rather than unsigned for xfb struct members

Jason Ekstrand jason at jlekstrand.net
Fri Sep 30 23:53:36 UTC 2016


Seems reasonable. I'm generally a fan of explicitly sized types anyway. R-B

On Sep 30, 2016 4:20 PM, "Timothy Arceri" <timothy.arceri at collabora.com>
wrote:

> These structs will be written to disk as part of the shader cache
> so use uint32_t just to be safe.
> ---
>  src/mesa/main/mtypes.h | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index d1b0560..efcd50e 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -1643,40 +1643,40 @@ struct gl_transform_feedback_varying_info
>   */
>  struct gl_transform_feedback_output
>  {
> -   unsigned OutputRegister;
> -   unsigned OutputBuffer;
> -   unsigned NumComponents;
> -   unsigned StreamId;
> +   uint32_t OutputRegister;
> +   uint32_t OutputBuffer;
> +   uint32_t NumComponents;
> +   uint32_t StreamId;
>
>     /** offset (in DWORDs) of this output within the interleaved structure
> */
> -   unsigned DstOffset;
> +   uint32_t DstOffset;
>
>     /**
>      * Offset into the output register of the data to output.  For example,
>      * if NumComponents is 2 and ComponentOffset is 1, then the data to
>      * offset is in the y and z components of the output register.
>      */
> -   unsigned ComponentOffset;
> +   uint32_t ComponentOffset;
>  };
>
>
>  struct gl_transform_feedback_buffer
>  {
> -   unsigned Binding;
> +   uint32_t Binding;
>
> -   unsigned NumVaryings;
> +   uint32_t NumVaryings;
>
>     /**
>      * Total number of components stored in each buffer.  This may be used
> by
>      * hardware back-ends to determine the correct stride when interleaving
>      * multiple transform feedback outputs in the same buffer.
>      */
> -   unsigned Stride;
> +   uint32_t Stride;
>
>     /**
>      * Which transform feedback stream this buffer binding is associated
> with.
>      */
> -   unsigned Stream;
> +   uint32_t Stream;
>  };
>
>
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160930/c945d44d/attachment-0001.html>


More information about the mesa-dev mailing list