i965/gen7: Expose ARB_shader_atomic_counters.
authorFrancisco Jerez <currojerez@riseup.net>
Sun, 20 Oct 2013 21:11:27 +0000 (14:11 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 7 Nov 2013 23:56:57 +0000 (15:56 -0800)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/intel_extensions.c

index 34b79311fe3708b236854d77bbf1456b6975ba4b..776d8b303e5f507e42e5bb02f55a6ec5d975949c 100644 (file)
@@ -443,6 +443,16 @@ brw_initialize_context_constants(struct brw_context *brw)
    ctx->Const.FragmentProgram.HighInt = ctx->Const.FragmentProgram.LowInt;
    ctx->Const.FragmentProgram.MediumInt = ctx->Const.FragmentProgram.LowInt;
 
+   if (brw->gen >= 7) {
+      ctx->Const.FragmentProgram.MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
+      ctx->Const.VertexProgram.MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
+      ctx->Const.GeometryProgram.MaxAtomicCounters = MAX_ATOMIC_COUNTERS;
+      ctx->Const.FragmentProgram.MaxAtomicBuffers = BRW_MAX_ABO;
+      ctx->Const.VertexProgram.MaxAtomicBuffers = BRW_MAX_ABO;
+      ctx->Const.GeometryProgram.MaxAtomicBuffers = BRW_MAX_ABO;
+      ctx->Const.MaxCombinedAtomicBuffers = 3 * BRW_MAX_ABO;
+   }
+
    /* Gen6 converts quads to polygon in beginning of 3D pipeline,
     * but we're not sure how it's actually done for vertex order,
     * that affect provoking vertex decision. Always use last vertex
index 7b592b5318410039531f5bbb31233cc2cd95c571..62c0b15c185728139227936f2ab4372b01a77e13 100644 (file)
@@ -243,4 +243,7 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Extensions.EXT_texture_compression_s3tc = true;
 
    ctx->Extensions.ANGLE_texture_compression_dxt = true;
+
+   if (brw->gen >= 7)
+      ctx->Extensions.ARB_shader_atomic_counters = true;
 }