[Mesa-dev] [PATCH 1/2] glsl: Properly count doubles as taking twice the number of attrib slots.

Dave Airlie airlied at gmail.com
Tue Sep 1 16:19:19 PDT 2015


On 2 September 2015 at 08:57, Matt Turner <mattst88 at gmail.com> wrote:
> ---
> I checked the uses of count_attribute_slots() and it looks like they're
> expecting this already, but these two patches definitely need testing on
> a driver that supports fp64.
>
Don't think so,

As Ilia said they can count as storage for 2, but only one location, I
believe this function
is used in enough place to count locations.

Dave.

>  src/glsl/glsl_types.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
> index 755618a..cd7fef5 100644
> --- a/src/glsl/glsl_types.cpp
> +++ b/src/glsl/glsl_types.cpp
> @@ -1386,9 +1386,11 @@ glsl_type::count_attribute_slots() const
>     case GLSL_TYPE_INT:
>     case GLSL_TYPE_FLOAT:
>     case GLSL_TYPE_BOOL:
> -   case GLSL_TYPE_DOUBLE:
>        return this->matrix_columns;
>
> +   case GLSL_TYPE_DOUBLE:
> +      return this->matrix_columns * 2;
> +
>     case GLSL_TYPE_STRUCT:
>     case GLSL_TYPE_INTERFACE: {
>        unsigned size = 0;
> --
> 2.4.6
>


More information about the mesa-dev mailing list