unsigned nr_dst,
unsigned nr_src )
{
-#ifdef DEBUG
+#ifndef NDEBUG
const struct tgsi_opcode_info *info = tgsi_get_opcode_info( opcode );
assert(info);
if (info) {
sstates[i] == samplers->sampler_states[slot])
continue;
-#ifdef DEBUG
+#ifndef NDEBUG
assert(sstates[i]->magic == SI_SAMPLER_STATE_MAGIC);
#endif
samplers->sampler_states[slot] = sstates[i];
#define SI_SAMPLER_STATE_MAGIC 0x34f1c35a
struct si_sampler_state {
-#ifdef DEBUG
+#ifndef NDEBUG
unsigned magic;
#endif
uint32_t val[4];
}
if (!array_alloca) {
for (i = 0; i < decl_size; ++i) {
-#ifdef DEBUG
+#ifndef NDEBUG
snprintf(name, sizeof(name), "TEMP%d.%c",
first + i / 4, "xyzw"[i % 4]);
#endif
for (i = 0; i < decl_size; ++i) {
LLVMValueRef ptr;
if (writemask & (1 << (i % 4))) {
-#ifdef DEBUG
+#ifndef NDEBUG
snprintf(name, sizeof(name), "TEMP%d.%c",
first + i / 4, "xyzw"[i % 4]);
#endif
if (ctx->outputs[idx][0])
continue;
for (chan = 0; chan < TGSI_NUM_CHANNELS; chan++) {
-#ifdef DEBUG
+#ifndef NDEBUG
snprintf(name, sizeof(name), "OUT%d.%c",
idx, "xyzw"[chan % 4]);
#endif
return NULL;
}
-#ifdef DEBUG
+#ifndef NDEBUG
rstate->magic = SI_SAMPLER_STATE_MAGIC;
#endif
rstate->val[0] = (S_008F30_CLAMP_X(si_tex_wrap(state->wrap_s)) |
static void si_delete_sampler_state(struct pipe_context *ctx, void *state)
{
-#ifdef DEBUG
+#ifndef NDEBUG
struct si_sampler_state *s = state;
assert(s->magic == SI_SAMPLER_STATE_MAGIC);
if (ctx) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid call)", name);
}
-#if defined(DEBUG)
+#ifndef NDEBUG
else if (getenv("MESA_DEBUG") || getenv("LIBGL_DEBUG")) {
fprintf(stderr,
"GL User Error: gl%s called without a rendering context\n",
static void
set_verbose_flags(const char *str)
{
-#ifdef DEBUG
+#ifndef NDEBUG
struct option {
const char *name;
GLbitfield flag;
static void
set_debug_flags(const char *str)
{
-#ifdef DEBUG
+#ifndef NDEBUG
struct option {
const char *name;
GLbitfield flag;
LogFile = fopen(logFile, "w");
if (!LogFile)
LogFile = stderr;
-#ifdef DEBUG
+#ifndef NDEBUG
/* in debug builds, print messages unless MESA_DEBUG="silent" */
if (MESA_DEBUG_FLAGS & DEBUG_SILENT)
debug = 0;
if (debug == -1) {
const char *debugEnv = getenv("MESA_DEBUG");
-#ifdef DEBUG
+#ifndef NDEBUG
if (debugEnv && strstr(debugEnv, "silent"))
debug = GL_FALSE;
else
void
_mesa_debug( const struct gl_context *ctx, const char *fmtString, ... )
{
-#ifdef DEBUG
+#ifndef NDEBUG
char s[MAX_DEBUG_MESSAGE_LENGTH];
va_list args;
va_start(args, fmtString);
}
if (ctx->Select.BufferCount > ctx->Select.BufferSize) {
/* overflow */
-#ifdef DEBUG
+#ifndef NDEBUG
_mesa_warning(ctx, "Feedback buffer overflow");
#endif
result = -1;
case MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT:
return MESA_FORMAT_RGB_FLOAT32;
default:
-#ifdef DEBUG
assert(!_mesa_is_format_compressed(format));
-#endif
return format;
}
}
buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1);
*(uintptr_t *)(buf - sizeof(void *)) = ptr;
-#ifdef DEBUG
+#ifndef NDEBUG
/* mark the non-aligned area */
while ( ptr < buf - sizeof(void *) ) {
*(unsigned long *)ptr = 0xcdcdcdcd;
buf = (ptr + alignment + sizeof(void *)) & ~(uintptr_t)(alignment - 1);
*(uintptr_t *)(buf - sizeof(void *)) = ptr;
-#ifdef DEBUG
+#ifndef NDEBUG
/* mark the non-aligned area */
while ( ptr < buf - sizeof(void *) ) {
*(unsigned long *)ptr = 0xcdcdcdcd;
unsigned nr_device_memory_evictions; /**< # of evictions (monotonic counter) */
};
-#ifdef DEBUG
+#ifndef NDEBUG
extern int MESA_VERBOSE;
extern int MESA_DEBUG_FLAGS;
#else
shProg->Shaders = newList;
shProg->NumShaders = n - 1;
-#ifdef DEBUG
+#ifndef NDEBUG
/* sanity check - make sure the new list's entries are sensible */
for (j = 0; j < shProg->NumShaders; j++) {
assert(shProg->Shaders[j]->Stage == MESA_SHADER_VERTEX ||
else
framebuffer.zsbuf = NULL;
-#ifdef DEBUG
+#ifndef NDEBUG
/* Make sure the resource binding flags were set properly */
for (i = 0; i < framebuffer.nr_cbufs; i++) {
assert(!framebuffer.cbufs[i] ||
int j;
enum pipe_format pf;
-#ifdef DEBUG
+#ifndef NDEBUG
{
static boolean firstCall = TRUE;
if (firstCall) {
/* Which flags to set in vbo_exec_begin_vertices() */
GLbitfield begin_vertices_flags;
-#ifdef DEBUG
+#ifndef NDEBUG
GLint flush_call_depth;
#endif
};
{
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
-#ifdef DEBUG
+#ifndef NDEBUG
/* debug check: make sure we don't get called recursively */
exec->flush_call_depth++;
assert(exec->flush_call_depth == 1);
if (_mesa_inside_begin_end(ctx)) {
/* We've had glBegin but not glEnd! */
-#ifdef DEBUG
+#ifndef NDEBUG
exec->flush_call_depth--;
assert(exec->flush_call_depth == 0);
#endif
*/
ctx->Driver.NeedFlush &= ~(FLUSH_UPDATE_CURRENT | flags);
-#ifdef DEBUG
+#ifndef NDEBUG
exec->flush_call_depth--;
assert(exec->flush_call_depth == 0);
#endif
#define SLAB_MAGIC_ALLOCATED 0xcafe4321
#define SLAB_MAGIC_FREE 0x7ee01234
-#ifdef DEBUG
+#ifndef NDEBUG
#define SET_MAGIC(element, value) (element)->magic = (value)
#define CHECK_MAGIC(element, value) assert((element)->magic == (value))
#else
*/
intptr_t owner;
-#ifdef DEBUG
+#ifndef NDEBUG
intptr_t magic;
#endif
};