This patch is Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
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 <sagar.gh...@intel.com> > --- > 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