Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6732>
#include "util/debug.h"
#include "c11/threads.h"
-uint64_t INTEL_DEBUG = 0;
+uint64_t intel_debug = 0;
static const struct debug_control debug_control[] = {
{ "tex", DEBUG_TEXTURE},
static void
brw_process_intel_debug_variable_once(void)
{
- INTEL_DEBUG = parse_debug_string(getenv("INTEL_DEBUG"), debug_control);
+ intel_debug = parse_debug_string(getenv("INTEL_DEBUG"), debug_control);
}
void
#include <stdint.h>
#include "compiler/shader_enums.h"
+#include "util/macros.h"
#ifdef __cplusplus
extern "C" {
* list of debugging flags, as well as some macros for handling them.
*/
-extern uint64_t INTEL_DEBUG;
+extern uint64_t intel_debug;
+
+#define INTEL_DEBUG __builtin_expect(intel_debug, 0)
#define DEBUG_TEXTURE (1ull << 0)
#define DEBUG_STATE (1ull << 1)
if ((INTEL_DEBUG & DEBUG_SHADER_TIME) && devinfo->gen < 7) {
fprintf(stderr,
"shader_time debugging requires gen7 (Ivybridge) or better.\n");
- INTEL_DEBUG &= ~DEBUG_SHADER_TIME;
+ intel_debug &= ~DEBUG_SHADER_TIME;
}
if (intel_get_integer(screen, I915_PARAM_MMAP_GTT_VERSION) >= 1) {