From 97e63437dc216c7fdb25220655ecbf26042cfec8 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 20 Oct 2008 13:03:45 +0100 Subject: mesa: note that texcoords are generated by setup routines when pointsprite enabled --- src/mesa/main/texenvprogram.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/mesa/main') diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index f3bac86dfe..c279956f2a 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -221,6 +221,12 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) /* Fixed function logic */ GLbitfield varying_inputs = ctx->varying_vp_inputs; + /* These get generated in the setup routine regardless of the + * vertex program: + */ + if (ctx->Point.PointSprite) + varying_inputs |= FRAG_BITS_TEX_ANY; + /* First look at what values may be computed by the generated * vertex program: */ @@ -248,6 +254,12 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) /* calculate from vp->outputs */ GLbitfield vp_outputs = ctx->VertexProgram._Current->Base.OutputsWritten; + /* These get generated in the setup routine regardless of the + * vertex program: + */ + if (ctx->Point.PointSprite) + vp_outputs |= FRAG_BITS_TEX_ANY; + if (vp_outputs & (1 << VERT_RESULT_COL0)) fp_inputs |= FRAG_BIT_COL0; if (vp_outputs & (1 << VERT_RESULT_COL1)) fp_inputs |= FRAG_BIT_COL1; -- cgit v1.2.3 From b3cfcd326b1bc21ce163c5b05288cbff5f909cd9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 1 Nov 2008 10:57:25 -0600 Subject: mesa: additional debug flags for glsl debug/disassembly --- src/mesa/main/debug.c | 54 ++++++++++++++++++-------------------- src/mesa/main/mtypes.h | 4 ++- src/mesa/shader/slang/slang_link.c | 39 ++++++++++++++------------- src/mesa/shader/slang/slang_log.c | 9 ++++--- 4 files changed, 53 insertions(+), 53 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 98ca65b96a..77fef32558 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -150,36 +150,32 @@ void _mesa_print_info( void ) static void add_debug_flags( const char *debug ) { #ifdef DEBUG - if (_mesa_strstr(debug, "varray")) - MESA_VERBOSE |= VERBOSE_VARRAY; - - if (_mesa_strstr(debug, "tex")) - MESA_VERBOSE |= VERBOSE_TEXTURE; - - if (_mesa_strstr(debug, "imm")) - MESA_VERBOSE |= VERBOSE_IMMEDIATE; - - if (_mesa_strstr(debug, "pipe")) - MESA_VERBOSE |= VERBOSE_PIPELINE; - - if (_mesa_strstr(debug, "driver")) - MESA_VERBOSE |= VERBOSE_DRIVER; - - if (_mesa_strstr(debug, "state")) - MESA_VERBOSE |= VERBOSE_STATE; - - if (_mesa_strstr(debug, "api")) - MESA_VERBOSE |= VERBOSE_API; - - if (_mesa_strstr(debug, "list")) - MESA_VERBOSE |= VERBOSE_DISPLAY_LIST; - - if (_mesa_strstr(debug, "lighting")) - MESA_VERBOSE |= VERBOSE_LIGHTING; + struct debug_option { + const char *name; + GLbitfield flag; + }; + static const struct debug_option debug_opt[] = { + { "varray", VERBOSE_VARRAY }, + { "tex", VERBOSE_TEXTURE }, + { "imm", VERBOSE_IMMEDIATE }, + { "pipe", VERBOSE_PIPELINE }, + { "driver", VERBOSE_DRIVER }, + { "state", VERBOSE_STATE }, + { "api", VERBOSE_API }, + { "list", VERBOSE_DISPLAY_LIST }, + { "lighting", VERBOSE_LIGHTING }, + { "disassem", VERBOSE_DISASSEM }, + { "glsl", VERBOSE_GLSL }, /* report GLSL compile/link errors */ + { "glsl_dump", VERBOSE_GLSL_DUMP } /* print shader GPU instructions */ + }; + GLuint i; + + MESA_VERBOSE = 0x0; + for (i = 0; i < Elements(debug_opt); i++) { + if (_mesa_strstr(debug, debug_opt[i].name)) + MESA_VERBOSE |= debug_opt[i].flag; + } - if (_mesa_strstr(debug, "disassem")) - MESA_VERBOSE |= VERBOSE_DISASSEM; - /* Debug flag: */ if (_mesa_strstr(debug, "flush")) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index fab6ad05ee..732de2bb43 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3162,7 +3162,9 @@ enum _verbose VERBOSE_LIGHTING = 0x0200, VERBOSE_PRIMS = 0x0400, VERBOSE_VERTS = 0x0800, - VERBOSE_DISASSEM = 0x1000 + VERBOSE_DISASSEM = 0x1000, + VERBOSE_GLSL = 0x2000, + VERBOSE_GLSL_DUMP = 0x4000 }; diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 202080d9d4..5c8b626ea7 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -219,6 +219,7 @@ link_uniform_vars(struct gl_shader_program *shProg, inst->Sampler, map[ inst->Sampler ]); */ /* here, texUnit is really samplerUnit */ + assert(inst->TexSrcUnit < MAX_SAMPLERS); inst->TexSrcUnit = samplerMap[inst->TexSrcUnit]; prog->SamplerTargets[inst->TexSrcUnit] = inst->TexSrcTarget; prog->SamplersUsed |= (1 << inst->TexSrcUnit); @@ -564,32 +565,30 @@ _slang_link(GLcontext *ctx, /* notify driver that a new fragment program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, &shProg->FragmentProgram->Base); -#if 0 - printf("************** original fragment program\n"); - _mesa_print_program(&fragProg->Base); - _mesa_print_program_parameters(ctx, &fragProg->Base); -#endif -#if 0 - printf("************** linked fragment prog\n"); - _mesa_print_program(&shProg->FragmentProgram->Base); - _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); -#endif + if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { + printf("Mesa original fragment program:\n"); + _mesa_print_program(&fragProg->Base); + _mesa_print_program_parameters(ctx, &fragProg->Base); + + printf("Mesa post-link fragment program:\n"); + _mesa_print_program(&shProg->FragmentProgram->Base); + _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); + } } if (vertProg && shProg->VertexProgram) { /* notify driver that a new vertex program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, &shProg->VertexProgram->Base); -#if 0 - printf("************** original vertex program\n"); - _mesa_print_program(&vertProg->Base); - _mesa_print_program_parameters(ctx, &vertProg->Base); -#endif -#if 0 - printf("************** linked vertex prog\n"); - _mesa_print_program(&shProg->VertexProgram->Base); - _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); -#endif + if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { + printf("Mesa original vertex program:\n"); + _mesa_print_program(&vertProg->Base); + _mesa_print_program_parameters(ctx, &vertProg->Base); + + printf("Mesa post-link vertex program:\n"); + _mesa_print_program(&shProg->VertexProgram->Base); + _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); + } } shProg->LinkStatus = (shProg->VertexProgram || shProg->FragmentProgram); diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index 01591ceba5..dc838c72ad 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -23,6 +23,7 @@ */ #include "main/imports.h" +#include "main/context.h" #include "slang_log.h" #include "slang_utility.h" @@ -86,9 +87,11 @@ slang_info_log_message(slang_info_log * log, const char *prefix, } slang_string_concat(log->text, msg); slang_string_concat(log->text, "\n"); -#if 0 /* debug */ - _mesa_printf("Mesa GLSL error/warning: %s\n", log->text); -#endif + + if (MESA_VERBOSE & VERBOSE_GLSL) { + _mesa_printf("Mesa: GLSL %s\n", log->text); + } + return 1; } -- cgit v1.2.3