treewide: Replace usage of macro DEBUG with MESA_DEBUG when possible
This is achieved by the following steps: #ifndef DEBUG => #if !MESA_DEBUG defined(DEBUG) => MESA_DEBUG #ifdef DEBUG => #if MESA_DEBUG This is done by replace in vscode excludes docs,*.rs,addrlib,src/imgui,*.sh,src/intel/vulkan/grl/gpu These are safe because those files should keep DEBUG macro is already excluded; and not directly replace DEBUG, as we have some symbols around it. Use debug or NDEBUG instead of DEBUG in comments when proper This for reduce the usage of DEBUG, so it's easier migrating to MESA_DEBUG These are found when migrating DEBUG to MESA_DEBUG, these are all comment update, so it's safe Replace comment /* DEBUG */ and /* !DEBUG */ with proper /* MESA_DEBUG */ or /* !MESA_DEBUG */ manually DEBUG || !NDEBUG -> MESA_DEBUG || !NDEBUG !DEBUG && NDEBUG -> !(MESA_DEBUG || !NDEBUG) Replace the DEBUG present in comment with proper new MESA_DEBUG manually Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: David Heidelberg <david.heidelberg@collabora.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28092>
This commit is contained in:
@@ -397,7 +397,7 @@ qpu_validate(struct v3d_compile *c)
|
||||
* keep compiling the validation code to make sure it doesn't get
|
||||
* broken.
|
||||
*/
|
||||
#ifndef DEBUG
|
||||
#if !MESA_DEBUG
|
||||
return;
|
||||
#endif
|
||||
|
||||
|
@@ -2170,7 +2170,7 @@ try_opt_ldunif(struct v3d_compile *c, uint32_t index, struct qreg *unif)
|
||||
struct qinst *prev_inst = NULL;
|
||||
assert(c->cur_block);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* We can only reuse a uniform if it was emitted in the same block,
|
||||
* so callers must make sure the current instruction is being emitted
|
||||
* in the current block.
|
||||
|
@@ -1808,7 +1808,7 @@ v3dv_CreateDevice(VkPhysicalDevice physicalDevice,
|
||||
perf_debug("Device created with Robust Image Access enabled.\n");
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
v3dv_X(device, device_check_prepacked_sizes)();
|
||||
#endif
|
||||
init_device_meta(device);
|
||||
|
@@ -104,7 +104,7 @@
|
||||
#include "wsi_common.h"
|
||||
|
||||
/* A non-fatal assert. Useful for debugging. */
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
#define v3dv_assert(x) ({ \
|
||||
if (unlikely(!(x))) \
|
||||
fprintf(stderr, "%s:%d ASSERT: %s", __FILE__, __LINE__, #x); \
|
||||
|
@@ -615,7 +615,7 @@ v3dv_write_uniforms_wg_offsets(struct v3dv_cmd_buffer *cmd_buffer,
|
||||
} else {
|
||||
assert(cmd_buffer->vk.level == VK_COMMAND_BUFFER_LEVEL_SECONDARY);
|
||||
num_layers = 2048;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
fprintf(stderr, "Skipping gl_LayerID shader sanity check for "
|
||||
"secondary command buffer\n");
|
||||
#endif
|
||||
|
@@ -387,7 +387,7 @@ v3dX(get_hw_clear_color)(const VkClearColorValue *color,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
void
|
||||
v3dX(device_check_prepacked_sizes)(void)
|
||||
{
|
||||
|
@@ -152,7 +152,7 @@ v3dX(framebuffer_compute_internal_bpp_msaa)(const struct v3dv_framebuffer *frame
|
||||
uint8_t *total_color_bpp,
|
||||
bool *msaa);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
void
|
||||
v3dX(device_check_prepacked_sizes)(void);
|
||||
#endif
|
||||
|
@@ -643,7 +643,7 @@ private:
|
||||
* If the name length fits into name_storage, it's used, otherwise
|
||||
* the name is ralloc'd. shader-db mining showed that 70% of variables
|
||||
* fit here. This is a win over ralloc where only ralloc_header has
|
||||
* 20 bytes on 64-bit (28 bytes with DEBUG), and we can also skip malloc.
|
||||
* 20 bytes on 64-bit (28 bytes with debug), and we can also skip malloc.
|
||||
*/
|
||||
char name_storage[16];
|
||||
|
||||
|
@@ -1247,7 +1247,7 @@ validate_ir_tree(exec_list *instructions)
|
||||
* and it's half composed of assert()s anyway which wouldn't do
|
||||
* anything.
|
||||
*/
|
||||
#ifndef DEBUG
|
||||
#if !MESA_DEBUG
|
||||
if (!debug_get_bool_option("GLSL_VALIDATE", false))
|
||||
return;
|
||||
#endif
|
||||
|
@@ -172,7 +172,7 @@ find_output(nir_shader *shader, unsigned drvloc)
|
||||
nir_def *new_def = find_output_in_block(block, drvloc);
|
||||
assert(!(new_def && def));
|
||||
def = new_def;
|
||||
#if !defined(DEBUG)
|
||||
#if !MESA_DEBUG
|
||||
/* for debug builds, scan entire shader to assert
|
||||
* if output is written multiple times. For release
|
||||
* builds just assume all is well and bail when we
|
||||
|
@@ -53,7 +53,7 @@ extern "C" {
|
||||
#include "target-helpers/inline_sw_helper.h"
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
#define TRACE(x...) printf("egl_haiku: " x)
|
||||
#define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__)
|
||||
#else
|
||||
|
@@ -466,8 +466,8 @@ _eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria)
|
||||
}
|
||||
|
||||
if (!matched) {
|
||||
#ifndef DEBUG
|
||||
/* only print the common errors when DEBUG is not defined */
|
||||
#if !MESA_DEBUG
|
||||
/* only print the common errors when MESA_DEBUG is defined to 0 */
|
||||
if (attr != EGL_RENDERABLE_TYPE)
|
||||
break;
|
||||
#endif
|
||||
|
@@ -504,7 +504,7 @@ struct ir3_block *
|
||||
ir3_block_create(struct ir3 *shader)
|
||||
{
|
||||
struct ir3_block *block = ir3_alloc(shader, sizeof(*block));
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
block->serialno = ++shader->block_count;
|
||||
#endif
|
||||
block->shader = shader;
|
||||
@@ -633,7 +633,7 @@ instr_create(struct ir3_block *block, opc_t opc, int ndst, int nsrc)
|
||||
instr->dsts = (struct ir3_register **)ptr;
|
||||
instr->srcs = instr->dsts + ndst;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
instr->dsts_max = ndst;
|
||||
instr->srcs_max = nsrc;
|
||||
#endif
|
||||
@@ -737,7 +737,7 @@ struct ir3_register *
|
||||
ir3_src_create(struct ir3_instruction *instr, int num, int flags)
|
||||
{
|
||||
struct ir3 *shader = instr->block->shader;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
assert(instr->srcs_count < instr->srcs_max);
|
||||
#endif
|
||||
struct ir3_register *reg = reg_create(shader, num, flags);
|
||||
@@ -749,7 +749,7 @@ struct ir3_register *
|
||||
ir3_dst_create(struct ir3_instruction *instr, int num, int flags)
|
||||
{
|
||||
struct ir3 *shader = instr->block->shader;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
assert(instr->dsts_count < instr->dsts_max);
|
||||
#endif
|
||||
struct ir3_register *reg = reg_create(shader, num, flags);
|
||||
|
@@ -354,7 +354,7 @@ struct ir3_instruction {
|
||||
BITMASK_ENUM(ir3_instruction_flags) flags;
|
||||
uint8_t repeat;
|
||||
uint8_t nop;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
unsigned srcs_max, dsts_max;
|
||||
#endif
|
||||
unsigned srcs_count, dsts_count;
|
||||
@@ -582,7 +582,7 @@ struct ir3 {
|
||||
/* List of ir3_array's: */
|
||||
struct list_head array_list;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
unsigned block_count;
|
||||
#endif
|
||||
unsigned instr_count;
|
||||
@@ -669,7 +669,7 @@ struct ir3_block {
|
||||
uint32_t loop_id;
|
||||
uint32_t loop_depth;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
uint32_t serialno;
|
||||
#endif
|
||||
};
|
||||
@@ -677,7 +677,7 @@ struct ir3_block {
|
||||
static inline uint32_t
|
||||
block_id(struct ir3_block *block)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
return block->serialno;
|
||||
#else
|
||||
return (uint32_t)(unsigned long)block;
|
||||
|
@@ -49,8 +49,8 @@ static const struct debug_named_value shader_debug_options[] = {
|
||||
{"nopreamble", IR3_DBG_NOPREAMBLE, "Disable the preamble pass"},
|
||||
{"fullsync", IR3_DBG_FULLSYNC, "Add (sy) + (ss) after each cat5/cat6"},
|
||||
{"fullnop", IR3_DBG_FULLNOP, "Add nops before each instruction"},
|
||||
#ifdef DEBUG
|
||||
/* DEBUG-only options: */
|
||||
#if MESA_DEBUG
|
||||
/* MESA_DEBUG-only options: */
|
||||
{"schedmsgs", IR3_DBG_SCHEDMSGS, "Enable scheduler debug messages"},
|
||||
{"ramsgs", IR3_DBG_RAMSGS, "Enable register-allocation debug messages"},
|
||||
#endif
|
||||
|
@@ -317,7 +317,7 @@ enum ir3_shader_debug {
|
||||
IR3_DBG_FULLSYNC = BITFIELD_BIT(15),
|
||||
IR3_DBG_FULLNOP = BITFIELD_BIT(16),
|
||||
|
||||
/* DEBUG-only options: */
|
||||
/* MESA_DEBUG-only options: */
|
||||
IR3_DBG_SCHEDMSGS = BITFIELD_BIT(20),
|
||||
IR3_DBG_RAMSGS = BITFIELD_BIT(21),
|
||||
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include "ir3_compiler.h"
|
||||
#include "ir3_context.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
#define SCHED_DEBUG (ir3_shader_debug & IR3_DBG_SCHEDMSGS)
|
||||
#else
|
||||
#define SCHED_DEBUG 0
|
||||
|
@@ -72,7 +72,7 @@ print_instr_name(struct log_stream *stream, struct ir3_instruction *instr,
|
||||
{
|
||||
if (!instr)
|
||||
return;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
mesa_log_stream_printf(stream, "%04u:", instr->serialno);
|
||||
#endif
|
||||
mesa_log_stream_printf(stream, "%04u:", instr->ip);
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "ir3.h"
|
||||
#include "ir3_compiler.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
#define RA_DEBUG (ir3_shader_debug & IR3_DBG_RAMSGS)
|
||||
#else
|
||||
#define RA_DEBUG 0
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#include "ir3.h"
|
||||
#include "ir3_compiler.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
#define SCHED_DEBUG (ir3_shader_debug & IR3_DBG_SCHEDMSGS)
|
||||
#else
|
||||
#define SCHED_DEBUG 0
|
||||
|
@@ -489,7 +489,7 @@ static void
|
||||
tu_bo_set_kernel_name(struct tu_device *dev, struct tu_bo *bo, const char *name)
|
||||
{
|
||||
bool kernel_bo_names = dev->bo_sizes != NULL;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
kernel_bo_names = true;
|
||||
#endif
|
||||
if (!kernel_bo_names)
|
||||
|
@@ -534,7 +534,7 @@ static void
|
||||
tu_bo_set_kernel_name(struct tu_device *dev, struct tu_bo *bo, const char *name)
|
||||
{
|
||||
bool kernel_bo_names = dev->bo_sizes != NULL;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
kernel_bo_names = true;
|
||||
#endif
|
||||
if (!kernel_bo_names)
|
||||
|
@@ -173,7 +173,7 @@ TAG(do_cliptest)(struct pt_post_vs *pvs,
|
||||
position[2] = position[2] * w * scale[2] + trans[2];
|
||||
position[3] = w;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* For debug builds, set the clipped vertex's window coordinate
|
||||
* to NaN to help catch potential errors later.
|
||||
*/
|
||||
|
@@ -245,7 +245,7 @@ draw_pipeline_run(struct draw_context *draw,
|
||||
start += prim_info->primitive_lengths[i], i++) {
|
||||
const unsigned count = prim_info->primitive_lengths[i];
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* Warn if one of the element indexes go outside the vertex buffer */
|
||||
{
|
||||
unsigned max_index = 0x0;
|
||||
|
@@ -334,7 +334,7 @@ generate_aaline_fs(struct aaline_stage *aaline)
|
||||
if (!aaline_fs.tokens)
|
||||
return false;
|
||||
|
||||
#if 0 /* DEBUG */
|
||||
#if 0 /* debug */
|
||||
debug_printf("draw_aaline, orig shader:\n");
|
||||
tgsi_dump(orig_fs->tokens, 0);
|
||||
debug_printf("draw_aaline, new shader:\n");
|
||||
|
@@ -387,7 +387,7 @@ generate_aapoint_fs(struct aapoint_stage *aapoint)
|
||||
if (!aapoint_fs.tokens)
|
||||
return false;
|
||||
|
||||
#if 0 /* DEBUG */
|
||||
#if 0 /* debug */
|
||||
debug_printf("draw_aapoint, orig shader:\n");
|
||||
tgsi_dump(orig_fs->tokens, 0);
|
||||
debug_printf("draw_aapoint, new shader:\n");
|
||||
|
@@ -73,7 +73,7 @@ static inline struct trace_context *
|
||||
trace_context(struct pipe_context *pipe)
|
||||
{
|
||||
assert(pipe);
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
trace_context_check(pipe);
|
||||
#endif
|
||||
return (struct trace_context *)pipe;
|
||||
|
@@ -62,7 +62,7 @@ extern unsigned gallivm_debug;
|
||||
static inline void
|
||||
lp_build_name(LLVMValueRef val, const char *format, ...)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
char name[32];
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
|
@@ -76,7 +76,7 @@ static const struct debug_named_value lp_bld_debug_flags[] = {
|
||||
{ "perf", GALLIVM_DEBUG_PERF, NULL },
|
||||
{ "gc", GALLIVM_DEBUG_GC, NULL },
|
||||
/* Don't allow setting DUMP_BC for release builds, since writing the files may be an issue with setuid. */
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
{ "dumpbc", GALLIVM_DEBUG_DUMP_BC, NULL },
|
||||
#endif
|
||||
DEBUG_NAMED_VALUE_END
|
||||
@@ -525,7 +525,7 @@ gallivm_verify_function(struct gallivm_state *gallivm,
|
||||
LLVMValueRef func)
|
||||
{
|
||||
/* Verify the LLVM IR. If invalid, dump and abort */
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (LLVMVerifyFunction(func, LLVMPrintMessageAction)) {
|
||||
lp_debug_dump_value(func);
|
||||
assert(0);
|
||||
@@ -634,7 +634,7 @@ gallivm_compile_module(struct gallivm_state *gallivm)
|
||||
|
||||
/* Disable frame pointer omission on debug/profile builds */
|
||||
/* XXX: And workaround http://llvm.org/PR21435 */
|
||||
#if defined(DEBUG) || defined(PROFILE) || DETECT_ARCH_X86 || DETECT_ARCH_X86_64
|
||||
#if MESA_DEBUG || defined(PROFILE) || DETECT_ARCH_X86 || DETECT_ARCH_X86_64
|
||||
LLVMAddTargetDependentFunctionAttr(func, "no-frame-pointer-elim", "true");
|
||||
LLVMAddTargetDependentFunctionAttr(func, "no-frame-pointer-elim-non-leaf", "true");
|
||||
#endif
|
||||
|
@@ -130,7 +130,7 @@ static void init_native_targets()
|
||||
llvm::InitializeNativeTargetAsmPrinter();
|
||||
|
||||
llvm::InitializeNativeTargetDisassembler();
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
{
|
||||
char *env_llc_options = getenv("GALLIVM_LLC_OPTIONS");
|
||||
if (env_llc_options) {
|
||||
|
@@ -91,7 +91,7 @@ lp_build_array_get_ptr2(struct gallivm_state *gallivm,
|
||||
indices[0] = lp_build_const_int32(gallivm, 0);
|
||||
indices[1] = index;
|
||||
element_ptr = LLVMBuildGEP2(gallivm->builder, array_type, ptr, indices, ARRAY_SIZE(indices), "");
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
lp_build_name(element_ptr, "&%s[%s]", LLVMGetValueName(ptr), LLVMGetValueName(index));
|
||||
#endif
|
||||
return element_ptr;
|
||||
@@ -111,7 +111,7 @@ lp_build_array_get2(struct gallivm_state *gallivm,
|
||||
element_ptr = lp_build_array_get_ptr2(gallivm, array_type, ptr, index);
|
||||
LLVMTypeRef element_type = LLVMGetElementType(array_type);
|
||||
res = LLVMBuildLoad2(gallivm->builder, element_type, element_ptr, "");
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
lp_build_name(res, "%s[%s]", LLVMGetValueName(ptr), LLVMGetValueName(index));
|
||||
#endif
|
||||
return res;
|
||||
@@ -131,7 +131,7 @@ lp_build_pointer_get_unaligned2(LLVMBuilderRef builder,
|
||||
res = LLVMBuildLoad2(builder, ptr_type, element_ptr, "");
|
||||
if (alignment)
|
||||
LLVMSetAlignment(res, alignment);
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
lp_build_name(res, "%s[%s]", LLVMGetValueName(ptr), LLVMGetValueName(index));
|
||||
#endif
|
||||
return res;
|
||||
|
@@ -196,7 +196,7 @@ fenced_buffer_copy_storage_to_cpu_locked(struct fenced_buffer *fenced_buf);
|
||||
static void
|
||||
fenced_manager_dump_locked(struct fenced_manager *fenced_mgr)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
struct pb_fence_ops *ops = fenced_mgr->ops;
|
||||
struct list_head *curr, *next;
|
||||
struct fenced_buffer *fenced_buf;
|
||||
@@ -987,7 +987,7 @@ fenced_bufmgr_destroy(struct pb_manager *mgr)
|
||||
;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* assert(!fenced_mgr->num_unfenced); */
|
||||
#endif
|
||||
|
||||
|
@@ -46,7 +46,7 @@
|
||||
#include "pb_bufmgr.h"
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
|
||||
|
||||
#define PB_DEBUG_CREATE_BACKTRACE 8
|
||||
@@ -483,7 +483,7 @@ pb_debug_manager_create(struct pb_manager *provider,
|
||||
}
|
||||
|
||||
|
||||
#else /* !DEBUG */
|
||||
#else /* !MESA_DEBUG */
|
||||
|
||||
|
||||
struct pb_manager *
|
||||
@@ -494,4 +494,4 @@ pb_debug_manager_create(struct pb_manager *provider,
|
||||
}
|
||||
|
||||
|
||||
#endif /* !DEBUG */
|
||||
#endif /* MESA_DEBUG */
|
||||
|
@@ -411,7 +411,7 @@ static void
|
||||
micro_exp2(union tgsi_exec_channel *dst,
|
||||
const union tgsi_exec_channel *src)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* Inf is okay for this instruction, so clamp it to silence assertions. */
|
||||
unsigned i;
|
||||
union tgsi_exec_channel clamped;
|
||||
@@ -426,7 +426,7 @@ micro_exp2(union tgsi_exec_channel *dst,
|
||||
}
|
||||
}
|
||||
src = &clamped;
|
||||
#endif /* DEBUG */
|
||||
#endif /* MESA_DEBUG */
|
||||
|
||||
dst->f[0] = powf(2.0f, src->f[0]);
|
||||
dst->f[1] = powf(2.0f, src->f[1]);
|
||||
@@ -973,7 +973,7 @@ static const union tgsi_exec_channel M128Vec = {
|
||||
{-128.0f, -128.0f, -128.0f, -128.0f}
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
static void
|
||||
print_chan(const char *msg, const union tgsi_exec_channel *chan)
|
||||
{
|
||||
@@ -983,7 +983,7 @@ print_chan(const char *msg, const union tgsi_exec_channel *chan)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
static void
|
||||
print_temp(const struct tgsi_exec_machine *mach, unsigned index)
|
||||
{
|
||||
@@ -1233,7 +1233,7 @@ tgsi_exec_machine_create(enum pipe_shader_type shader_type)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* silence warnings */
|
||||
(void) print_chan;
|
||||
(void) print_temp;
|
||||
|
@@ -2144,7 +2144,7 @@ const struct tgsi_token *ureg_finalize( struct ureg_program *ureg )
|
||||
tgsi_dump( tokens, 0 );
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* tgsi_sanity doesn't seem to return if there are too many constants. */
|
||||
bool too_many_constants = false;
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(ureg->const_decls); i++) {
|
||||
|
@@ -54,7 +54,7 @@ struct util_cache_entry
|
||||
void *key;
|
||||
void *value;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
unsigned count;
|
||||
#endif
|
||||
};
|
||||
@@ -212,7 +212,7 @@ util_cache_set(struct util_cache *cache,
|
||||
|
||||
util_cache_entry_destroy(cache, entry);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
++entry->count;
|
||||
#endif
|
||||
|
||||
@@ -288,7 +288,7 @@ util_cache_destroy(struct util_cache *cache)
|
||||
if (!cache)
|
||||
return;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (cache->count >= 20*cache->size) {
|
||||
/* Normal approximation of the Poisson distribution */
|
||||
double mean = (double)cache->count/(double)cache->size;
|
||||
@@ -340,7 +340,7 @@ util_cache_remove(struct util_cache *cache,
|
||||
static void
|
||||
ensure_sanity(const struct util_cache *cache)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
unsigned i, cnt = 0;
|
||||
|
||||
assert(cache);
|
||||
|
@@ -37,7 +37,7 @@
|
||||
* @author Thomas Hellstrom <thellstrom@vmware.com>
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
#include "util/compiler.h"
|
||||
#include "util/simple_mtx.h"
|
||||
#include "util/u_debug_stack.h"
|
||||
|
@@ -36,7 +36,7 @@
|
||||
*
|
||||
* @author Thomas Hellstrom <thellstrom@vmware.com>
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
|
||||
#ifndef U_DEBUG_FLUSH_H_
|
||||
#define U_DEBUG_FLUSH_H_
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
|
||||
/**
|
||||
* Dump an image to .ppm file.
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include "util/format/u_formats.h"
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
struct pipe_context;
|
||||
struct pipe_surface;
|
||||
struct pipe_transfer;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#if defined(DEBUG)
|
||||
#if MESA_DEBUG
|
||||
|
||||
/**
|
||||
* If the GALLIUM_REFCNT_LOG env var is defined as a filename, gallium
|
||||
@@ -188,4 +188,4 @@ debug_reference_slowpath(const struct pipe_reference *p,
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* DEBUG */
|
||||
#endif /* MESA_DEBUG */
|
||||
|
@@ -36,7 +36,7 @@ extern "C" {
|
||||
|
||||
typedef void (*debug_reference_descriptor)(char*, const struct pipe_reference*);
|
||||
|
||||
#if defined(DEBUG)
|
||||
#if MESA_DEBUG
|
||||
|
||||
extern int debug_refcnt_state;
|
||||
|
||||
|
@@ -402,7 +402,7 @@ util_pstipple_create_fragment_shader(const struct tgsi_token *tokens,
|
||||
if (!new_tokens)
|
||||
return NULL;
|
||||
|
||||
#if 0 /* DEBUG */
|
||||
#if 0 /* debug */
|
||||
tgsi_dump(fs->tokens, 0);
|
||||
tgsi_dump(new_fs->tokens, 0);
|
||||
#endif
|
||||
|
@@ -1014,7 +1014,7 @@ _crocus_batch_flush(struct crocus_batch *batch, const char *file, int line)
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
const bool color = INTEL_DEBUG(DEBUG_COLOR);
|
||||
fprintf(stderr, "%scrocus: Failed to submit batchbuffer: %-80s%s\n",
|
||||
color ? "\e[1;41m" : "", strerror(-ret), color ? "\e[0m" : "");
|
||||
|
@@ -55,7 +55,7 @@ get_dxgi_factory()
|
||||
}
|
||||
|
||||
UINT flags = 0;
|
||||
#ifndef DEBUG
|
||||
#if !MESA_DEBUG
|
||||
if (d3d12_debug & D3D12_DEBUG_DEBUG_LAYER)
|
||||
#endif
|
||||
flags |= DXGI_CREATE_FACTORY_DEBUG;
|
||||
|
@@ -438,7 +438,7 @@ convert_planar_resource(struct d3d12_resource *res)
|
||||
plane_res->base.b.width0 = util_format_get_plane_width(res->base.b.format, plane, res->base.b.width0);
|
||||
plane_res->base.b.height0 = util_format_get_plane_height(res->base.b.format, plane, res->base.b.height0);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
struct d3d12_screen *screen = d3d12_screen(res->base.b.screen);
|
||||
D3D12_RESOURCE_DESC desc = GetDesc(res->bo->res);
|
||||
desc.Flags &= ~D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
|
||||
|
@@ -1521,7 +1521,7 @@ d3d12_init_screen(struct d3d12_screen *screen, IUnknown *adapter)
|
||||
#ifndef _GAMING_XBOX
|
||||
ID3D12DeviceFactory *factory = try_create_device_factory(screen->d3d12_mod);
|
||||
|
||||
#ifndef DEBUG
|
||||
#if !MESA_DEBUG
|
||||
if (d3d12_debug & D3D12_DEBUG_DEBUG_LAYER)
|
||||
#endif
|
||||
enable_d3d12_debug_layer(screen->d3d12_mod, factory);
|
||||
|
@@ -2094,7 +2094,7 @@ d3d12_video_encoder_encode_bitstream(struct pipe_video_codec * codec,
|
||||
|
||||
CD3DX12_RESOURCE_DESC referencesTexArrayDesc(GetDesc(referenceFramesDescriptor.ppTexture2Ds[0]));
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
// the reconpic output should be all the same texarray allocation
|
||||
if((reconPicOutputTextureDesc.pReconstructedPicture) && (referenceFramesDescriptor.NumTexture2Ds > 0))
|
||||
assert(referenceFramesDescriptor.ppTexture2Ds[0] == reconPicOutputTextureDesc.pReconstructedPicture);
|
||||
|
@@ -96,7 +96,7 @@ d3d12_video_encoder_references_manager_av1::begin_frame(D3D12_VIDEO_ENCODER_PICT
|
||||
reconPic.ReconstructedPictureSubresource;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
assert(m_PhysicalAllocationsStorage.get_number_of_tracked_allocations() <=
|
||||
(NUM_REF_FRAMES + 1)); // pool is not extended beyond maximum expected usage
|
||||
|
||||
@@ -314,7 +314,7 @@ d3d12_video_encoder_references_manager_av1::get_current_frame_picture_control_da
|
||||
m_CurrentFramePicParams.ReferenceFramesReconPictureDescriptors[i] =
|
||||
m_CurrentFrameReferencesData.pVirtualDPBEntries[i];
|
||||
|
||||
#ifdef DEBUG // Otherwise may iterate over structures and do no-op debug_printf
|
||||
#if MESA_DEBUG // Otherwise may iterate over structures and do no-op debug_printf
|
||||
print_ref_frame_idx();
|
||||
print_virtual_dpb_entries();
|
||||
print_physical_resource_references();
|
||||
|
@@ -408,7 +408,7 @@ create_variant(struct etna_shader *shader,
|
||||
|
||||
etna_disk_cache_store(shader->compiler, v);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (DBG_ENABLED(ETNA_DBG_DUMP_SHADERS))
|
||||
etna_dump_shader(v);
|
||||
#endif
|
||||
|
@@ -293,7 +293,7 @@ setup_border_colors(struct fd_texture_stateobj *tex,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
memset(&e->__pad0, 0, sizeof(e->__pad0));
|
||||
memset(&e->__pad1, 0, sizeof(e->__pad1));
|
||||
#endif
|
||||
|
@@ -111,7 +111,7 @@ fd6_emit_shader(struct fd_context *ctx, struct fd_ringbuffer *ring,
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* Name should generally match what you get with MESA_SHADER_CAPTURE_PATH: */
|
||||
const char *name = so->name;
|
||||
if (name)
|
||||
@@ -1306,7 +1306,7 @@ fd6_program_create(void *data, const struct ir3_shader_variant *bs,
|
||||
state->binning_stateobj = fd_ringbuffer_new_object(ctx->pipe, 0x1000);
|
||||
state->stateobj = fd_ringbuffer_new_object(ctx->pipe, 0x1000);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (!ds) {
|
||||
for (unsigned i = 0; i < bs->inputs_count; i++) {
|
||||
if (vs->inputs[i].sysval)
|
||||
|
@@ -510,7 +510,7 @@ batch_from_key(struct fd_context *ctx, struct fd_batch_key *key) assert_dt
|
||||
}
|
||||
|
||||
batch = alloc_batch_locked(cache, ctx, false);
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
DBG("%p: hash=0x%08x, %ux%u, %u layers, %u samples", batch, hash, key->width,
|
||||
key->height, key->layers, key->samples);
|
||||
for (unsigned idx = 0; idx < key->num_surfs; idx++) {
|
||||
|
@@ -184,7 +184,7 @@ enum fd_dirty_3d_state {
|
||||
static inline void
|
||||
fd_print_dirty_state(BITMASK_ENUM(fd_dirty_3d_state) dirty)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (!FD_DBG(MSGS))
|
||||
return;
|
||||
|
||||
|
@@ -333,7 +333,7 @@ gmem_stateobj_init(struct fd_screen *screen, struct gmem_key *key)
|
||||
tpp_x += 1;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
tpp_x = debug_get_num_option("TPP_X", tpp_x);
|
||||
tpp_y = debug_get_num_option("TPP_Y", tpp_x);
|
||||
#endif
|
||||
|
@@ -401,7 +401,7 @@ __OUT_IB5(struct fd_ringbuffer *ring, struct fd_ringbuffer *target)
|
||||
*/
|
||||
#define HW_QUERY_BASE_REG REG_AXXX_CP_SCRATCH_REG4
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
#define __EMIT_MARKER 1
|
||||
#else
|
||||
#define __EMIT_MARKER 0
|
||||
|
@@ -984,7 +984,7 @@ _iris_batch_flush(struct iris_batch *batch, const char *file, int line)
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
const bool color = INTEL_DEBUG(DEBUG_COLOR);
|
||||
fprintf(stderr, "%siris: Failed to submit batchbuffer: %-80s%s\n",
|
||||
color ? "\e[1;41m" : "", strerror(-ret), color ? "\e[0m" : "");
|
||||
|
@@ -75,7 +75,7 @@ extern struct lp_counters lp_count;
|
||||
|
||||
|
||||
/** Increment the named counter (only for debug builds) */
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
#define LP_COUNT(counter) lp_count.counter++
|
||||
#define LP_COUNT_ADD(counter, incr) lp_count.counter += (incr)
|
||||
#define LP_COUNT_GET(counter) (lp_count.counter)
|
||||
|
@@ -54,7 +54,7 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
int jit_line = 0;
|
||||
const struct lp_rast_state *jit_state = NULL;
|
||||
const struct lp_rasterizer_task *jit_task = NULL;
|
||||
@@ -1005,7 +1005,7 @@ rasterize_bin(struct lp_rasterizer_task *task,
|
||||
|
||||
lp_rast_tile_end(task);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* Debug/Perf flags:
|
||||
*/
|
||||
if (bin->head->count == 1) {
|
||||
|
@@ -147,7 +147,7 @@ struct lp_rast_plane {
|
||||
* Objects of this type are put into the lp_setup_context::data buffer.
|
||||
*/
|
||||
struct lp_rast_triangle {
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
float v[3][2];
|
||||
float pad0;
|
||||
float pad1;
|
||||
@@ -171,7 +171,7 @@ struct lp_rast_triangle {
|
||||
* Objects of this type are put into the lp_setup_context::data buffer.
|
||||
*/
|
||||
struct lp_rast_rectangle {
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
float v[2][2]; /**< diagonal corners */
|
||||
#endif
|
||||
|
||||
|
@@ -45,7 +45,7 @@
|
||||
/* If we crash in a jitted function, we can examine jit_line and jit_state
|
||||
* to get some info. This is not thread-safe, however.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
|
||||
struct lp_rasterizer_task;
|
||||
extern int jit_line;
|
||||
|
@@ -75,7 +75,7 @@ lp_scene_create(struct lp_setup_context *setup)
|
||||
|
||||
(void) mtx_init(&scene->mutex, mtx_plain);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* Do some scene limit sanity checks here */
|
||||
{
|
||||
size_t maxBins = TILES_X * TILES_Y;
|
||||
|
@@ -629,7 +629,7 @@ try_setup_line(struct lp_setup_context *setup,
|
||||
if (!line)
|
||||
return false;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
line->v[0][0] = v1[0][0];
|
||||
line->v[1][0] = v2[0][0];
|
||||
line->v[0][1] = v1[0][1];
|
||||
|
@@ -475,7 +475,7 @@ try_setup_point(struct lp_setup_context *setup,
|
||||
if (!point)
|
||||
return false;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
point->v[0][0] = v0[0][0];
|
||||
point->v[0][1] = v0[0][1];
|
||||
#endif
|
||||
@@ -554,7 +554,7 @@ try_setup_point(struct lp_setup_context *setup,
|
||||
lp_setup_alloc_rectangle(scene, key->num_inputs);
|
||||
if (!point)
|
||||
return false;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
point->v[0][0] = v0[0][0];
|
||||
point->v[0][1] = v0[0][1];
|
||||
#endif
|
||||
|
@@ -315,7 +315,7 @@ try_rect_cw(struct lp_setup_context *setup,
|
||||
if (!rect)
|
||||
return false;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
rect->v[0][0] = v0[0][0];
|
||||
rect->v[0][1] = v0[0][1];
|
||||
rect->v[1][0] = v1[0][0];
|
||||
|
@@ -361,7 +361,7 @@ do_triangle_ccw(struct lp_setup_context *setup,
|
||||
if (!tri)
|
||||
return false;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
tri->v[0][0] = v0[0][0];
|
||||
tri->v[1][0] = v1[0][0];
|
||||
tri->v[2][0] = v2[0][0];
|
||||
|
@@ -241,7 +241,7 @@ llvmpipe_create_sampler_view(struct pipe_context *pipe,
|
||||
pipe_resource_reference(&view->texture, texture);
|
||||
view->context = pipe;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/*
|
||||
* This is possibly too lenient, but the primary reason is just
|
||||
* to catch gallium frontends which forget to initialize this, so
|
||||
|
@@ -391,7 +391,7 @@ main(int argc, char **argv)
|
||||
n = atoi(argv[i]);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (verbose >= 2) {
|
||||
gallivm_debug |= GALLIVM_DEBUG_IR;
|
||||
gallivm_debug |= GALLIVM_DEBUG_ASM;
|
||||
|
@@ -59,7 +59,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
static struct llvmpipe_resource resource_list;
|
||||
static simple_mtx_t resource_list_mutex = SIMPLE_MTX_INITIALIZER;
|
||||
#endif
|
||||
@@ -303,7 +303,7 @@ llvmpipe_resource_create_all(struct pipe_screen *_screen,
|
||||
|
||||
lpr->id = id_counter++;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
simple_mtx_lock(&resource_list_mutex);
|
||||
list_addtail(&lpr->list, &resource_list.list);
|
||||
simple_mtx_unlock(&resource_list_mutex);
|
||||
@@ -437,7 +437,7 @@ llvmpipe_resource_from_memobj(struct pipe_screen *pscreen,
|
||||
lpr->id = id_counter++;
|
||||
lpr->imported_memory = true;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
simple_mtx_lock(&resource_list_mutex);
|
||||
list_addtail(&lpr->list, &resource_list.list);
|
||||
simple_mtx_unlock(&resource_list_mutex);
|
||||
@@ -474,7 +474,7 @@ llvmpipe_resource_destroy(struct pipe_screen *pscreen,
|
||||
align_free(lpr->data);
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
simple_mtx_lock(&resource_list_mutex);
|
||||
if (!list_is_empty(&lpr->list))
|
||||
list_del(&lpr->list);
|
||||
@@ -611,7 +611,7 @@ llvmpipe_resource_from_handle(struct pipe_screen *_screen,
|
||||
|
||||
lpr->id = id_counter++;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
simple_mtx_lock(&resource_list_mutex);
|
||||
list_addtail(&lpr->list, &resource_list.list);
|
||||
simple_mtx_unlock(&resource_list_mutex);
|
||||
@@ -670,7 +670,7 @@ llvmpipe_resource_from_user_memory(struct pipe_screen *_screen,
|
||||
} else
|
||||
lpr->data = user_memory;
|
||||
lpr->user_ptr = true;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
simple_mtx_lock(&resource_list_mutex);
|
||||
list_addtail(&lpr->list, &resource_list.list);
|
||||
simple_mtx_unlock(&resource_list_mutex);
|
||||
@@ -1060,7 +1060,7 @@ llvmpipe_unmap_memory(struct pipe_screen *screen,
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
void
|
||||
llvmpipe_print_resources(void)
|
||||
{
|
||||
@@ -1161,7 +1161,7 @@ llvmpipe_resource_get_param(struct pipe_screen *screen,
|
||||
void
|
||||
llvmpipe_init_screen_resource_funcs(struct pipe_screen *screen)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/* init linked list for tracking resources */
|
||||
{
|
||||
static bool first_call = true;
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include "pipe/p_state.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "lp_limits.h"
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
#include "util/list.h"
|
||||
#endif
|
||||
|
||||
@@ -103,7 +103,7 @@ struct llvmpipe_resource
|
||||
uint64_t backing_offset;
|
||||
bool backable;
|
||||
bool imported_memory;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
struct list_head list;
|
||||
#endif
|
||||
};
|
||||
|
@@ -923,7 +923,7 @@ panfrost_load_tiled_images(struct panfrost_transfer *transfer,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
|
||||
static unsigned
|
||||
get_superblock_size(uint32_t *hdr, unsigned uncompressed_size)
|
||||
|
@@ -65,7 +65,7 @@
|
||||
* Command buffer setup.
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
|
||||
#define CB_LOCALS \
|
||||
int cs_count = 0; \
|
||||
|
@@ -503,7 +503,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
|
||||
rc_init_regalloc_state(&r300->vs_regalloc_state, RC_VERTEX_PROGRAM);
|
||||
|
||||
/* Print driver info. */
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
{
|
||||
#else
|
||||
if (DBG_ON(r300, DBG_INFO)) {
|
||||
|
@@ -43,7 +43,7 @@
|
||||
struct radeon_winsys *cs_winsys = (context)->rws; \
|
||||
int cs_count = 0; (void) cs_count; (void) cs_winsys;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
|
||||
#define BEGIN_CS(size) do { \
|
||||
assert(size <= (cs_copy->current.max_dw - cs_copy->current.cdw)); \
|
||||
|
@@ -3596,7 +3596,7 @@ softpipe_create_sampler_view(struct pipe_context *pipe,
|
||||
pipe_resource_reference(&view->texture, resource);
|
||||
view->context = pipe;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/*
|
||||
* This is possibly too lenient, but the primary reason is just
|
||||
* to catch gallium frontends which forget to initialize this, so
|
||||
|
@@ -1057,7 +1057,7 @@ svga_get_time(struct svga_context *svga)
|
||||
* function call with an error value, the purpose is to trigger and test
|
||||
* retry path handling.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
|
||||
/*
|
||||
* Optionally replace a function call with a PIPE_ERROR_OUT_OF_MEMORY
|
||||
|
@@ -50,7 +50,7 @@
|
||||
#define DEBUG_UAV 0x80000
|
||||
#define DEBUG_RETRY 0x100000
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
extern int SVGA_DEBUG;
|
||||
#define DBSTR(x) x
|
||||
#else
|
||||
@@ -61,7 +61,7 @@ extern int SVGA_DEBUG;
|
||||
static inline void
|
||||
SVGA_DBG( unsigned flag, const char *fmt, ... )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (SVGA_DEBUG & flag)
|
||||
{
|
||||
va_list args;
|
||||
|
@@ -1376,7 +1376,7 @@ svga_hwtnl_prim(struct svga_hwtnl *hwtnl,
|
||||
else {
|
||||
/* batch up drawing commands */
|
||||
assert(indirect == NULL);
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
check_draw_params(hwtnl, range, min_index, max_index, ib);
|
||||
assert(start_instance == 0);
|
||||
assert(instance_count <= 1);
|
||||
|
@@ -1682,7 +1682,7 @@ svga_get_format_cap(struct svga_screen *ss,
|
||||
SVGA3dDevCapResult result;
|
||||
const struct format_cap *entry;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
check_format_tables();
|
||||
#else
|
||||
(void) check_format_tables;
|
||||
@@ -1713,7 +1713,7 @@ svga_get_dx_format_cap(struct svga_screen *ss,
|
||||
struct svga_winsys_screen *sws = ss->sws;
|
||||
const struct format_cap *entry;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
check_format_tables();
|
||||
#else
|
||||
(void) check_format_tables;
|
||||
|
@@ -178,7 +178,7 @@ svga_set_shader_images(struct pipe_context *pipe,
|
||||
/* number of bound image views */
|
||||
svga->curr.num_image_views[shader] = start + num;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
SVGA_DBG(DEBUG_UAV, "%s: num_image_views=%d start=%d num=%d unbind_num_trailing_slots=%d\n",
|
||||
__func__, svga->curr.num_image_views[shader], start, num,
|
||||
unbind_num_trailing_slots);
|
||||
|
@@ -1460,7 +1460,7 @@ svga_texture_transfer_map_upload(struct svga_context *svga,
|
||||
upload_size = st->base.layer_stride * st->base.box.depth;
|
||||
upload_size = align(upload_size, 16);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (util_format_is_compressed(texture->format)) {
|
||||
unsigned blockw, blockh, bytesPerBlock;
|
||||
|
||||
|
@@ -53,7 +53,7 @@
|
||||
#define MESA_GIT_SHA1 "(unknown git revision)"
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
int SVGA_DEBUG = 0;
|
||||
|
||||
static const struct debug_named_value svga_debug_flags[] = {
|
||||
@@ -93,8 +93,8 @@ svga_get_name( struct pipe_screen *pscreen )
|
||||
{
|
||||
const char *build = "", *llvm = "", *mutex = "";
|
||||
static char name[100];
|
||||
#ifdef DEBUG
|
||||
/* Only return internal details in the DEBUG version:
|
||||
#if MESA_DEBUG
|
||||
/* Only return internal details in the MESA_DEBUG version:
|
||||
*/
|
||||
build = "build: DEBUG;";
|
||||
mutex = "mutex: " PIPE_ATOMIC ";";
|
||||
@@ -1051,7 +1051,7 @@ svga_screen_create(struct svga_winsys_screen *sws)
|
||||
struct svga_screen *svgascreen;
|
||||
struct pipe_screen *screen;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
SVGA_DEBUG = debug_get_flags_option("SVGA_DEBUG", svga_debug_flags, 0 );
|
||||
#endif
|
||||
|
||||
@@ -1328,7 +1328,7 @@ svga_winsys_screen(struct pipe_screen *screen)
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
struct svga_screen *
|
||||
svga_screen(struct pipe_screen *screen)
|
||||
{
|
||||
|
@@ -100,7 +100,7 @@ struct svga_screen
|
||||
} hud;
|
||||
};
|
||||
|
||||
#ifndef DEBUG
|
||||
#if !MESA_DEBUG
|
||||
/** cast wrapper */
|
||||
static inline struct svga_screen *
|
||||
svga_screen(struct pipe_screen *pscreen)
|
||||
|
@@ -95,7 +95,7 @@ svga_set_shader_buffers(struct pipe_context *pipe,
|
||||
|
||||
assert(start + num <= SVGA_MAX_SHADER_BUFFERS);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
const struct pipe_shader_buffer *b = buffers;
|
||||
SVGA_DBG(DEBUG_UAV, "%s: shader=%d start=%d num=%d ",
|
||||
__func__, shader, start, num);
|
||||
@@ -141,7 +141,7 @@ svga_set_shader_buffers(struct pipe_context *pipe,
|
||||
svga->curr.num_shader_buffers[shader] = start;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
SVGA_DBG(DEBUG_UAV,
|
||||
"%s: current num_shader_buffers=%d start=%d num=%d buffers=",
|
||||
__func__, svga->curr.num_shader_buffers[shader],
|
||||
@@ -177,7 +177,7 @@ svga_set_hw_atomic_buffers(struct pipe_context *pipe,
|
||||
|
||||
assert(start + num <= SVGA_MAX_ATOMIC_BUFFERS);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
SVGA_DBG(DEBUG_UAV, "%s: start=%d num=%d \n", __func__, start, num);
|
||||
#endif
|
||||
|
||||
@@ -221,7 +221,7 @@ svga_set_hw_atomic_buffers(struct pipe_context *pipe,
|
||||
svga->curr.num_atomic_buffers = start;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
SVGA_DBG(DEBUG_UAV, "%s: current num_atomic_buffers=%d start=%d num=%d ",
|
||||
__func__, svga->curr.num_atomic_buffers,
|
||||
start, num);
|
||||
|
@@ -216,7 +216,7 @@ update_state(struct svga_context *svga,
|
||||
const struct svga_tracked_state *atoms[],
|
||||
uint64_t *state)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
bool debug = true;
|
||||
#else
|
||||
bool debug = false;
|
||||
|
@@ -428,7 +428,7 @@ emit_const_range(struct svga_context *svga,
|
||||
shader == PIPE_SHADER_FRAGMENT);
|
||||
assert(!svga_have_vgpu10(svga));
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (offset + count > SVGA3D_CONSTREG_MAX) {
|
||||
debug_printf("svga: too many constants (offset %u + count %u = %u (max = %u))\n",
|
||||
offset, count, offset + count, SVGA3D_CONSTREG_MAX);
|
||||
|
@@ -53,7 +53,7 @@
|
||||
static const struct tgsi_token *
|
||||
get_dummy_fragment_shader(void)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
static const float color[4] = { 1.0, 0.0, 0.0, 0.0 }; /* red */
|
||||
#else
|
||||
static const float color[4] = { 0.0, 0.0, 0.0, 0.0 }; /* black */
|
||||
@@ -200,7 +200,7 @@ make_fs_key(const struct svga_context *svga,
|
||||
|
||||
key->fs.alpha_to_one = svga->curr.blend->alpha_to_one;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
/*
|
||||
* We expect a consistent set of samplers and sampler views.
|
||||
* Do some debug checks/warnings here.
|
||||
|
@@ -130,7 +130,7 @@ update_need_pipeline(struct svga_context *svga, uint64_t dirty)
|
||||
svga->dirty |= SVGA_NEW_NEED_PIPELINE;
|
||||
}
|
||||
|
||||
/* DEBUG */
|
||||
/* debug */
|
||||
if (0 && svga->state.sw.need_pipeline)
|
||||
debug_printf("sw.need_pipeline = %d\n", svga->state.sw.need_pipeline);
|
||||
|
||||
|
@@ -785,7 +785,7 @@ update_uav(struct svga_context *svga, uint64_t dirty)
|
||||
SVGA_DBG(DEBUG_UAV, "%s: SetUAViews uavSpliceIndex=%d", __func__,
|
||||
uavSpliceIndex);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(uaViewIds); i++) {
|
||||
SVGA_DBG(DEBUG_UAV, " %d ", uaViewIds[i]);
|
||||
}
|
||||
@@ -891,7 +891,7 @@ update_cs_uav(struct svga_context *svga, uint64_t dirty)
|
||||
|
||||
SVGA_DBG(DEBUG_UAV, "%s: SetCSUAViews", __func__);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(uaViewIds); i++) {
|
||||
SVGA_DBG(DEBUG_UAV, " %d ", uaViewIds[i]);
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ vc4_bo_label(struct vc4_screen *screen, struct vc4_bo *bo, const char *fmt, ...)
|
||||
* whole-system allocation information), or if VC4_DEBUG=surf is set
|
||||
* (for debugging a single app's allocation).
|
||||
*/
|
||||
#ifndef DEBUG
|
||||
#if !MESA_DEBUG
|
||||
if (!VC4_DBG(SURFACE))
|
||||
return;
|
||||
#endif
|
||||
|
@@ -42,7 +42,7 @@ void qir_validate(struct vc4_compile *c)
|
||||
* keep compiling the validation code to make sure it doesn't get
|
||||
* broken.
|
||||
*/
|
||||
#ifndef DEBUG
|
||||
#if !MESA_DEBUG
|
||||
return;
|
||||
#endif
|
||||
|
||||
|
@@ -121,7 +121,7 @@ vc4_qpu_validate(uint64_t *insts, uint32_t num_inst)
|
||||
* keep compiling the validation code to make sure it doesn't get
|
||||
* broken.
|
||||
*/
|
||||
#ifndef DEBUG
|
||||
#if !MESA_DEBUG
|
||||
return;
|
||||
#endif
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
|
||||
unsigned st_debug = 0;
|
||||
|
||||
|
@@ -13,14 +13,14 @@ extern "C" {
|
||||
#define ST_DEBUG_TGSI (1 << 1)
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
extern unsigned st_debug;
|
||||
#else
|
||||
#define st_debug 0
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
void st_debug_parse(void);
|
||||
#else
|
||||
#define st_debug_parse() ((void)0)
|
||||
|
@@ -924,7 +924,7 @@ CreateDepthStencilState(
|
||||
face1->zfail_op = translateStencilOp(pDepthStencilDesc->BackFace.StencilDepthFailOp);
|
||||
face1->valuemask = pDepthStencilDesc->StencilReadMask;
|
||||
face1->writemask = pDepthStencilDesc->StencilWriteMask;
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (!pDepthStencilDesc->FrontEnable) {
|
||||
ASSERT(face0->func == PIPE_FUNC_ALWAYS);
|
||||
ASSERT(face0->fail_op == PIPE_STENCIL_OP_KEEP);
|
||||
|
@@ -38,7 +38,7 @@
|
||||
|
||||
/* Some debugging info. */
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
#include <ctype.h>
|
||||
|
||||
int debug_xfonts = 0;
|
||||
@@ -95,7 +95,7 @@ dump_bitmap(unsigned int width, unsigned int height, GLubyte * bitmap)
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
#endif /* MESA_DEBUG */
|
||||
|
||||
|
||||
/* Implementation. */
|
||||
@@ -286,7 +286,7 @@ glXUseXFont(Font font, int first, int count, int listbase)
|
||||
gc = XCreateGC(dpy, pixmap, valuemask, &values);
|
||||
XFreePixmap(dpy, pixmap);
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (debug_xfonts)
|
||||
dump_font_struct(fs);
|
||||
#endif
|
||||
@@ -310,7 +310,7 @@ glXUseXFont(Font font, int first, int count, int listbase)
|
||||
valid = 1;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (debug_xfonts) {
|
||||
char s[7];
|
||||
sprintf(s, isprint(c) ? "%c> " : "\\%03o> ", c);
|
||||
@@ -345,7 +345,7 @@ glXUseXFont(Font font, int first, int count, int listbase)
|
||||
fill_bitmap(dpy, win, gc, bm_width, bm_height, x, y, c, bm);
|
||||
|
||||
glBitmap(width, height, x0, y0, dx, dy, bm);
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
if (debug_xfonts) {
|
||||
printf("width/height = %u/%u\n", width, height);
|
||||
printf("bm_width/bm_height = %u/%u\n", bm_width, bm_height);
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#include "state_tracker/st_context.h"
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if MESA_DEBUG
|
||||
# define TRACE(x...) printf("hgl:frontend: " x)
|
||||
# define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__)
|
||||
#else
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include "volumetexture9.h"
|
||||
#include "nine_pipe.h"
|
||||
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#if MESA_DEBUG || !defined(NDEBUG)
|
||||
#include "nine_dump.h"
|
||||
#endif
|
||||
|
||||
@@ -587,7 +587,7 @@ NineBaseTexture9_UnLoad( struct NineBaseTexture9 *This )
|
||||
BASETEX_REGISTER_UPDATE(This);
|
||||
}
|
||||
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#if MESA_DEBUG || !defined(NDEBUG)
|
||||
void
|
||||
NineBaseTexture9_Dump( struct NineBaseTexture9 *This )
|
||||
{
|
||||
@@ -602,4 +602,4 @@ NineBaseTexture9_Dump( struct NineBaseTexture9 *This )
|
||||
This->base.info.array_size, This->base.info.last_level,
|
||||
This->managed.lod, This->managed.lod_resident);
|
||||
}
|
||||
#endif /* DEBUG || !NDEBUG */
|
||||
#endif /* MESA_DEBUG || !NDEBUG */
|
||||
|
@@ -139,7 +139,7 @@ NineBindTextureToDevice( struct NineDevice9 *device,
|
||||
nine_bind(slot, tex);
|
||||
}
|
||||
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#if MESA_DEBUG || !defined(NDEBUG)
|
||||
void
|
||||
NineBaseTexture9_Dump( struct NineBaseTexture9 *This );
|
||||
#else
|
||||
|
@@ -17,7 +17,7 @@ _nine_debug_printf( unsigned long flag,
|
||||
|
||||
#define ERR(fmt, ...) _nine_debug_printf(DBG_ERROR, __func__, fmt, ## __VA_ARGS__)
|
||||
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#if MESA_DEBUG || !defined(NDEBUG)
|
||||
#define WARN(fmt, ...) _nine_debug_printf(DBG_WARN, __func__, fmt, ## __VA_ARGS__)
|
||||
#define WARN_ONCE(fmt, ...) \
|
||||
do { \
|
||||
@@ -32,7 +32,7 @@ _nine_debug_printf( unsigned long flag,
|
||||
#define WARN_ONCE(fmt, ...) do {} while(0)
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#if MESA_DEBUG || !defined(NDEBUG)
|
||||
#define DBG_FLAG(flag, fmt, ...) \
|
||||
_nine_debug_printf(flag, __func__, fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
@@ -74,7 +74,7 @@ _nine_stub( const char *file,
|
||||
const char *func,
|
||||
unsigned line );
|
||||
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#if MESA_DEBUG || !defined(NDEBUG)
|
||||
#define STUB(ret) \
|
||||
do { \
|
||||
_nine_stub(__FILE__, __func__, __LINE__); \
|
||||
@@ -88,7 +88,7 @@ _nine_stub( const char *file,
|
||||
* macro is designed to be used in conditionals ala
|
||||
* if (user_error(required condition)) { assertion failed }
|
||||
* It also prints debug message if the assertion fails. */
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#if MESA_DEBUG || !defined(NDEBUG)
|
||||
#define user_error(x) \
|
||||
(!(x) ? (DBG_FLAG(DBG_USER, "User assertion failed: `%s'\n", #x), true) \
|
||||
: false)
|
||||
@@ -96,7 +96,7 @@ _nine_stub( const char *file,
|
||||
#define user_error(x) (!(x) ? TRUE : FALSE)
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG) || !defined(NDEBUG)
|
||||
#if MESA_DEBUG || !defined(NDEBUG)
|
||||
#define user_warn(x) \
|
||||
if ((x)) { DBG_FLAG(DBG_USER, "User warning: `%s'\n", #x); }
|
||||
#else
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user