diff options
author | Brian Paul <[email protected]> | 2008-11-05 15:58:09 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-11-05 15:58:09 -0700 |
commit | 80a718a63bf2fa817e346f0f5731ee9ef2e0e68b (patch) | |
tree | 4a1bdb03ae8b8482b9a15e56c9604fcc34e95b0e /src/mesa/state_tracker/st_draw.c | |
parent | 7115b79b77e541f3eb81db00f6f0c34a0f224feb (diff) | |
parent | de14fdd63f26a2e6fc55fad92c08966f269601a6 (diff) |
Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts:
src/gallium/auxiliary/rtasm/rtasm_execmem.c
src/mesa/shader/slang/slang_emit.c
src/mesa/shader/slang/slang_log.c
src/mesa/state_tracker/st_atom_framebuffer.c
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 61949a93884..7cf06da43cc 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -33,6 +33,7 @@ #include "main/imports.h" #include "main/image.h" #include "main/macros.h" +#include "shader/prog_uniform.h" #include "vbo/vbo.h" @@ -483,6 +484,28 @@ setup_non_interleaved_attribs(GLcontext *ctx, +/** + * Prior to drawing, check that any uniforms referenced by the + * current shader have been set. If a uniform has not been set, + * issue a warning. + */ +static void +check_uniforms(GLcontext *ctx) +{ + const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; + if (shProg && shProg->LinkStatus) { + GLuint i; + for (i = 0; i < shProg->Uniforms->NumUniforms; i++) { + const struct gl_uniform *u = &shProg->Uniforms->Uniforms[i]; + if (!u->Initialized) { + _mesa_warning(ctx, + "Using shader with uninitialized uniform: %s", + u->Name); + } + } + } +} + /** * This function gets plugged into the VBO module and is called when @@ -516,6 +539,10 @@ st_draw_vbo(GLcontext *ctx, vp = ctx->st->vp; vs = &ctx->st->vp->state; + if (MESA_VERBOSE & VERBOSE_GLSL) { + check_uniforms(ctx); + } + /* * Setup the vbuffer[] and velements[] arrays. */ @@ -557,6 +584,9 @@ st_draw_vbo(GLcontext *ctx, pipe->set_vertex_buffers(pipe, num_vbuffers, vbuffer); pipe->set_vertex_elements(pipe, num_velements, velements); + if (num_vbuffers == 0 || num_velements == 0) + return; + /* do actual drawing */ if (ib) { /* indexed primitive */ |