[Mesa-dev] [PATCH 4/4] st/mesa: add EXT_polygon_offset_clamp support

Ilia Mirkin imirkin at alum.mit.edu
Tue Dec 30 23:38:14 PST 2014


Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 docs/relnotes/10.5.0.html                   | 2 +-
 src/mesa/state_tracker/st_atom_rasterizer.c | 1 +
 src/mesa/state_tracker/st_extensions.c      | 5 +++++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/docs/relnotes/10.5.0.html b/docs/relnotes/10.5.0.html
index bf932d4..578db4f 100644
--- a/docs/relnotes/10.5.0.html
+++ b/docs/relnotes/10.5.0.html
@@ -47,7 +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_polygon_offset_clamp on i965, nv50, nvc0, r600, radeonsi, llvmpipe</li>
 <li>GL_EXT_texture_shared_exponent on freedreno</li>
 <li>GL_EXT_texture_snorm on freedreno</li>
 </ul>
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 606f19a..cceed42 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -155,6 +155,7 @@ static void update_raster_state( struct st_context *st )
       raster->offset_tri = ctx->Polygon.OffsetFill;
       raster->offset_units = ctx->Polygon.OffsetUnits;
       raster->offset_scale = ctx->Polygon.OffsetFactor;
+      raster->offset_clamp = ctx->Polygon.OffsetClamp;
    }
 
    raster->poly_smooth = ctx->Polygon.SmoothFlag;
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index e472b84..ea3b2ce 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -625,6 +625,11 @@ void st_init_extensions(struct pipe_screen *screen,
    extensions->OES_EGL_image_external = GL_TRUE;
    extensions->OES_draw_texture = GL_TRUE;
 
+   /* Actually this is a bit of a lie, but all Gallium drivers that support
+    * core contexts support this extension, so it should be safe to expose.
+    */
+   extensions->EXT_polygon_offset_clamp = GL_TRUE;
+
    /* Expose the extensions which directly correspond to gallium caps. */
    for (i = 0; i < Elements(cap_mapping); i++) {
       if (screen->get_param(screen, cap_mapping[i].cap)) {
-- 
2.0.5



More information about the mesa-dev mailing list