From cb0de06301cd086a02ca709917819119dc1a8fd9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Sep 2009 10:22:32 -0600 Subject: mesa: added nopfrag/nopvert options for MESA_GLSL These options can be used to force vertex/fragment shaders to be no-op shaders (actually, simple pass-through shaders). For debug/test purposes. --- src/mesa/shader/slang/slang_compile.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mesa/shader/slang/slang_compile.c') diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index c1b97c7cb70..a2708884437 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2814,6 +2814,16 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) (ctx->Shader.Flags & GLSL_NO_OPT) == 0) { _mesa_optimize_program(ctx, shader->Program); } + if ((ctx->Shader.Flags & GLSL_NOP_VERT) && + shader->Program->Target == GL_VERTEX_PROGRAM_ARB) { + _mesa_nop_vertex_program(ctx, + (struct gl_vertex_program *) shader->Program); + } + if ((ctx->Shader.Flags & GLSL_NOP_FRAG) && + shader->Program->Target == GL_FRAGMENT_PROGRAM_ARB) { + _mesa_nop_fragment_program(ctx, + (struct gl_fragment_program *) shader->Program); + } } if (ctx->Shader.Flags & GLSL_LOG) { -- cgit v1.2.3