summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2007-03-20 15:05:35 +1100
committerBen Skeggs <skeggsb@gmail.com>2007-03-20 16:08:01 +1100
commit9622a634f61f02ed1a23087762a2ec8a305ae77e (patch)
treef162e0e1c50a1fc6d48cb404ddf7bd3ae268582e
parent61821a41c07b6b383a275acf31ade56af2ecfb3c (diff)
nouveau: NVSDBG macro
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader.c12
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader.h6
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader_0.c2
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader_1.c2
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader_2.c2
5 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader.c b/src/mesa/drivers/dri/nouveau/nouveau_shader.c
index ba471325aa..9cb837ff3b 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_shader.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader.c
@@ -48,6 +48,7 @@
static void
nouveauBindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
+ NVSDBG("target=%s, prog=%p\n", _mesa_lookup_enum_by_nr(target), prog);
}
static struct gl_program *
@@ -55,7 +56,10 @@ nouveauNewProgram(GLcontext *ctx, GLenum target, GLuint id)
{
nouveauShader *nvs;
+ NVSDBG("target=%s, id=%d\n", _mesa_lookup_enum_by_nr(target), id);
+
nvs = CALLOC_STRUCT(_nouveauShader);
+ NVSDBG("prog=%p\n", nvs);
switch (target) {
case GL_VERTEX_PROGRAM_ARB:
return _mesa_init_vertex_program(ctx, &nvs->mesa.vp, target, id);
@@ -75,6 +79,8 @@ nouveauDeleteProgram(GLcontext *ctx, struct gl_program *prog)
{
nouveauShader *nvs = (nouveauShader *)prog;
+ NVSDBG("prog=%p\n", prog);
+
if (nvs->translated)
FREE(nvs->program);
_mesa_delete_program(ctx, prog);
@@ -86,6 +92,8 @@ nouveauProgramStringNotify(GLcontext *ctx, GLenum target,
{
nouveauShader *nvs = (nouveauShader *)prog;
+ NVSDBG("target=%s, prog=%p\n", _mesa_lookup_enum_by_nr(target), prog);
+
if (nvs->translated)
FREE(nvs->program);
nvs->translated = 0;
@@ -98,6 +106,8 @@ nouveauIsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog)
{
nouveauShader *nvs = (nouveauShader *)prog;
+ NVSDBG("target=%s, prog=%p\n", _mesa_lookup_enum_by_nr(target), prog);
+
return nvs->translated;
}
@@ -108,6 +118,8 @@ nvsUpdateShader(GLcontext *ctx, nouveauShader *nvs)
struct gl_program_parameter_list *plist;
int i;
+ NVSDBG("prog=%p\n", nvs);
+
/* Translate to HW format now if necessary */
if (!nvs->translated) {
/* Mesa ASM shader -> nouveauShader */
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader.h b/src/mesa/drivers/dri/nouveau/nouveau_shader.h
index b2df3546f6..56ae270764 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_shader.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader.h
@@ -4,6 +4,12 @@
#include "mtypes.h"
#include "bufferobj.h"
+#define NVSDBG(fmt, args...) do { \
+ if (NOUVEAU_DEBUG & DEBUG_SHADERS) { \
+ fprintf(stderr, "%s: "fmt, __func__, ##args); \
+ } \
+} while(0)
+
typedef struct _nvsFunc nvsFunc;
#define NVS_MAX_TEMPS 32
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader_0.c b/src/mesa/drivers/dri/nouveau/nouveau_shader_0.c
index 211483dc02..0308a6c397 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_shader_0.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader_0.c
@@ -974,6 +974,8 @@ nouveau_shader_pass0(GLcontext *ctx, nouveauShader *nvs)
struct pass0_rec *rec;
int ret = GL_FALSE;
+ NVSDBG("start: nvs=%p\n", nvs);
+
rec = CALLOC_STRUCT(pass0_rec);
if (!rec)
return GL_FALSE;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader_1.c b/src/mesa/drivers/dri/nouveau/nouveau_shader_1.c
index 90c57d3807..78c1401f7d 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_shader_1.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader_1.c
@@ -2,11 +2,13 @@
#include "macros.h"
#include "enums.h"
+#include "nouveau_context.h"
#include "nouveau_shader.h"
GLboolean
nouveau_shader_pass1(nvsPtr nvs)
{
+ NVSDBG("start: nvs=%p\n", nvs);
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c b/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c
index b043f877e4..130ef35e57 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader_2.c
@@ -209,6 +209,8 @@ nouveau_shader_pass2(nvsPtr nvs)
struct pass2_rec *rec;
int i;
+ NVSDBG("start: nvs=%p\n", nvs);
+
rec = calloc(1, sizeof(struct pass2_rec));
for (i=0; i<NVS_MAX_TEMPS; i++)
rec->temps[i] = -1;