* Keith Whitwell <keith@tungstengraphics.com>
*/
+#include "pipe/p_debug.h"
+
#include "draw_private.h"
#include "draw_context.h"
unsigned i;
if (0)
- fprintf(stdout,"Flushing with %d prims, %d verts\n",
- draw->pq.queue_nr, draw->vs.queue_nr);
+ debug_printf("Flushing with %d prims, %d verts\n",
+ draw->pq.queue_nr, draw->vs.queue_nr);
assert (draw->pq.queue_nr != 0);
void draw_do_flush( struct draw_context *draw, unsigned flags )
{
if (0)
- fprintf(stdout,"Flushing with %d verts, %d prims\n",
- draw->vs.queue_nr,
- draw->pq.queue_nr );
+ debug_printf("Flushing with %d verts, %d prims\n",
+ draw->vs.queue_nr,
+ draw->pq.queue_nr );
if (flags >= DRAW_FLUSH_SHADER_QUEUE) {
unsigned nr_verts )
{
if (!draw_vertex_cache_check_space( draw, nr_verts )) {
-// fprintf(stderr, "v");
+// debug_printf("v");
draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE );
}
else if (draw->pq.queue_nr == PRIM_QUEUE_LENGTH) {
-// fprintf(stderr, "p");
+// debug_printf("p");
draw_do_flush( draw, DRAW_FLUSH_PRIM_QUEUE );
}
boolean unfilled = (draw->rasterizer->fill_cw != PIPE_POLYGON_MODE_FILL ||
draw->rasterizer->fill_ccw != PIPE_POLYGON_MODE_FILL);
-// _mesa_printf("%s (%d) %d/%d\n", __FUNCTION__, draw->prim, start, count );
+// debug_printf("%s (%d) %d/%d\n", __FUNCTION__, draw->prim, start, count );
switch (prim) {
case PIPE_PRIM_POINTS:
*/
-#include <assert.h>
-
+#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "draw_vbuf.h"
j = vinfo->src_index[i];
switch (vinfo->emit[i]) {
case EMIT_OMIT:
- fprintf(stderr, "EMIT_OMIT:");
+ debug_printf("EMIT_OMIT:");
break;
case EMIT_ALL:
assert(i == 0);
assert(j == 0);
- fprintf(stderr, "EMIT_ALL:\t");
+ debug_printf("EMIT_ALL:\t");
for(k = 0; k < vinfo->size*4; ++k)
- fprintf(stderr, "%02x ", *data++);
+ debug_printf("%02x ", *data++);
break;
case EMIT_1F:
- fprintf(stderr, "EMIT_1F:\t");
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
+ debug_printf("EMIT_1F:\t");
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
break;
case EMIT_1F_PSIZE:
- fprintf(stderr, "EMIT_1F_PSIZE:\t");
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
+ debug_printf("EMIT_1F_PSIZE:\t");
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
break;
case EMIT_2F:
- fprintf(stderr, "EMIT_2F:\t");
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
+ debug_printf("EMIT_2F:\t");
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
break;
case EMIT_3F:
- fprintf(stderr, "EMIT_3F:\t");
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
+ debug_printf("EMIT_3F:\t");
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
data += sizeof(float);
break;
case EMIT_4F:
- fprintf(stderr, "EMIT_4F:\t");
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
- fprintf(stderr, "%f ", *(float *)data); data += sizeof(float);
+ debug_printf("EMIT_4F:\t");
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
+ debug_printf("%f ", *(float *)data); data += sizeof(float);
break;
case EMIT_4UB:
- fprintf(stderr, "EMIT_4UB:\t");
- fprintf(stderr, "%u ", *data++);
- fprintf(stderr, "%u ", *data++);
- fprintf(stderr, "%u ", *data++);
- fprintf(stderr, "%u ", *data++);
+ debug_printf("EMIT_4UB:\t");
+ debug_printf("%u ", *data++);
+ debug_printf("%u ", *data++);
+ debug_printf("%u ", *data++);
+ debug_printf("%u ", *data++);
break;
default:
assert(0);
}
- fprintf(stderr, "\n");
+ debug_printf("\n");
}
- fprintf(stderr, "\n");
+ debug_printf("\n");
}
#endif
struct vertex_header *vertex )
{
#if 0
- fprintf(stderr, "emit vertex %d to %p\n",
+ debug_printf("emit vertex %d to %p\n",
vbuf->nr_vertices, vbuf->vertex_ptr);
#endif
if(vertex->vertex_id < vbuf->nr_vertices)
return;
else
- fprintf(stderr, "Bad vertex id 0x%04x (>= 0x%04x)\n",
+ debug_printf("Bad vertex id 0x%04x (>= 0x%04x)\n",
vertex->vertex_id, vbuf->nr_vertices);
return;
}
static float data[256];
draw_vf_emit_vertex(vbuf->vf, vertex, data);
if(memcmp((uint8_t *)vbuf->vertex_ptr - vbuf->vertex_size, data, vbuf->vertex_size)) {
- fprintf(stderr, "With VF:\n");
+ debug_printf("With VF:\n");
dump_emitted_vertex(vbuf->vinfo, (uint8_t *)data);
- fprintf(stderr, "Without VF:\n");
+ debug_printf("Without VF:\n");
dump_emitted_vertex(vbuf->vinfo, (uint8_t *)vbuf->vertex_ptr - vbuf->vertex_size);
assert(0);
}
{
char tmp[80];
pf_sprint_name(tmp, format);
- _mesa_printf("%s: %s\n", __FUNCTION__, tmp);
+ debug_printf("%s: %s\n", __FUNCTION__, tmp);
}
#endif
assert(count <= 4);
-// _mesa_printf("%s\n", __FUNCTION__);
+// debug_printf("%s\n", __FUNCTION__);
/* loop over vertex attributes (vertex shader inputs)
*/
assert(count <= 4);
-// _mesa_printf("%s %d\n", __FUNCTION__, count);
+// debug_printf("%s %d\n", __FUNCTION__, count);
/* loop over vertex attributes (vertex shader inputs)
*/
{
unsigned nr_attrs, i;
-// _mesa_printf("%s\n", __FUNCTION__);
+// debug_printf("%s\n", __FUNCTION__);
/* this may happend during context init */
if (!draw->vertex_shader)
vOut[j]->data[0][3] = w;
#if DBG_VS
- printf("output[%d]win: %f %f %f %f\n", j,
+ debug_printf("output[%d]win: %f %f %f %f\n", j,
vOut[j]->data[0][0],
vOut[j]->data[0][1],
vOut[j]->data[0][2],
vOut[j]->data[slot][2] = machine->Outputs[slot].xyzw[2].f[j];
vOut[j]->data[slot][3] = machine->Outputs[slot].xyzw[3].f[j];
#if DBG_VS
- printf("output[%d][%d]: %f %f %f %f\n", j, slot,
+ debug_printf("output[%d][%d]: %f %f %f %f\n", j, slot,
vOut[j]->data[slot][0],
vOut[j]->data[slot][1],
vOut[j]->data[slot][2],
*/
draw_update_vertex_fetch( draw );
-// fprintf(stderr, " q(%d) ", draw->vs.queue_nr );
+// debug_printf( " q(%d) ", draw->vs.queue_nr );
#ifdef MESA_LLVM
if (draw->vertex_shader->llvm_prog) {
draw_vertex_shader_queue_flush_llvm(draw);
z = vOut->clip[2] = dests[0][2];
w = vOut->clip[3] = dests[0][3];
#if DBG
- printf("output %d: %f %f %f %f\n", 0, x, y, z, w);
+ debug_printf("output %d: %f %f %f %f\n", 0, x, y, z, w);
#endif
vOut->clipmask = compute_clipmask(vOut->clip, draw->plane, draw->nr_planes);
vOut->data[slot][3] = dests[slot][3];
#if DBG
- printf("output %d: %f %f %f %f\n", slot,
+ debug_printf("output %d: %f %f %f %f\n", slot,
vOut->data[slot][0],
vOut->data[slot][1],
vOut->data[slot][2],
const unsigned format = map[i].format;
if (format == DRAW_EMIT_PAD) {
#if (DRAW_VF_DBG)
- _mesa_printf("%d: pad %d, offset %d\n", i,
+ debug_printf("%d: pad %d, offset %d\n", i,
map[i].offset, offset);
#endif
memcpy(vf->attr[j].data, &map[i].data, vf->attr[j].vertattrsize);
#if (DRAW_VF_DBG)
- _mesa_printf("%d: %s, offset %d\n", i,
+ debug_printf("%d: %s, offset %d\n", i,
draw_vf_format_info[format].name,
vf->attr[j].vertoffset);
#endif
*/
-#include <assert.h>
-
#include "pipe/p_compiler.h"
+#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "draw_vf.h"
update_src_ptr(p, srcECX, vfESI, a);
}
else {
- fprintf(stderr, "Can't emit 1ub %x %x %d\n",
+ debug_printf("Can't emit 1ub %x %x %d\n",
a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize );
return FALSE;
}
j++; /* NOTE: two attrs consumed */
}
else {
- fprintf(stderr, "Can't emit 3ub\n");
+ debug_printf("Can't emit 3ub\n");
}
return FALSE; /* add this later */
break;
update_src_ptr(p, srcECX, vfESI, a);
break;
default:
- fprintf(stderr, "unknown a[%d].format %d\n", j, a->format);
+ debug_printf("unknown a[%d].format %d\n", j, a->format);
return FALSE; /* catch any new opcodes */
}
static void
i915_use_passthrough_shader(struct i915_context *i915)
{
- fprintf(stderr, "**** Using i915 pass-through fragment shader\n");
+ debug_printf("**** Using i915 pass-through fragment shader\n");
i915->current.program = (uint *) MALLOC(sizeof(passthrough));
if (i915->current.program) {
va_list args;
char buffer[1024];
- fprintf(stderr, "i915_program_error: ");
+ debug_printf("i915_program_error: ");
va_start( args, msg );
vsprintf( buffer, msg, args );
va_end( args );
- fprintf(stderr, buffer);
- fprintf(stderr, "\n");
+ debug_printf(buffer);
+ debug_printf("\n");
p->error = 1;
}
switch (sem_name) {
case TGSI_SEMANTIC_POSITION:
- fprintf(stderr, "SKIP SEM POS\n");
+ debug_printf("SKIP SEM POS\n");
/*
assert(p->wpos_tex != -1);
src = i915_emit_decl(p, REG_TYPE_T, p->wpos_tex, D0_CHANNEL_ALL);
ind = parse.FullToken.FullDeclaration.u.DeclarationRange.First;
sem = parse.FullToken.FullDeclaration.Semantic.SemanticName;
semi = parse.FullToken.FullDeclaration.Semantic.SemanticIndex;
- /*printf("FS Input DECL [%u] sem %u\n", ind, sem);*/
+ /*debug_printf("FS Input DECL [%u] sem %u\n", ind, sem);*/
p->input_semantic_name[ind] = sem;
p->input_semantic_index[ind] = semi;
}
ind = parse.FullToken.FullDeclaration.u.DeclarationRange.First;
sem = parse.FullToken.FullDeclaration.Semantic.SemanticName;
semi = parse.FullToken.FullDeclaration.Semantic.SemanticIndex;
- /*printf("FS Output DECL [%u] sem %u\n", ind, sem);*/
+ /*debug_printf("FS Output DECL [%u] sem %u\n", ind, sem);*/
p->output_semantic_name[ind] = sem;
p->output_semantic_index[ind] = semi;
}
*/
-#include <assert.h>
-
#include "pipe/draw/draw_vbuf.h"
+#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_inlines.h"
#include "pipe/p_winsys.h"
}
break;
case TGSI_SEMANTIC_FOG:
- fprintf(stderr, "i915 fogcoord not implemented yet\n");
+ debug_printf("i915 fogcoord not implemented yet\n");
draw_emit_vertex_attr(&vinfo, EMIT_1F, INTERP_PERSPECTIVE, src++);
break;
default:
) * 3/2; /* plus 50% margin */
#if 0
- fprintf (stderr, "i915_emit_hardware_state: %d dwords, %d relocs\n", dwords, relocs);
+ debug_printf("i915_emit_hardware_state: %d dwords, %d relocs\n", dwords, relocs);
#endif
if(!BEGIN_BATCH(dwords, relocs)) {
LIS2 = i915->current.vertex_info.hwfmt[1];
LIS4 = i915->current.vertex_info.hwfmt[0];
/*
- printf("LIS2: 0x%x LIS4: 0x%x\n", LIS2, LIS4);
+ debug_printf("LIS2: 0x%x LIS4: 0x%x\n", LIS2, LIS4);
*/
assert(LIS4); /* should never be zero? */
}
case PIPE_FORMAT_S8Z24_UNORM:
return (MAPSURF_32BIT | MT_32BIT_xL824);
default:
- fprintf(stderr, "i915: translate_texture_format() bad image format %x\n",
+ debug_printf("i915: translate_texture_format() bad image format %x\n",
pipeFormat);
assert(0);
return 0;
return BRW_COMPAREFUNCTION_ALWAYS;
}
- fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+ debug_printf("Unknown value in %s: %x\n", __FUNCTION__, func);
return BRW_COMPAREFUNCTION_ALWAYS;
}
if (1) {
for (i = 0; i < sz; i+=4)
- _mesa_printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4,
+ debug_printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4,
buf[i+0], buf[i+1], buf[i+2], buf[i+3]);
- _mesa_printf("last_buf %p buf %p sz %d/%d cmp %d\n",
+ debug_printf("last_buf %p buf %p sz %d/%d cmp %d\n",
brw->curbe.last_buf, buf,
bufsz, brw->curbe.last_bufsz,
brw->curbe.last_buf ? memcmp(buf, brw->curbe.last_buf, bufsz) : -1);
bufsz,
1 << 6,
&brw->curbe.gs_offset)) {
- _mesa_printf("out of GS memory for curbe\n");
+ debug_printf("out of GS memory for curbe\n");
assert(0);
return;
}
*/
+#include "pipe/p_debug.h"
+
#include "brw_eu.h"
void brw_print_reg( struct brw_reg hwreg )
"f"
};
- _mesa_printf("%s%s",
+ debug_printf("%s%s",
hwreg.abs ? "abs/" : "",
hwreg.negate ? "-" : "");
hwreg.width == BRW_WIDTH_8 &&
hwreg.hstride == BRW_HORIZONTAL_STRIDE_1 &&
hwreg.type == BRW_REGISTER_TYPE_F) {
- _mesa_printf("vec%d", hwreg.nr);
+ debug_printf("vec%d", hwreg.nr);
}
else if (hwreg.file == BRW_GENERAL_REGISTER_FILE &&
hwreg.vstride == BRW_VERTICAL_STRIDE_0 &&
hwreg.width == BRW_WIDTH_1 &&
hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 &&
hwreg.type == BRW_REGISTER_TYPE_F) {
- _mesa_printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4);
+ debug_printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4);
}
else {
- _mesa_printf("%s%d.%d<%d;%d,%d>:%s",
+ debug_printf("%s%d.%d<%d;%d,%d>:%s",
file[hwreg.file],
hwreg.nr,
hwreg.subnr / type_sz(hwreg.type),
boolean need_stall = 0;
if(writemask == 0) {
-/* _mesa_printf("%s: zero writemask??\n", __FUNCTION__); */
+/* debug_printf("%s: zero writemask??\n", __FUNCTION__); */
return;
}
if (newmask != writemask) {
need_stall = 1;
-/* _mesa_printf("need stall %x %x\n", newmask , writemask); */
+/* debug_printf("need stall %x %x\n", newmask , writemask); */
}
else {
struct brw_reg m1 = brw_message_reg(msg_reg_nr);
//int semantic = parse.FullToken.FullDeclaration.Semantic.SemanticName;
//int semantic_index = parse.FullToken.FullDeclaration.Semantic.SemanticIndex;
- fprintf(stderr, "fs input %d..%d interp mode %d\n", first, last, interp_mode);
+ debug_printf("fs input %d..%d interp mode %d\n", first, last, interp_mode);
switch (interp_mode) {
case TGSI_INTERPOLATE_CONSTANT:
key.linear_mask |= 1;
key.const_mask <<= 1;
- fprintf(stderr, "key.persp_mask: %x\n", key.persp_mask);
- fprintf(stderr, "key.linear_mask: %x\n", key.linear_mask);
- fprintf(stderr, "key.const_mask: %x\n", key.const_mask);
+ debug_printf("key.persp_mask: %x\n", key.persp_mask);
+ debug_printf("key.linear_mask: %x\n", key.linear_mask);
+ debug_printf("key.const_mask: %x\n", key.const_mask);
// key.do_point_sprite = brw->attribs.Point->PointSprite;
unsigned persp_mask = c->key.persp_mask;
unsigned linear_mask = c->key.linear_mask;
- fprintf(stderr, "persp_mask: %x\n", persp_mask);
- fprintf(stderr, "linear_mask: %x\n", linear_mask);
+ debug_printf("persp_mask: %x\n", persp_mask);
+ debug_printf("linear_mask: %x\n", linear_mask);
*pc_persp = 0;
*pc_linear = 0;
*pc_linear |= 0xf0;
}
- fprintf(stderr, "pc: %x\n", *pc);
- fprintf(stderr, "pc_persp: %x\n", *pc_persp);
- fprintf(stderr, "pc_linear: %x\n", *pc_linear);
+ debug_printf("pc: %x\n", *pc);
+ debug_printf("pc_persp: %x\n", *pc_persp);
+ debug_printf("pc_linear: %x\n", *pc_linear);
return is_last_attr;
struct brw_compile *p = &c->func;
unsigned i;
- fprintf(stderr, "%s START ==============\n", __FUNCTION__);
+ debug_printf("%s START ==============\n", __FUNCTION__);
c->nr_verts = 3;
alloc_regs(c);
}
}
- fprintf(stderr, "%s DONE ==============\n", __FUNCTION__);
+ debug_printf("%s DONE ==============\n", __FUNCTION__);
}
brw->attribs.VertexProgram = (struct brw_vertex_program *)vs;
brw->state.dirty.brw |= BRW_NEW_VS;
- printf("YYYYYYYYYYYYY BINDING VERTEX SHADER\n");
+ debug_printf("YYYYYYYYYYYYY BINDING VERTEX SHADER\n");
}
static void brw_delete_vs_state(struct pipe_context *pipe, void *shader)
if (!brw_pool_alloc(cache->pool, data_size, 1 << 6, &offset)) {
/* Should not be possible:
*/
- printf("brw_pool_alloc failed\n");
+ debug_printf("brw_pool_alloc failed\n");
exit(1);
}
}
if (BRW_DEBUG & DEBUG_STATE)
- printf("upload %s: %d bytes to pool buffer %p offset %x\n",
+ debug_printf("upload %s: %d bytes to pool buffer %p offset %x\n",
cache->name,
data_size,
(void*)cache->pool->buffer,
int i;
if (BRW_DEBUG & DEBUG_STATE)
- fprintf(stderr, "%s\n", __FUNCTION__);
+ debug_printf("%s\n", __FUNCTION__);
for (i = 0; i < BRW_MAX_CACHE; i++)
clear_cache(&brw->cache[i]);
size = align(size, 4);
if (pool->offset + fixup + size >= pool->size) {
- printf("%s failed\n", __FUNCTION__);
+ debug_printf("%s failed\n", __FUNCTION__);
assert(0);
exit(0);
}
void brw_invalidate_pool( struct brw_mem_pool *pool )
{
if (BRW_DEBUG & DEBUG_STATE)
- printf("\n\n\n %s \n\n\n", __FUNCTION__);
+ debug_printf("\n\n\n %s \n\n\n", __FUNCTION__);
pool->offset = 0;
* entries and the values for minimum nr of entries
* provided above.
*/
- fprintf(stderr, "couldn't calculate URB layout!\n");
+ debug_printf("couldn't calculate URB layout!\n");
exit(1);
}
if (BRW_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS))
- printf("URB CONSTRAINED\n");
+ debug_printf("URB CONSTRAINED\n");
}
else
brw->urb.constrained = 0;
if (BRW_DEBUG & DEBUG_URB)
- printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n",
+ debug_printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n",
brw->urb.vs_start,
brw->urb.gs_start,
brw->urb.clip_start,
case TGSI_OPCODE_ENDSUB:
break;
default:
- printf("Unsupport opcode %d in vertex shader\n", inst->Instruction.Opcode);
+ debug_printf("Unsupport opcode %d in vertex shader\n", inst->Instruction.Opcode);
break;
}
c->pixel_w = brw_null_reg();
- fprintf(stderr, "XXXXXXXX FP\n");
+ debug_printf("XXXXXXXX FP\n");
brw_wm_glsl_emit(c);
break;
default:
- _mesa_printf("unsupported IR in fragment shader %d\n",
+ debug_printf("unsupported IR in fragment shader %d\n",
inst->Instruction.Opcode);
}
#if 0
return COMPAREFUNC_NEVER;
}
- fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+ debug_printf("Unknown value in %s: %x\n", __FUNCTION__, func);
return COMPAREFUNC_NEVER;
}
#ifndef P_COMPILER_H
#define P_COMPILER_H
-#include <assert.h>
+
#include <stdlib.h>
#include <string.h>
-#include <stdio.h>
#if defined(_WIN32) && !defined(__WIN32__)
#ifndef PIPE_FORMAT_H
#define PIPE_FORMAT_H
+#include <stdio.h> // for sprintf
+
#include "p_compiler.h"
+#include "p_debug.h"
/**
* The PIPE_FORMAT is a 32-bit wide bitfield that encodes all the information
return (value + alignment - 1) & ~(alignment - 1);
}
-/* Convenient...
- */
-extern void _mesa_printf(const char *str, ...);
-
/* util/p_util.c
*/
#define PB_BUFFER_H_
-#include <assert.h>
-#include <stdlib.h>
-
#include "pipe/p_compiler.h"
+#include "pipe/p_debug.h"
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"
*/
-#include <assert.h>
-#include <stdlib.h>
-
#include "linked_list.h"
#include "p_compiler.h"
+#include "p_debug.h"
#include "p_winsys.h"
#include "p_thread.h"
#include "p_util.h"
#define PB_BUFFER_FENCED_H_
-#include <assert.h>
+#include "pipe/p_debug.h"
struct pipe_winsys;
*/
-#include <assert.h>
-#include <stdlib.h>
-
+#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pb_buffer.h"
*/
-#include <assert.h>
-#include <stdlib.h>
-
+#include "p_debug.h"
#include "p_util.h"
#include "pb_buffer.h"
*/
-#include <assert.h>
-
#include "linked_list.h"
#include "p_defines.h"
+#include "p_debug.h"
#include "p_thread.h"
#include "p_util.h"
#include "pb_buffer.h"
static void
mmDumpMemInfo(const struct mem_block *heap)
{
- fprintf(stderr, "Memory heap %p:\n", (void *)heap);
+ debug_printf("Memory heap %p:\n", (void *)heap);
if (heap == 0) {
- fprintf(stderr, " heap == 0\n");
+ debug_printf(" heap == 0\n");
} else {
const struct mem_block *p;
for(p = heap->next; p != heap; p = p->next) {
- fprintf(stderr, " Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
+ debug_printf(" Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
p->free ? 'F':'.',
p->reserved ? 'R':'.');
}
- fprintf(stderr, "\nFree list:\n");
+ debug_printf("\nFree list:\n");
for(p = heap->next_free; p != heap; p = p->next_free) {
- fprintf(stderr, " FREE Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
+ debug_printf(" FREE Offset:%08x, Size:%08x, %c%c\n",p->ofs,p->size,
p->free ? 'F':'.',
p->reserved ? 'R':'.');
}
}
- fprintf(stderr, "End of memory blocks\n");
+ debug_printf("End of memory blocks\n");
}
#endif
return 0;
if (b->free) {
- fprintf(stderr, "block already free\n");
+ debug_printf("block already free\n");
return -1;
}
if (b->reserved) {
- fprintf(stderr, "block is reserved\n");
+ debug_printf("block is reserved\n");
return -1;
}
mm_buf->block = mmAllocMem(mm->heap, size, mm->align2, 0);
if(!mm_buf->block) {
- fprintf(stderr, "warning: heap full\n");
+ debug_printf("warning: heap full\n");
#if 0
mmDumpMemInfo(mm->heap);
#endif
*/
-#include <assert.h>
-#include <stdlib.h>
-
#include "linked_list.h"
#include "p_compiler.h"
+#include "p_debug.h"
#include "p_thread.h"
#include "p_defines.h"
#include "p_util.h"
if (pool->numFree == 0) {
_glthread_UNLOCK_MUTEX(pool->mutex);
- fprintf(stderr, "warning: out of fixed size buffer objects\n");
+ debug_printf("warning: out of fixed size buffer objects\n");
return NULL;
}
if (item == &pool->free) {
_glthread_UNLOCK_MUTEX(pool->mutex);
- fprintf(stderr, "error: fixed size buffer pool corruption\n");
+ debug_printf("error: fixed size buffer pool corruption\n");
return NULL;
}
const struct vertex_header *v)
{
int i;
- fprintf(stderr, "Vertex: (%p)\n", v);
+ debug_printf("Vertex: (%p)\n", v);
for (i = 0; i < setup->quad.nr_attrs; i++) {
- fprintf(stderr, " %d: %f %f %f %f\n", i,
+ debug_printf(" %d: %f %f %f %f\n", i,
v->data[i][0], v->data[i][1], v->data[i][2], v->data[i][3]);
}
}
const struct vertex_header *v2 = prim->v[2];
#if DEBUG_VERTS
- fprintf(stderr, "Triangle:\n");
+ debug_printf("Triangle:\n");
print_vertex(setup, v0);
print_vertex(setup, v1);
print_vertex(setup, v2);
setup->oneoverarea = 1.0f / area;
/*
- _mesa_printf("%s one-over-area %f area %f det %f\n",
+ debug_printf("%s one-over-area %f area %f det %f\n",
__FUNCTION__, setup->oneoverarea, area, prim->det );
*/
}
dady * (setup->vmin->data[0][1] - 0.5f)));
/*
- _mesa_printf("attr[%d].%c: %f dx:%f dy:%f\n",
+ debug_printf("attr[%d].%c: %f dx:%f dy:%f\n",
slot, "xyzw"[i],
setup->coef[slot].a0[i],
setup->coef[slot].dadx[i],
float dady = b * setup->oneoverarea;
/*
- printf("tri persp %d,%d: %f %f %f\n", vertSlot, i,
- setup->vmin->data[vertSlot][i],
- setup->vmid->data[vertSlot][i],
- setup->vmax->data[vertSlot][i]
+ debug_printf("tri persp %d,%d: %f %f %f\n", vertSlot, i,
+ setup->vmin->data[vertSlot][i],
+ setup->vmid->data[vertSlot][i],
+ setup->vmax->data[vertSlot][i]
);
*/
assert(i <= 3);
finish_y -= sy;
/*
- _mesa_printf("%s %d %d\n", __FUNCTION__, start_y, finish_y);
+ debug_printf("%s %d %d\n", __FUNCTION__, start_y, finish_y);
*/
for (y = start_y; y < finish_y; y++) {
struct setup_stage *setup = setup_stage( stage );
/*
- _mesa_printf("%s\n", __FUNCTION__ );
+ debug_printf("%s\n", __FUNCTION__ );
*/
setup_sort_vertices( setup, prim );
int ix, iy;
/*
- printf("(%f, %f) -> X:%d..%d Y:%d..%d\n", x, y, xmin, xmax,ymin,ymax);
+ debug_printf("(%f, %f) -> X:%d..%d Y:%d..%d\n", x, y, xmin, xmax,ymin,ymax);
*/
for (iy = iymin; iy <= iymax; iy += 2) {
uint rowMask = 0xf;
inputs[2][0][1] = fy + 1.0f;
inputs[3][0][1] = fy + 1.0f;
#if DLLVM
- printf("MASK = %d\n", quad->mask);
+ debug_printf("MASK = %d\n", quad->mask);
#endif
gallivm_prog_inputs_interpolate(llvm, inputs, quad->coef);
#if DLLVM
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 2; ++j) {
- printf("IN(%d,%d) [%f %f %f %f]\n", i, j,
+ debug_printf("IN(%d,%d) [%f %f %f %f]\n", i, j,
inputs[i][j][0], inputs[i][j][1], inputs[i][j][2], inputs[i][j][3]);
}
}
softpipe->mapped_constants[PIPE_SHADER_FRAGMENT],
qss->samplers);
#if DLLVM
- printf("OUT LLVM = 1[%f %f %f %f], 2[%f %f %f %f]\n",
+ debug_printf("OUT LLVM = 1[%f %f %f %f], 2[%f %f %f %f]\n",
dests[0][0][0], dests[0][0][1], dests[0][0][2], dests[0][0][3],
dests[0][1][0], dests[0][1][1], dests[0][1][2], dests[0][1][3]);
#endif
}
#if DLLVM
for (int i = 0; i < QUAD_SIZE; ++i) {
- printf("QLLVM%d(%d) [%f, %f, %f, %f]\n", i, qss->colorOutSlot,
+ debug_printf("QLLVM%d(%d) [%f, %f, %f, %f]\n", i, qss->colorOutSlot,
quad->outputs.color[0][i],
quad->outputs.color[1][i],
quad->outputs.color[2][i],
}
}
#if DLLVM
- printf("D [%f, %f, %f, %f] mask = %d\n",
+ debug_printf("D [%f, %f, %f, %f] mask = %d\n",
quad->outputs.depth[0],
quad->outputs.depth[1],
quad->outputs.depth[2],
}
}
#if 0
- printf("num cleared: %u\n", numCleared);
+ debug_printf("num cleared: %u\n", numCleared);
#endif
}
#endif
#if 0
- printf("flushed tiles in use: %d\n", inuse);
+ debug_printf("flushed tiles in use: %d\n", inuse);
#endif
}
k = tgsi_parse_init( &parse, mach->Tokens );
if (k != TGSI_PARSE_OK) {
- fprintf(stderr, "Problem parsing!\n");
+ debug_printf("Problem parsing!\n");
return;
}
k = tgsi_parse_init (&parse, mach->Tokens);
if (k != TGSI_PARSE_OK) {
- fprintf( stderr, "Problem parsing!\n" );
+ debug_printf( "Problem parsing!\n" );
return;
}
uint chan_index;
float lodBias;
- /* printf("Sampler %u unit %u\n", sampler, unit); */
+ /* debug_printf("Sampler %u unit %u\n", sampler, unit); */
switch (inst->InstructionExtTexture.Texture) {
case TGSI_TEXTURE_1D:
case file_REG32:
switch( reg.idx ) {
case reg_AX:
- printf( "EAX" );
+ debug_printf( "EAX" );
break;
case reg_CX:
- printf( "ECX" );
+ debug_printf( "ECX" );
break;
case reg_DX:
- printf( "EDX" );
+ debug_printf( "EDX" );
break;
case reg_BX:
- printf( "EBX" );
+ debug_printf( "EBX" );
break;
case reg_SP:
- printf( "ESP" );
+ debug_printf( "ESP" );
break;
case reg_BP:
- printf( "EBP" );
+ debug_printf( "EBP" );
break;
case reg_SI:
- printf( "ESI" );
+ debug_printf( "ESI" );
break;
case reg_DI:
- printf( "EDI" );
+ debug_printf( "EDI" );
break;
}
break;
assert( 0 );
break;
case file_XMM:
- printf( "XMM%u", reg.idx );
+ debug_printf( "XMM%u", reg.idx );
break;
case file_x87:
assert( 0 );
unsigned count = 10 - strlen( op );
while( count-- ) {
- printf( " " );
+ debug_printf( " " );
}
}
-#define DUMP_START() printf( "\nsse-dump start ----------------" )
-#define DUMP_END() printf( "\nsse-dump end ----------------\n" )
-#define DUMP( OP ) printf( "\n%s", OP )
+#define DUMP_START() debug_printf( "\nsse-dump start ----------------" )
+#define DUMP_END() debug_printf( "\nsse-dump end ----------------\n" )
+#define DUMP( OP ) debug_printf( "\n%s", OP )
#define DUMP_I( OP, I ) do {\
- printf( "\n%s", OP );\
+ debug_printf( "\n%s", OP );\
_fill( OP );\
- printf( "%u", I ); } while( 0 )
+ debug_printf( "%u", I ); } while( 0 )
#define DUMP_R( OP, R0 ) do {\
- printf( "\n%s", OP );\
+ debug_printf( "\n%s", OP );\
_fill( OP );\
_print_reg( R0 ); } while( 0 )
#define DUMP_RR( OP, R0, R1 ) do {\
- printf( "\n%s", OP );\
+ debug_printf( "\n%s", OP );\
_fill( OP );\
_print_reg( R0 );\
- printf( ", " );\
+ debug_printf( ", " );\
_print_reg( R1 ); } while( 0 )
#define DUMP_RRI( OP, R0, R1, I ) do {\
- printf( "\n%s", OP );\
+ debug_printf( "\n%s", OP );\
_fill( OP );\
_print_reg( R0 );\
- printf( ", " );\
+ debug_printf( ", " );\
_print_reg( R1 );\
- printf( ", " );\
- printf( "%u", I ); } while( 0 )
+ debug_printf( ", " );\
+ debug_printf( "%u", I ); } while( 0 )
#else
+#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi_build.h"
*
**************************************************************************/
+#include <stdio.h>
+
+#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi_dump.h"
*
**************************************************************************/
+#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi_parse.h"
+#include "pipe/p_debug.h"
#include "pipe/p_util.h"
#include "pipe/p_shader_tokens.h"
#include "tgsi_parse.h"