[Mesa-dev] [PATCH 03/45] mesa/st: Handle 16-bit types at st_glsl_attrib_type_size

Eduardo Lima Mitev elima at igalia.com
Thu Aug 17 07:00:01 UTC 2017


On 08/15/2017 10:57 PM, Jason Ekstrand wrote:
> 
> On Fri, Jul 14, 2017 at 10:27 AM, Marek Olšák <maraeo at gmail.com
> <mailto:maraeo at gmail.com>> wrote:
> 
>     Can you move these cases to the end where the assertion is?
> 
> 
> Agreed.  In general, I think it's best to let 16-bit types hit
> assertions in any code paths that won't be exercised by 16bit_storage. 
> Assertion failures are much easier to find than subtle bugs when someone
> comes through and hooks it up for GL.
> 

I also agree with that in general, but in the particular case below I
thought it was safe adding them there.

I fixed it locally and will be included in the V2 series we are planing
to send soon.

Thanks!

Eduardo

> --Jason
>  
> 
>     Thanks,
>     Marek
> 
>     On Thu, Jul 13, 2017 at 4:35 PM, Alejandro Piñeiro
>     <apinheiro at igalia.com <mailto:apinheiro at igalia.com>> wrote:
>     > From: Eduardo Lima Mitev <elima at igalia.com <mailto:elima at igalia.com>>
>     >
>     > Note that this doesn't mean full support on st for those types. This
>     > change was done to avoid a "not handle in switch" warning.
>     > ---
>     >  src/mesa/state_tracker/st_glsl_types.cpp | 3 +++
>     >  1 file changed, 3 insertions(+)
>     >
>     > diff --git a/src/mesa/state_tracker/st_glsl_types.cpp
>     b/src/mesa/state_tracker/st_glsl_types.cpp
>     > index 37c3164..02cd63d 100644
>     > --- a/src/mesa/state_tracker/st_glsl_types.cpp
>     > +++ b/src/mesa/state_tracker/st_glsl_types.cpp
>     > @@ -38,7 +38,10 @@ st_glsl_attrib_type_size(const struct glsl_type
>     *type, bool is_vs_input)
>     >     switch (type->base_type) {
>     >     case GLSL_TYPE_UINT:
>     >     case GLSL_TYPE_INT:
>     > +   case GLSL_TYPE_UINT16:
>     > +   case GLSL_TYPE_INT16:
>     >     case GLSL_TYPE_FLOAT:
>     > +   case GLSL_TYPE_HALF_FLOAT:
>     >     case GLSL_TYPE_BOOL:
>     >        if (type->is_matrix()) {
>     >           return type->matrix_columns;
>     > --
>     > 2.9.3
>     >
>     > _______________________________________________
>     > mesa-dev mailing list
>     > mesa-dev at lists.freedesktop.org <mailto:mesa-dev at lists.freedesktop.org>
>     > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>     <https://lists.freedesktop.org/mailman/listinfo/mesa-dev>
>     _______________________________________________
>     mesa-dev mailing list
>     mesa-dev at lists.freedesktop.org <mailto:mesa-dev at lists.freedesktop.org>
>     https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>     <https://lists.freedesktop.org/mailman/listinfo/mesa-dev>
> 
> 
> 
> 
> _______________________________________________
> 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