Re: [Mesa-dev] [PATCH] mesa: don't clamp just based on ARB_viewport_array extension

2018-02-14 Thread Marek Olšák
Pushed, thanks!

Marek

On Thu, Feb 15, 2018 at 1:12 AM, Gurchetan Singh
 wrote:
> On Wed, Feb 14, 2018 at 3:57 PM, Marek Olšák  wrote:
>> Do you have commit access?
>
> No, would appreciate a merge ;-)
>
>> Marek
>>
>> On Thu, Feb 15, 2018 at 12:40 AM, gurchetansi...@chromium.org
>>  wrote:
>>> From: Gurchetan Singh 
>>>
>>> The ARB_viewport_array spec says:
>>>
>>> "Dependencies
>>> OpenGL 1.0 is required.
>>>
>>> OpenGL 3.2 or the EXT_geometry_shader4 or ARB_geometry_shader4 
>>> extensions
>>> are required.
>>>
>>> This extension is written against the OpenGL 3.2 (Compatibility)
>>> Specification."
>>>
>>> As such, we should ignore it for GLES2 contexts.
>>>
>>> Fixes:
>>> dEQP-GLES2.functional.state_query.integers.viewport_getinteger
>>> dEQP-GLES2.functional.state_query.integers.viewport_getfloat
>>>
>>> on llvmpipe and virgl.
>>>
>>> v2: Use _mesa_has_* (Ilia)
>>> ---
>>>  src/mesa/main/viewport.c | 5 ++---
>>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
>>> index fc384909e6..398cc63685 100644
>>> --- a/src/mesa/main/viewport.c
>>> +++ b/src/mesa/main/viewport.c
>>> @@ -51,9 +51,8 @@ clamp_viewport(struct gl_context *ctx, GLfloat *x, 
>>> GLfloat *y,
>>>  * determined by calling GetFloatv with the symbolic constant
>>>  * VIEWPORT_BOUNDS_RANGE (see section 6.1)."
>>>  */
>>> -   if (ctx->Extensions.ARB_viewport_array ||
>>> -   (ctx->Extensions.OES_viewport_array &&
>>> -_mesa_is_gles31(ctx))) {
>>> +   if (_mesa_has_ARB_viewport_array(ctx) ||
>>> +   _mesa_has_OES_viewport_array(ctx)) {
>>>*x = CLAMP(*x,
>>>   ctx->Const.ViewportBounds.Min, 
>>> ctx->Const.ViewportBounds.Max);
>>>*y = CLAMP(*y,
>>> --
>>> 2.13.5
>>>
>>> ___
>>> mesa-dev mailing list
>>> mesa-dev@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: don't clamp just based on ARB_viewport_array extension

2018-02-14 Thread Gurchetan Singh
On Wed, Feb 14, 2018 at 3:57 PM, Marek Olšák  wrote:
> Do you have commit access?

No, would appreciate a merge ;-)

> Marek
>
> On Thu, Feb 15, 2018 at 12:40 AM, gurchetansi...@chromium.org
>  wrote:
>> From: Gurchetan Singh 
>>
>> The ARB_viewport_array spec says:
>>
>> "Dependencies
>> OpenGL 1.0 is required.
>>
>> OpenGL 3.2 or the EXT_geometry_shader4 or ARB_geometry_shader4 extensions
>> are required.
>>
>> This extension is written against the OpenGL 3.2 (Compatibility)
>> Specification."
>>
>> As such, we should ignore it for GLES2 contexts.
>>
>> Fixes:
>> dEQP-GLES2.functional.state_query.integers.viewport_getinteger
>> dEQP-GLES2.functional.state_query.integers.viewport_getfloat
>>
>> on llvmpipe and virgl.
>>
>> v2: Use _mesa_has_* (Ilia)
>> ---
>>  src/mesa/main/viewport.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
>> index fc384909e6..398cc63685 100644
>> --- a/src/mesa/main/viewport.c
>> +++ b/src/mesa/main/viewport.c
>> @@ -51,9 +51,8 @@ clamp_viewport(struct gl_context *ctx, GLfloat *x, GLfloat 
>> *y,
>>  * determined by calling GetFloatv with the symbolic constant
>>  * VIEWPORT_BOUNDS_RANGE (see section 6.1)."
>>  */
>> -   if (ctx->Extensions.ARB_viewport_array ||
>> -   (ctx->Extensions.OES_viewport_array &&
>> -_mesa_is_gles31(ctx))) {
>> +   if (_mesa_has_ARB_viewport_array(ctx) ||
>> +   _mesa_has_OES_viewport_array(ctx)) {
>>*x = CLAMP(*x,
>>   ctx->Const.ViewportBounds.Min, 
>> ctx->Const.ViewportBounds.Max);
>>*y = CLAMP(*y,
>> --
>> 2.13.5
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: don't clamp just based on ARB_viewport_array extension

2018-02-14 Thread Marek Olšák
Do you have commit access?

Marek

On Thu, Feb 15, 2018 at 12:40 AM, gurchetansi...@chromium.org
 wrote:
> From: Gurchetan Singh 
>
> The ARB_viewport_array spec says:
>
> "Dependencies
> OpenGL 1.0 is required.
>
> OpenGL 3.2 or the EXT_geometry_shader4 or ARB_geometry_shader4 extensions
> are required.
>
> This extension is written against the OpenGL 3.2 (Compatibility)
> Specification."
>
> As such, we should ignore it for GLES2 contexts.
>
> Fixes:
> dEQP-GLES2.functional.state_query.integers.viewport_getinteger
> dEQP-GLES2.functional.state_query.integers.viewport_getfloat
>
> on llvmpipe and virgl.
>
> v2: Use _mesa_has_* (Ilia)
> ---
>  src/mesa/main/viewport.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
> index fc384909e6..398cc63685 100644
> --- a/src/mesa/main/viewport.c
> +++ b/src/mesa/main/viewport.c
> @@ -51,9 +51,8 @@ clamp_viewport(struct gl_context *ctx, GLfloat *x, GLfloat 
> *y,
>  * determined by calling GetFloatv with the symbolic constant
>  * VIEWPORT_BOUNDS_RANGE (see section 6.1)."
>  */
> -   if (ctx->Extensions.ARB_viewport_array ||
> -   (ctx->Extensions.OES_viewport_array &&
> -_mesa_is_gles31(ctx))) {
> +   if (_mesa_has_ARB_viewport_array(ctx) ||
> +   _mesa_has_OES_viewport_array(ctx)) {
>*x = CLAMP(*x,
>   ctx->Const.ViewportBounds.Min, 
> ctx->Const.ViewportBounds.Max);
>*y = CLAMP(*y,
> --
> 2.13.5
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: don't clamp just based on ARB_viewport_array extension

2018-02-14 Thread Ilia Mirkin
On Wed, Feb 14, 2018 at 6:22 PM, gurchetansi...@chromium.org
 wrote:
> From: Gurchetan Singh 
>
> The ARB_viewport_array spec says:
>
> "Dependencies
> OpenGL 1.0 is required.
>
> OpenGL 3.2 or the EXT_geometry_shader4 or ARB_geometry_shader4 extensions
> are required.
>
> This extension is written against the OpenGL 3.2 (Compatibility)
> Specification."
>
> As such, we should ignore it for GLES2 contexts.
>
> Fixes:
> dEQP-GLES2.functional.state_query.integers.viewport_getinteger
> dEQP-GLES2.functional.state_query.integers.viewport_getfloat
>
> on llvmpipe and virgl.
> ---
>  src/mesa/main/viewport.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
> index fc384909e6..380372772e 100644
> --- a/src/mesa/main/viewport.c
> +++ b/src/mesa/main/viewport.c
> @@ -51,9 +51,8 @@ clamp_viewport(struct gl_context *ctx, GLfloat *x, GLfloat 
> *y,
>  * determined by calling GetFloatv with the symbolic constant
>  * VIEWPORT_BOUNDS_RANGE (see section 6.1)."
>  */
> -   if (ctx->Extensions.ARB_viewport_array ||
> -   (ctx->Extensions.OES_viewport_array &&
> -_mesa_is_gles31(ctx))) {
> +   if ((ctx->Extensions.ARB_viewport_array && !_mesa_is_gles(ctx)) ||
> +   (ctx->Extensions.OES_viewport_array && _mesa_is_gles31(ctx))) {

I think you're looking for

_mesa_has_ARB_viewport_array(ctx) ||
_mesa_has_OES_viewport_array(ctx)

which will get all these little details "right". I do hope drivers are
ready for this.

>*x = CLAMP(*x,
>   ctx->Const.ViewportBounds.Min, 
> ctx->Const.ViewportBounds.Max);
>*y = CLAMP(*y,
> --
> 2.13.5
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: don't clamp just based on ARB_viewport_array extension

2018-02-14 Thread Marek Olšák
Reviewed-by: Marek Olšák 

Marek

On Thu, Feb 15, 2018 at 12:22 AM, gurchetansi...@chromium.org
 wrote:
> From: Gurchetan Singh 
>
> The ARB_viewport_array spec says:
>
> "Dependencies
> OpenGL 1.0 is required.
>
> OpenGL 3.2 or the EXT_geometry_shader4 or ARB_geometry_shader4 extensions
> are required.
>
> This extension is written against the OpenGL 3.2 (Compatibility)
> Specification."
>
> As such, we should ignore it for GLES2 contexts.
>
> Fixes:
> dEQP-GLES2.functional.state_query.integers.viewport_getinteger
> dEQP-GLES2.functional.state_query.integers.viewport_getfloat
>
> on llvmpipe and virgl.
> ---
>  src/mesa/main/viewport.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
> index fc384909e6..380372772e 100644
> --- a/src/mesa/main/viewport.c
> +++ b/src/mesa/main/viewport.c
> @@ -51,9 +51,8 @@ clamp_viewport(struct gl_context *ctx, GLfloat *x, GLfloat 
> *y,
>  * determined by calling GetFloatv with the symbolic constant
>  * VIEWPORT_BOUNDS_RANGE (see section 6.1)."
>  */
> -   if (ctx->Extensions.ARB_viewport_array ||
> -   (ctx->Extensions.OES_viewport_array &&
> -_mesa_is_gles31(ctx))) {
> +   if ((ctx->Extensions.ARB_viewport_array && !_mesa_is_gles(ctx)) ||
> +   (ctx->Extensions.OES_viewport_array && _mesa_is_gles31(ctx))) {
>*x = CLAMP(*x,
>   ctx->Const.ViewportBounds.Min, 
> ctx->Const.ViewportBounds.Max);
>*y = CLAMP(*y,
> --
> 2.13.5
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev