[Mesa-dev] [PATCH] mesa: add missing TYPE_DOUBLEN_2 cases in get.c

Jose Fonseca jfonseca at vmware.com
Tue Jan 21 07:35:23 PST 2014



----- Original Message -----
> The new TYPE_DOUBLEN_2 type was added in 0e60d850 but the code to
> return values of that type wasn't completed.
> 
> Fixes conform's default state test.  glGetFloatv(GL_DEPTH_RANGE)
> wasn't returning anything.
> 
> v2: remove stray 'break' statements.
> ---
>  src/mesa/main/get.c |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> index 2b1538d..16dce5b 100644
> --- a/src/mesa/main/get.c
> +++ b/src/mesa/main/get.c
> @@ -1247,6 +1247,8 @@ _mesa_GetBooleanv(GLenum pname, GLboolean *params)
>        params[0] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[0]);
>        break;
>  
> +   case TYPE_DOUBLEN_2:
> +      params[1] = FLOAT_TO_BOOLEAN(((GLdouble *) p)[1]);
>     case TYPE_DOUBLEN:
>        params[0] = FLOAT_TO_BOOLEAN(((GLdouble *) p)[0]);
>        break;
> @@ -1333,6 +1335,8 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params)
>        params[0] = ((GLfloat *) p)[0];
>        break;
>  
> +   case TYPE_DOUBLEN_2:
> +      params[1] = (GLfloat) (((GLdouble *) p)[1]);
>     case TYPE_DOUBLEN:
>        params[0] = (GLfloat) (((GLdouble *) p)[0]);
>        break;
> @@ -1425,6 +1429,8 @@ _mesa_GetIntegerv(GLenum pname, GLint *params)
>        params[0] = FLOAT_TO_INT(((GLfloat *) p)[0]);
>        break;
>  
> +   case TYPE_DOUBLEN_2:
> +      params[1] = FLOAT_TO_INT(((GLdouble *) p)[1]);
>     case TYPE_DOUBLEN:
>        params[0] = FLOAT_TO_INT(((GLdouble *) p)[0]);
>        break;
> @@ -1517,6 +1523,8 @@ _mesa_GetInteger64v(GLenum pname, GLint64 *params)
>        params[0] = FLOAT_TO_INT64(((GLfloat *) p)[0]);
>        break;
>  
> +   case TYPE_DOUBLEN_2:
> +      params[1] = FLOAT_TO_INT64(((GLdouble *) p)[1]);
>     case TYPE_DOUBLEN:
>        params[0] = FLOAT_TO_INT64(((GLdouble *) p)[0]);
>        break;
> @@ -1603,6 +1611,8 @@ _mesa_GetDoublev(GLenum pname, GLdouble *params)
>        params[0] = ((GLfloat *) p)[0];
>        break;
>  
> +   case TYPE_DOUBLEN_2:
> +      params[1] = ((GLdouble *) p)[1];
>     case TYPE_DOUBLEN:
>        params[0] = ((GLdouble *) p)[0];
>        break;
> @@ -2201,6 +2211,8 @@ _mesa_GetFixedv(GLenum pname, GLfixed *params)
>        params[0] = FLOAT_TO_FIXED(((GLfloat *) p)[0]);
>        break;
>  
> +   case TYPE_DOUBLEN_2:
> +      params[1] = FLOAT_TO_FIXED(((GLdouble *) p)[1]);
>     case TYPE_DOUBLEN:
>        params[0] = FLOAT_TO_FIXED(((GLdouble *) p)[0]);
>        break;
> --
> 1.7.10.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/mesa-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=eARcwRJAmPaT8kXkxR6%2BuMsjAbMYT1YhKDdkUUOT250%3D%0A&s=445c781ff67a848c71a447821a42fbcb962b87daefe55f5c00582310e8a85d51
> 

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>


More information about the mesa-dev mailing list