Mesa (master): mesa: function for testing if current frag-shader has atomics
Martin Peres
mperes at kemper.freedesktop.org
Wed Jun 17 12:48:24 UTC 2015
Module: Mesa
Branch: master
Commit: bbb700967e9991a03ed6e8073c9bdc2ca0d1381d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bbb700967e9991a03ed6e8073c9bdc2ca0d1381d
Author: Kevin Rogovin <kevin.rogovin at intel.com>
Date: Wed Jun 17 13:29:56 2015 +0300
mesa: function for testing if current frag-shader has atomics
Add helper function that checks if current fragment shader active
of gl_context has atomic buffer access.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Signed-off-by: Kevin Rogovin <kevin.rogovin at intel.com>
---
src/mesa/main/mtypes.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a10e494..ffa7f0c 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -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
}
More information about the mesa-commit
mailing list