[Mesa-dev] [PATCH] i965: set VIEWPORT_BOUNDS_RANGE value depending of the supported OpenGL version

Kenneth Graunke kenneth at whitecape.org
Tue Mar 1 00:33:42 UTC 2016


On Friday, February 26, 2016 8:37:33 AM PST Samuel Iglesias Gonsálvez wrote:
> From ARB_viewport_array spec:
> 
> " * On GL3-capable hardware the VIEWPORT_BOUNDS_RANGE should be at least
>     [-16384, 16383].
>   * On GL4-capable hardware the VIEWPORT_BOUNDS_RANGE should be at least
>     [-32768, 32767]."
> 
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
>  src/mesa/drivers/dri/i965/brw_context.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/
i965/brw_context.c
> index 31b6b2a..1569992 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -687,10 +687,15 @@ brw_initialize_context_constants(struct brw_context 
*brw)
>        ctx->Const.MaxViewports = GEN6_NUM_VIEWPORTS;
>        ctx->Const.ViewportSubpixelBits = 0;
>  
> -      /* Cast to float before negating because MaxViewportWidth is 
unsigned.
> -       */
> -      ctx->Const.ViewportBounds.Min = -(float)ctx->Const.MaxViewportWidth;
> -      ctx->Const.ViewportBounds.Max = ctx->Const.MaxViewportWidth;
> +      if (brw->intelScreen->driScrnPriv->max_gl_core_version >= 40) {
> +         ctx->Const.ViewportBounds.Min = -32768;
> +         ctx->Const.ViewportBounds.Max = 32767;
> +      } else {
> +         /* Cast to float before negating because MaxViewportWidth is 
unsigned.
> +          */
> +         ctx->Const.ViewportBounds.Min = -(float)ctx-
>Const.MaxViewportWidth;
> +         ctx->Const.ViewportBounds.Max = ctx->Const.MaxViewportWidth;
> +      }
>     }
>  
>     /* ARB_gpu_shader5 */
> 

Shouldn't we just support a 32k x 32k viewport?  In other words, change
MaxViewportWidth/MaxViewportHeight?

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160229/4b45eb15/attachment.sig>


More information about the mesa-dev mailing list