[Mesa-dev] [PATCH 10/40] mesa: Update viewport state for viewport_array

Kenneth Graunke kenneth at whitecape.org
Sat Jan 11 15:41:11 PST 2014


On 01/10/2014 05:40 PM, Ian Romanick wrote:
[snip]
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> index e5240b1..99b91d0 100644
> --- a/src/mesa/main/get.c
> +++ b/src/mesa/main/get.c
> @@ -113,6 +113,7 @@ enum value_type {
>     TYPE_FLOATN_3,
>     TYPE_FLOATN_4,
>     TYPE_DOUBLEN,
> +   TYPE_DOUBLEN_2,
>     TYPE_MATRIX,
>     TYPE_MATRIX_T,
>     TYPE_CONST
> @@ -161,6 +162,8 @@ struct value_desc {
>  union value {
>     GLfloat value_float;
>     GLfloat value_float_4[4];
> +   GLdouble value_double_2[2];
> +   GLdouble value_double_4[4];
>     GLmatrix *value_matrix;
>     GLint value_int;
>     GLint value_int_4[4];

This type of stuff probably belongs in a separate patch too...

> diff --git a/src/mesa/program/prog_statevars.c b/src/mesa/program/prog_statevars.c
> index 58e1f49..bc9b49f 100644
> --- a/src/mesa/program/prog_statevars.c
> +++ b/src/mesa/program/prog_statevars.c
> @@ -353,9 +353,10 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[],
>        ((int *)value)[0] = ctx->DrawBuffer->Visual.samples;
>        return;
>     case STATE_DEPTH_RANGE:
> -      value[0] = ctx->Viewport.Near;                     /* near       */
> -      value[1] = ctx->Viewport.Far;                      /* far        */
> -      value[2] = ctx->Viewport.Far - ctx->Viewport.Near; /* far - near */
> +      // TODO: Need a new query to get full viewport array?

A TODO comment gets added here (and C++ style...) and never removed
AFAICT.  Is there really something left to do here?

> +      value[0] = (GLfloat) ctx->ViewportArray[0].Near;                     /* near       */
> +      value[1] = (GLfloat) ctx->ViewportArray[0].Far;                      /* far        */
> +      value[2] = (GLfloat) ctx->ViewportArray[0].Far - ctx->ViewportArray[0].Near; /* far - near */
>        value[3] = 1.0;
>        return;
>     case STATE_FRAGMENT_PROGRAM:


More information about the mesa-dev mailing list