mesa: function for testing if current frag-shader has atomics
authorKevin Rogovin <kevin.rogovin@intel.com>
Wed, 17 Jun 2015 10:29:56 +0000 (13:29 +0300)
committerMartin Peres <martin.peres@linux.intel.com>
Wed, 17 Jun 2015 11:39:03 +0000 (14:39 +0300)
Add helper function that checks if current fragment shader active
of gl_context has atomic buffer access.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kevin Rogovin <kevin.rogovin@intel.com>
src/mesa/main/mtypes.h

index a10e49434bc2751d40815856a48556dc89452f20..ffa7f0cd704bb655422e85917b8a2bc711f6609e 100644 (file)
@@ -4448,7 +4448,12 @@ enum _debug
    DEBUG_INCOMPLETE_FBO         = (1 << 3)
 };
 
-
+static inline bool
+_mesa_active_fragment_shader_has_atomic_ops(const struct gl_context *ctx)
+{
+   return ctx->Shader._CurrentFragmentProgram != NULL &&
+      ctx->Shader._CurrentFragmentProgram->NumAtomicBuffers > 0;
+}
 
 #ifdef __cplusplus
 }