i965/gen6+: enable EXT_polygon_offset_clamp
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 31 Dec 2014 07:15:23 +0000 (02:15 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 3 Feb 2015 01:35:36 +0000 (20:35 -0500)
Replace the hard-coded 0's with the context clamp value.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
docs/relnotes/10.5.0.html
src/mesa/drivers/dri/i965/gen6_sf_state.c
src/mesa/drivers/dri/i965/gen7_sf_state.c
src/mesa/drivers/dri/i965/gen8_sf_state.c
src/mesa/drivers/dri/i965/intel_extensions.c

index 4f921ea4d5c058deac08ea30bbb96ea0a0d190c6..bf932d4a4ae199349e5004d88ab5ec277065e36d 100644 (file)
@@ -47,6 +47,7 @@ Note: some of the new features are only available with certain drivers.
 <li>GL_ARB_framebuffer_sRGB on freedreno</li>
 <li>GL_ARB_texture_rg on freedreno</li>
 <li>GL_EXT_packed_float on freedreno</li>
+<li>GL_EXT_polygon_offset_clamp on i965</li>
 <li>GL_EXT_texture_shared_exponent on freedreno</li>
 <li>GL_EXT_texture_snorm on freedreno</li>
 </ul>
index fc73c572da725bdf468cc17b7b3eaeabfc742d28..7f0bab86c55b3795ccef0e105acc77247c5c77a8 100644 (file)
@@ -427,7 +427,7 @@ upload_sf_state(struct brw_context *brw)
    OUT_BATCH(dw4);
    OUT_BATCH_F(ctx->Polygon.OffsetUnits * 2); /* constant.  copied from gen4 */
    OUT_BATCH_F(ctx->Polygon.OffsetFactor); /* scale */
-   OUT_BATCH_F(0.0); /* XXX: global depth offset clamp */
+   OUT_BATCH_F(ctx->Polygon.OffsetClamp); /* global depth offset clamp */
    for (i = 0; i < 8; i++) {
       OUT_BATCH(attr_overrides[i * 2] | attr_overrides[i * 2 + 1] << 16);
    }
index b9838470c64997fc74d9d1e6fb944b26de40c2a5..6644010ca1b053ad4daf4b35246b9d217b624f3a 100644 (file)
@@ -242,7 +242,7 @@ upload_sf_state(struct brw_context *brw)
    OUT_BATCH(dw3);
    OUT_BATCH_F(ctx->Polygon.OffsetUnits * 2); /* constant.  copied from gen4 */
    OUT_BATCH_F(ctx->Polygon.OffsetFactor); /* scale */
-   OUT_BATCH_F(0.0); /* XXX: global depth offset clamp */
+   OUT_BATCH_F(ctx->Polygon.OffsetClamp); /* global depth offset clamp */
    ADVANCE_BATCH();
 }
 
index 0e514c610100f4e77c92d9a399bc39e42a6d709c..713ee5f93a0e30cacdf2460cf3621d08686b1bed 100644 (file)
@@ -314,7 +314,7 @@ upload_raster(struct brw_context *brw)
    OUT_BATCH(dw1);
    OUT_BATCH_F(ctx->Polygon.OffsetUnits * 2); /* constant.  copied from gen4 */
    OUT_BATCH_F(ctx->Polygon.OffsetFactor); /* scale */
-   OUT_BATCH_F(0.0);
+   OUT_BATCH_F(ctx->Polygon.OffsetClamp); /* global depth offset clamp */
    ADVANCE_BATCH();
 }
 
index 2187e734017f3161758e30935082de329cf28a91..4dacfd09429005a1ce800cf2ceea5642a8dee566 100644 (file)
@@ -285,6 +285,7 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Extensions.ARB_texture_gather = true;
       ctx->Extensions.ARB_conditional_render_inverted = true;
       ctx->Extensions.AMD_vertex_shader_layer = true;
+      ctx->Extensions.EXT_polygon_offset_clamp = true;
 
       /* Test if the kernel has the ioctl. */
       if (drm_intel_reg_read(brw->bufmgr, TIMESTAMP, &dummy) == 0)