Re: [Mesa-dev] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-20 Thread Ian Romanick
On 08/20/2018 04:02 PM, Marek Olšák wrote:
> I wouldn't add _DepthClamp. Having just DepthClampNear and
> DepthClampFar should be enough. Drivers not supporting the extension
> can use either variable, because they will be equal.
> 
> The glGet query can be handled as LOC_CUSTOM.

Yeah, that works for me.

> Marek
> 
> On Sun, Aug 19, 2018 at 6:43 PM Sagar Ghuge  wrote:
>>
>>
>>
>> On 08/13/2018 03:52 PM, Ian Romanick wrote:
>>> On 08/09/2018 01:09 PM, Marek Olšák wrote:
 On Wed, Aug 1, 2018 at 11:31 PM, Sagar Ghuge  wrote:
> enable _mesa_PushAttrib() and _mesa_PopAttrib()
> to handle GL_DEPTH_CLAMP_NEAR_AMD and
> GL_DEPTH_CLAMP_FAR_AMD tokens.
>
> Signed-off-by: Sagar Ghuge 
> ---
>  src/mesa/main/attrib.c | 16 
>  1 file changed, 16 insertions(+)
>
> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
> index cbe93ab6fa..d9f165b428 100644
> --- a/src/mesa/main/attrib.c
> +++ b/src/mesa/main/attrib.c
> @@ -73,6 +73,8 @@ struct gl_enable_attrib
> GLboolean ColorMaterial;
> GLboolean CullFace;
> GLboolean DepthClamp;
> +   GLboolean DepthClampNear;
> +   GLboolean DepthClampFar;

 The first patch uses this. Also, DepthClamp can be removed, because
 DepthClampNear+Far replace it, right?
>>>
>>> Based on your comment on patch 4 and my comments on patch 0, maybe we
>>> should:
>>>
>>> - Remove DepthClamp.  Add _DepthClamp, DepthClampNear, and DepthClampFar.
>>
>> I might be missing some pieces. But DepthClampNear + far can replaces
>> DepthClamp. so why do we need _DepthClamp ? (Adding _DepthClamp means
>> it will be derived from DepthClampNear+far, correct ? removing DepthClamp
>> here means, need to completely get rid of every reference of
>> DepthClamp in source code? )
>>
>>>
>>> - If GL_DEPTH_CLAMP is set, set all three.  If GL_DEPTH_CLAMP is
>>> cleared, clear all three.
>>>
>>> - If either of GL_DEPTH_CLAMP_FAR_AMD or GL_DEPTH_CLAMP_NEAR_AMD
>>> changes, change _DepthClamp to DepthClampNear || DepthClampFar.
>>>
>>
>> We only need to handle this case - "Querying DEPTH_CLAMP will return TRUE if 
>> DEPTH_CLAMP_NEAR_AMD _or_
>> DEPTH_CLAMP_FAR_AMD is enabled."
>> I think we don't have to keep changing _DepthClamp, because if we do it
>> then it will enable depth clamping for both the planes and will get 
>> different behavior.
>> Please correct me if I am wrong or missing anything.
>>
>>> - Drivers that enable AMD_depth_clamp_separate will only ever look at
>>> DepthClampNear and DepthClampFar.
>>>
>>> I think that gets all the cases correct with the minimum fuss.  Marek,
>>> what do you think?
>>>
 Marek
 ___
 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] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-20 Thread Marek Olšák
I wouldn't add _DepthClamp. Having just DepthClampNear and
DepthClampFar should be enough. Drivers not supporting the extension
can use either variable, because they will be equal.

The glGet query can be handled as LOC_CUSTOM.

Marek

On Sun, Aug 19, 2018 at 6:43 PM Sagar Ghuge  wrote:
>
>
>
> On 08/13/2018 03:52 PM, Ian Romanick wrote:
> > On 08/09/2018 01:09 PM, Marek Olšák wrote:
> >> On Wed, Aug 1, 2018 at 11:31 PM, Sagar Ghuge  wrote:
> >>> enable _mesa_PushAttrib() and _mesa_PopAttrib()
> >>> to handle GL_DEPTH_CLAMP_NEAR_AMD and
> >>> GL_DEPTH_CLAMP_FAR_AMD tokens.
> >>>
> >>> Signed-off-by: Sagar Ghuge 
> >>> ---
> >>>  src/mesa/main/attrib.c | 16 
> >>>  1 file changed, 16 insertions(+)
> >>>
> >>> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
> >>> index cbe93ab6fa..d9f165b428 100644
> >>> --- a/src/mesa/main/attrib.c
> >>> +++ b/src/mesa/main/attrib.c
> >>> @@ -73,6 +73,8 @@ struct gl_enable_attrib
> >>> GLboolean ColorMaterial;
> >>> GLboolean CullFace;
> >>> GLboolean DepthClamp;
> >>> +   GLboolean DepthClampNear;
> >>> +   GLboolean DepthClampFar;
> >>
> >> The first patch uses this. Also, DepthClamp can be removed, because
> >> DepthClampNear+Far replace it, right?
> >
> > Based on your comment on patch 4 and my comments on patch 0, maybe we
> > should:
> >
> > - Remove DepthClamp.  Add _DepthClamp, DepthClampNear, and DepthClampFar.
>
> I might be missing some pieces. But DepthClampNear + far can replaces
> DepthClamp. so why do we need _DepthClamp ? (Adding _DepthClamp means
> it will be derived from DepthClampNear+far, correct ? removing DepthClamp
> here means, need to completely get rid of every reference of
> DepthClamp in source code? )
>
> >
> > - If GL_DEPTH_CLAMP is set, set all three.  If GL_DEPTH_CLAMP is
> > cleared, clear all three.
> >
> > - If either of GL_DEPTH_CLAMP_FAR_AMD or GL_DEPTH_CLAMP_NEAR_AMD
> > changes, change _DepthClamp to DepthClampNear || DepthClampFar.
> >
>
> We only need to handle this case - "Querying DEPTH_CLAMP will return TRUE if 
> DEPTH_CLAMP_NEAR_AMD _or_
> DEPTH_CLAMP_FAR_AMD is enabled."
> I think we don't have to keep changing _DepthClamp, because if we do it
> then it will enable depth clamping for both the planes and will get different 
> behavior.
> Please correct me if I am wrong or missing anything.
>
> > - Drivers that enable AMD_depth_clamp_separate will only ever look at
> > DepthClampNear and DepthClampFar.
> >
> > I think that gets all the cases correct with the minimum fuss.  Marek,
> > what do you think?
> >
> >> Marek
> >> ___
> >> 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] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-20 Thread Sagar Ghuge


On 08/13/2018 03:52 PM, Ian Romanick wrote:
> On 08/09/2018 01:09 PM, Marek Olšák wrote:
>> On Wed, Aug 1, 2018 at 11:31 PM, Sagar Ghuge  wrote:
>>> enable _mesa_PushAttrib() and _mesa_PopAttrib()
>>> to handle GL_DEPTH_CLAMP_NEAR_AMD and
>>> GL_DEPTH_CLAMP_FAR_AMD tokens.
>>>
>>> Signed-off-by: Sagar Ghuge 
>>> ---
>>>  src/mesa/main/attrib.c | 16 
>>>  1 file changed, 16 insertions(+)
>>>
>>> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
>>> index cbe93ab6fa..d9f165b428 100644
>>> --- a/src/mesa/main/attrib.c
>>> +++ b/src/mesa/main/attrib.c
>>> @@ -73,6 +73,8 @@ struct gl_enable_attrib
>>> GLboolean ColorMaterial;
>>> GLboolean CullFace;
>>> GLboolean DepthClamp;
>>> +   GLboolean DepthClampNear;
>>> +   GLboolean DepthClampFar;
>>
>> The first patch uses this. Also, DepthClamp can be removed, because
>> DepthClampNear+Far replace it, right?
> 
> Based on your comment on patch 4 and my comments on patch 0, maybe we
> should:
> 
> - Remove DepthClamp.  Add _DepthClamp, DepthClampNear, and DepthClampFar.

I might be missing some pieces. But DepthClampNear + far can replaces 
DepthClamp. so why do we need _DepthClamp ? (Adding _DepthClamp means 
it will be derived from DepthClampNear+far, correct ? removing DepthClamp
here means, need to completely get rid of every reference of 
DepthClamp in source code? ) 

> 
> - If GL_DEPTH_CLAMP is set, set all three.  If GL_DEPTH_CLAMP is
> cleared, clear all three.
> 
> - If either of GL_DEPTH_CLAMP_FAR_AMD or GL_DEPTH_CLAMP_NEAR_AMD
> changes, change _DepthClamp to DepthClampNear || DepthClampFar.
> 

We only need to handle this case - "Querying DEPTH_CLAMP will return TRUE if 
DEPTH_CLAMP_NEAR_AMD _or_
DEPTH_CLAMP_FAR_AMD is enabled." 
I think we don't have to keep changing _DepthClamp, because if we do it
then it will enable depth clamping for both the planes and will get different 
behavior.
Please correct me if I am wrong or missing anything. 

> - Drivers that enable AMD_depth_clamp_separate will only ever look at
> DepthClampNear and DepthClampFar.
> 
> I think that gets all the cases correct with the minimum fuss.  Marek,
> what do you think?
> 
>> Marek
>> ___
>> 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] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-14 Thread Sagar Ghuge


On 08/13/2018 03:43 PM, Ian Romanick wrote:
> On 08/09/2018 01:14 PM, Sagar Ghuge wrote:
>>
>>
>> On 08/09/2018 01:09 PM, Marek Olšák wrote:
>>> On Wed, Aug 1, 2018 at 11:31 PM, Sagar Ghuge  wrote:
 enable _mesa_PushAttrib() and _mesa_PopAttrib()
 to handle GL_DEPTH_CLAMP_NEAR_AMD and
 GL_DEPTH_CLAMP_FAR_AMD tokens.

 Signed-off-by: Sagar Ghuge 
 ---
  src/mesa/main/attrib.c | 16 
  1 file changed, 16 insertions(+)

 diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
 index cbe93ab6fa..d9f165b428 100644
 --- a/src/mesa/main/attrib.c
 +++ b/src/mesa/main/attrib.c
 @@ -73,6 +73,8 @@ struct gl_enable_attrib
 GLboolean ColorMaterial;
 GLboolean CullFace;
 GLboolean DepthClamp;
 +   GLboolean DepthClampNear;
 +   GLboolean DepthClampFar;
>>>
>>> The first patch uses this. Also, DepthClamp can be removed, because
>>> DepthClampNear+Far replace it, right?
>>
>> Yes, that's true. 
> 
> Since this is your first significant patch series... we have an
> unwritten (maybe actually written somewhere?) rule that a patch series
> should build at every commit.  If a patch in the middle of a series
> doesn't build, doing git-bisect on a (possibly unrelated) later problem
> can be very painful.
> 

Okay, I will make sure that when I send
new patch series it should build on every commit. 

>>> Marek
>>>
>> ___
>> 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] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-13 Thread Ian Romanick
On 08/09/2018 01:09 PM, Marek Olšák wrote:
> On Wed, Aug 1, 2018 at 11:31 PM, Sagar Ghuge  wrote:
>> enable _mesa_PushAttrib() and _mesa_PopAttrib()
>> to handle GL_DEPTH_CLAMP_NEAR_AMD and
>> GL_DEPTH_CLAMP_FAR_AMD tokens.
>>
>> Signed-off-by: Sagar Ghuge 
>> ---
>>  src/mesa/main/attrib.c | 16 
>>  1 file changed, 16 insertions(+)
>>
>> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
>> index cbe93ab6fa..d9f165b428 100644
>> --- a/src/mesa/main/attrib.c
>> +++ b/src/mesa/main/attrib.c
>> @@ -73,6 +73,8 @@ struct gl_enable_attrib
>> GLboolean ColorMaterial;
>> GLboolean CullFace;
>> GLboolean DepthClamp;
>> +   GLboolean DepthClampNear;
>> +   GLboolean DepthClampFar;
> 
> The first patch uses this. Also, DepthClamp can be removed, because
> DepthClampNear+Far replace it, right?

Based on your comment on patch 4 and my comments on patch 0, maybe we
should:

- Remove DepthClamp.  Add _DepthClamp, DepthClampNear, and DepthClampFar.

- If GL_DEPTH_CLAMP is set, set all three.  If GL_DEPTH_CLAMP is
cleared, clear all three.

- If either of GL_DEPTH_CLAMP_FAR_AMD or GL_DEPTH_CLAMP_NEAR_AMD
changes, change _DepthClamp to DepthClampNear || DepthClampFar.

- Drivers that enable AMD_depth_clamp_separate will only ever look at
DepthClampNear and DepthClampFar.

I think that gets all the cases correct with the minimum fuss.  Marek,
what do you think?

> Marek
> ___
> 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] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-13 Thread Ian Romanick
On 08/09/2018 01:14 PM, Sagar Ghuge wrote:
> 
> 
> On 08/09/2018 01:09 PM, Marek Olšák wrote:
>> On Wed, Aug 1, 2018 at 11:31 PM, Sagar Ghuge  wrote:
>>> enable _mesa_PushAttrib() and _mesa_PopAttrib()
>>> to handle GL_DEPTH_CLAMP_NEAR_AMD and
>>> GL_DEPTH_CLAMP_FAR_AMD tokens.
>>>
>>> Signed-off-by: Sagar Ghuge 
>>> ---
>>>  src/mesa/main/attrib.c | 16 
>>>  1 file changed, 16 insertions(+)
>>>
>>> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
>>> index cbe93ab6fa..d9f165b428 100644
>>> --- a/src/mesa/main/attrib.c
>>> +++ b/src/mesa/main/attrib.c
>>> @@ -73,6 +73,8 @@ struct gl_enable_attrib
>>> GLboolean ColorMaterial;
>>> GLboolean CullFace;
>>> GLboolean DepthClamp;
>>> +   GLboolean DepthClampNear;
>>> +   GLboolean DepthClampFar;
>>
>> The first patch uses this. Also, DepthClamp can be removed, because
>> DepthClampNear+Far replace it, right?
> 
> Yes, that's true. 

Since this is your first significant patch series... we have an
unwritten (maybe actually written somewhere?) rule that a patch series
should build at every commit.  If a patch in the middle of a series
doesn't build, doing git-bisect on a (possibly unrelated) later problem
can be very painful.

>> Marek
>>
> ___
> 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] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-09 Thread Sagar Ghuge


On 08/09/2018 01:09 PM, Marek Olšák wrote:
> On Wed, Aug 1, 2018 at 11:31 PM, Sagar Ghuge  wrote:
>> enable _mesa_PushAttrib() and _mesa_PopAttrib()
>> to handle GL_DEPTH_CLAMP_NEAR_AMD and
>> GL_DEPTH_CLAMP_FAR_AMD tokens.
>>
>> Signed-off-by: Sagar Ghuge 
>> ---
>>  src/mesa/main/attrib.c | 16 
>>  1 file changed, 16 insertions(+)
>>
>> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
>> index cbe93ab6fa..d9f165b428 100644
>> --- a/src/mesa/main/attrib.c
>> +++ b/src/mesa/main/attrib.c
>> @@ -73,6 +73,8 @@ struct gl_enable_attrib
>> GLboolean ColorMaterial;
>> GLboolean CullFace;
>> GLboolean DepthClamp;
>> +   GLboolean DepthClampNear;
>> +   GLboolean DepthClampFar;
> 
> The first patch uses this. Also, DepthClamp can be removed, because
> DepthClampNear+Far replace it, right?

Yes, that's true. 

> 
> Marek
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-09 Thread Marek Olšák
On Wed, Aug 1, 2018 at 11:31 PM, Sagar Ghuge  wrote:
> enable _mesa_PushAttrib() and _mesa_PopAttrib()
> to handle GL_DEPTH_CLAMP_NEAR_AMD and
> GL_DEPTH_CLAMP_FAR_AMD tokens.
>
> Signed-off-by: Sagar Ghuge 
> ---
>  src/mesa/main/attrib.c | 16 
>  1 file changed, 16 insertions(+)
>
> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
> index cbe93ab6fa..d9f165b428 100644
> --- a/src/mesa/main/attrib.c
> +++ b/src/mesa/main/attrib.c
> @@ -73,6 +73,8 @@ struct gl_enable_attrib
> GLboolean ColorMaterial;
> GLboolean CullFace;
> GLboolean DepthClamp;
> +   GLboolean DepthClampNear;
> +   GLboolean DepthClampFar;

The first patch uses this. Also, DepthClamp can be removed, because
DepthClampNear+Far replace it, right?

Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-02 Thread Ian Romanick
This patch is

Reviewed-by: Ian Romanick 

On 08/01/2018 08:31 PM, Sagar Ghuge wrote:
> enable _mesa_PushAttrib() and _mesa_PopAttrib()
> to handle GL_DEPTH_CLAMP_NEAR_AMD and
> GL_DEPTH_CLAMP_FAR_AMD tokens.
> 
> Signed-off-by: Sagar Ghuge 
> ---
>  src/mesa/main/attrib.c | 16 
>  1 file changed, 16 insertions(+)
> 
> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
> index cbe93ab6fa..d9f165b428 100644
> --- a/src/mesa/main/attrib.c
> +++ b/src/mesa/main/attrib.c
> @@ -73,6 +73,8 @@ struct gl_enable_attrib
> GLboolean ColorMaterial;
> GLboolean CullFace;
> GLboolean DepthClamp;
> +   GLboolean DepthClampNear;
> +   GLboolean DepthClampFar;
> GLboolean DepthTest;
> GLboolean Dither;
> GLboolean Fog;
> @@ -337,6 +339,8 @@ _mesa_PushAttrib(GLbitfield mask)
>attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
>attr->CullFace = ctx->Polygon.CullFlag;
>attr->DepthClamp = ctx->Transform.DepthClamp;
> +  attr->DepthClampNear = ctx->Transform.DepthClampNear;
> +  attr->DepthClampFar = ctx->Transform.DepthClampFar;
>attr->DepthTest = ctx->Depth.Test;
>attr->Dither = ctx->Color.DitherFlag;
>attr->Fog = ctx->Fog.Enabled;
> @@ -629,6 +633,10 @@ pop_enable_group(struct gl_context *ctx, const struct 
> gl_enable_attrib *enable)
> TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
> TEST_AND_UPDATE(ctx->Transform.DepthClamp, enable->DepthClamp,
> GL_DEPTH_CLAMP);
> +   TEST_AND_UPDATE(ctx->Transform.DepthClampNear, enable->DepthClampNear,
> +   GL_DEPTH_CLAMP_NEAR_AMD);
> +   TEST_AND_UPDATE(ctx->Transform.DepthClampFar, enable->DepthClampFar,
> +   GL_DEPTH_CLAMP_FAR_AMD);
> TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
> TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
> TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
> @@ -1150,6 +1158,8 @@ _mesa_PopAttrib(void)
>ctx->DriverFlags.NewClipPlaneEnable |
>ctx->DriverFlags.NewDepth |
>ctx->DriverFlags.NewDepthClamp |
> +  ctx->DriverFlags.NewDepthClampNear |
> +  ctx->DriverFlags.NewDepthClampFar |
>ctx->DriverFlags.NewFramebufferSRGB |
>ctx->DriverFlags.NewLineState |
>ctx->DriverFlags.NewLogicOp |
> @@ -1436,6 +1446,12 @@ _mesa_PopAttrib(void)
> if (xform->DepthClamp != ctx->Transform.DepthClamp)
>_mesa_set_enable(ctx, GL_DEPTH_CLAMP,
> ctx->Transform.DepthClamp);
> +   if (xform->DepthClampNear != ctx->Transform.DepthClampNear)
> +  _mesa_set_enable(ctx, GL_DEPTH_CLAMP_NEAR_AMD,
> +   ctx->Transform.DepthClampNear);
> +   if (xform->DepthClampFar != ctx->Transform.DepthClampFar)
> +  _mesa_set_enable(ctx, GL_DEPTH_CLAMP_FAR_AMD,
> +   ctx->Transform.DepthClampFar);
> if (ctx->Extensions.ARB_clip_control)
>_mesa_ClipControl(xform->ClipOrigin, xform->ClipDepthMode);
>  }
> 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [RFC][PATCH 3/5] mesa: Add support for AMD_depth_clamp_separate

2018-08-01 Thread Sagar Ghuge
enable _mesa_PushAttrib() and _mesa_PopAttrib()
to handle GL_DEPTH_CLAMP_NEAR_AMD and
GL_DEPTH_CLAMP_FAR_AMD tokens.

Signed-off-by: Sagar Ghuge 
---
 src/mesa/main/attrib.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index cbe93ab6fa..d9f165b428 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -73,6 +73,8 @@ struct gl_enable_attrib
GLboolean ColorMaterial;
GLboolean CullFace;
GLboolean DepthClamp;
+   GLboolean DepthClampNear;
+   GLboolean DepthClampFar;
GLboolean DepthTest;
GLboolean Dither;
GLboolean Fog;
@@ -337,6 +339,8 @@ _mesa_PushAttrib(GLbitfield mask)
   attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
   attr->CullFace = ctx->Polygon.CullFlag;
   attr->DepthClamp = ctx->Transform.DepthClamp;
+  attr->DepthClampNear = ctx->Transform.DepthClampNear;
+  attr->DepthClampFar = ctx->Transform.DepthClampFar;
   attr->DepthTest = ctx->Depth.Test;
   attr->Dither = ctx->Color.DitherFlag;
   attr->Fog = ctx->Fog.Enabled;
@@ -629,6 +633,10 @@ pop_enable_group(struct gl_context *ctx, const struct 
gl_enable_attrib *enable)
TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
TEST_AND_UPDATE(ctx->Transform.DepthClamp, enable->DepthClamp,
GL_DEPTH_CLAMP);
+   TEST_AND_UPDATE(ctx->Transform.DepthClampNear, enable->DepthClampNear,
+   GL_DEPTH_CLAMP_NEAR_AMD);
+   TEST_AND_UPDATE(ctx->Transform.DepthClampFar, enable->DepthClampFar,
+   GL_DEPTH_CLAMP_FAR_AMD);
TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
@@ -1150,6 +1158,8 @@ _mesa_PopAttrib(void)
   ctx->DriverFlags.NewClipPlaneEnable |
   ctx->DriverFlags.NewDepth |
   ctx->DriverFlags.NewDepthClamp |
+  ctx->DriverFlags.NewDepthClampNear |
+  ctx->DriverFlags.NewDepthClampFar |
   ctx->DriverFlags.NewFramebufferSRGB |
   ctx->DriverFlags.NewLineState |
   ctx->DriverFlags.NewLogicOp |
@@ -1436,6 +1446,12 @@ _mesa_PopAttrib(void)
if (xform->DepthClamp != ctx->Transform.DepthClamp)
   _mesa_set_enable(ctx, GL_DEPTH_CLAMP,
ctx->Transform.DepthClamp);
+   if (xform->DepthClampNear != ctx->Transform.DepthClampNear)
+  _mesa_set_enable(ctx, GL_DEPTH_CLAMP_NEAR_AMD,
+   ctx->Transform.DepthClampNear);
+   if (xform->DepthClampFar != ctx->Transform.DepthClampFar)
+  _mesa_set_enable(ctx, GL_DEPTH_CLAMP_FAR_AMD,
+   ctx->Transform.DepthClampFar);
if (ctx->Extensions.ARB_clip_control)
   _mesa_ClipControl(xform->ClipOrigin, xform->ClipDepthMode);
 }
-- 
2.17.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev