[Mesa-dev] [PATCH v3 2/3] mesa: add INTEL_blackhole_render

Lionel Landwerlin lionel.g.landwerlin at intel.com
Fri Apr 27 16:07:12 UTC 2018


v2: Implement missing Enable/Disable (Emil)

v3: Drop unused NewIntelBlackholeRender (Ken)

v4: Bring back NewIntelBlackholeRender as i965 implementation uses it
    again (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/main/enable.c           | 14 ++++++++++++++
 src/mesa/main/extensions_table.h |  1 +
 src/mesa/main/mtypes.h           |  7 +++++++
 3 files changed, 22 insertions(+)

diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 7625a4c9577..978258390c1 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1127,6 +1127,16 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          ctx->Color.BlendCoherent = state;
          break;
 
+      case GL_BLACKHOLE_RENDER_INTEL:
+         if (!_mesa_has_INTEL_blackhole_render(ctx))
+            goto invalid_enum_error;
+         if (ctx->IntelBlackholeRender == state)
+            return;
+         FLUSH_VERTICES(ctx, 0);
+         ctx->NewDriverState |= ctx->DriverFlags.NewIntelBlackholeRender;
+         ctx->IntelBlackholeRender = state;
+         break;
+
       default:
          goto invalid_enum_error;
    }
@@ -1762,6 +1772,10 @@ _mesa_IsEnabled( GLenum cap )
          CHECK_EXTENSION(MESA_tile_raster_order);
          return ctx->TileRasterOrderIncreasingY;
 
+      case GL_BLACKHOLE_RENDER_INTEL:
+         CHECK_EXTENSION(INTEL_blackhole_render);
+         return ctx->IntelBlackholeRender;
+
       default:
          goto invalid_enum_error;
    }
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index aec17750d58..3c8d1cb4a79 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -308,6 +308,7 @@ EXT(IBM_texture_mirrored_repeat             , dummy_true
 
 EXT(INGR_blend_func_separate                , EXT_blend_func_separate                , GLL,  x ,  x ,  x , 1999)
 
+EXT(INTEL_blackhole_render                  , INTEL_blackhole_render                 ,  30,  30,  x , ES2, 2018)
 EXT(INTEL_conservative_rasterization        , INTEL_conservative_rasterization       ,  x , GLC,  x ,  31, 2013)
 EXT(INTEL_performance_query                 , INTEL_performance_query                , GLL, GLC,  x , ES2, 2013)
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b65e7b2c3c2..dd931834a8f 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4164,6 +4164,7 @@ struct gl_extensions
    GLboolean ATI_fragment_shader;
    GLboolean ATI_separate_stencil;
    GLboolean GREMEDY_string_marker;
+   GLboolean INTEL_blackhole_render;
    GLboolean INTEL_conservative_rasterization;
    GLboolean INTEL_performance_query;
    GLboolean KHR_blend_equation_advanced;
@@ -4491,6 +4492,11 @@ struct gl_driver_flags
 
    /** Shader constants (uniforms, program parameters, state constants) */
    uint64_t NewShaderConstants[MESA_SHADER_STAGES];
+
+   /**
+    * gl_context::IntelBlackholeRender
+    */
+   uint64_t NewIntelBlackholeRender;
 };
 
 struct gl_buffer_binding
@@ -4907,6 +4913,7 @@ struct gl_context
 
    GLboolean RasterDiscard;  /**< GL_RASTERIZER_DISCARD */
    GLboolean IntelConservativeRasterization; /**< GL_INTEL_CONSERVATIVE_RASTERIZATION */
+   GLboolean IntelBlackholeRender; /**< GL_INTEL_blackhole_render */
 
    /** Does glVertexAttrib(0) alias glVertex()? */
    bool _AttribZeroAliasesVertex;
-- 
2.17.0



More information about the mesa-dev mailing list