summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-02-06 10:00:34 -0700
committerBrian Paul <[email protected]>2009-02-06 10:00:34 -0700
commitaafcc26642d5243944a1abb816c2657f644c0649 (patch)
treed01e92f80033b7db995581afcc1fdd45d572971d /src/mesa/shader
parentb2e779988eeb595187933fe2122d86f8ccfe059c (diff)
Revert "mesa: meaningless whitespace change to see if git's working (ignore)"
This reverts commit b2e779988eeb595187933fe2122d86f8ccfe059c. I didn't mean to push this stuff yet. I'm having a bad git day...
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/shader_api.c62
-rw-r--r--src/mesa/shader/slang/slang_compile.c18
-rw-r--r--src/mesa/shader/slang/slang_link.c20
-rw-r--r--src/mesa/shader/slang/slang_log.c6
4 files changed, 15 insertions, 91 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index fb2a7e54fe6..acee34dc5bc 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -370,31 +370,6 @@ _mesa_lookup_shader_err(GLcontext *ctx, GLuint name, const char *caller)
}
-/**
- * Return mask of GLSL_x flags by examining the MESA_GLSL env var.
- */
-static GLbitfield
-get_shader_flags(void)
-{
- GLbitfield flags = 0x0;
- const char *env = _mesa_getenv("MESA_GLSL");
-
- if (env) {
- if (_mesa_strstr(env, "dump"))
- flags |= GLSL_DUMP;
- if (_mesa_strstr(env, "log"))
- flags |= GLSL_LOG;
- if (_mesa_strstr(env, "nopt"))
- flags |= GLSL_NO_OPT;
- else if (_mesa_strstr(env, "opt"))
- flags |= GLSL_OPT;
- if (_mesa_strstr(env, "uniform"))
- flags |= GLSL_UNIFORMS;
- }
-
- return flags;
-}
-
/**
* Initialize context's shader state.
@@ -408,7 +383,6 @@ _mesa_init_shader_state(GLcontext * ctx)
ctx->Shader.EmitHighLevelInstructions = GL_TRUE;
ctx->Shader.EmitCondCodes = GL_TRUE; /* XXX probably want GL_FALSE... */
ctx->Shader.EmitComments = GL_FALSE;
- ctx->Shader.Flags = get_shader_flags();
}
@@ -1639,7 +1613,6 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
struct gl_shader_program *shProg = ctx->Shader.CurrentProgram;
struct gl_uniform *uniform;
GLint elems, offset;
- GLenum basicType;
if (!shProg || !shProg->LinkStatus) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)");
@@ -1663,35 +1636,19 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
switch (type) {
case GL_FLOAT:
- basicType = GL_FLOAT;
- elems = 1;
- break;
case GL_INT:
- basicType = GL_INT;
elems = 1;
break;
case GL_FLOAT_VEC2:
- basicType = GL_FLOAT;
- elems = 2;
- break;
case GL_INT_VEC2:
- basicType = GL_INT;
elems = 2;
break;
case GL_FLOAT_VEC3:
- basicType = GL_FLOAT;
- elems = 3;
- break;
case GL_INT_VEC3:
- basicType = GL_INT;
elems = 3;
break;
case GL_FLOAT_VEC4:
- basicType = GL_FLOAT;
- elems = 4;
- break;
case GL_INT_VEC4:
- basicType = GL_INT;
elems = 4;
break;
default:
@@ -1703,25 +1660,6 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
uniform = &shProg->Uniforms->Uniforms[location];
- if (ctx->Shader.Flags & GLSL_UNIFORMS) {
- GLint i;
- _mesa_printf("Mesa: set program %u uniform %s (loc %d) to: ",
- shProg->Name, uniform->Name, location);
- if (basicType == GL_INT) {
- const GLint *v = (const GLint *) values;
- for (i = 0; i < count * elems; i++) {
- _mesa_printf("%d ", v[i]);
- }
- }
- else {
- const GLfloat *v = (const GLfloat *) values;
- for (i = 0; i < count * elems; i++) {
- _mesa_printf("%g ", v[i]);
- }
- }
- _mesa_printf("\n");
- }
-
/* A uniform var may be used by both a vertex shader and a fragment
* shader. We may need to update one or both shader's uniform here:
*/
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 0c7881dd19b..40460e0c7ee 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -32,7 +32,6 @@
#include "main/context.h"
#include "shader/program.h"
#include "shader/programopt.h"
-#include "shader/prog_optimize.h"
#include "shader/prog_print.h"
#include "shader/prog_parameter.h"
#include "shader/grammar/grammar_mesa.h"
@@ -2795,22 +2794,11 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader)
_mesa_print_program(shader->Program);
#endif
- if (success) {
- if ((ctx->Shader.Flags & GLSL_NO_OPT) == 0) {
- if ((ctx->Shader.Flags & GLSL_OPT) || shader->Pragmas.Optimize) {
- /* apply program optimizations */
- _mesa_remove_extra_moves(shader->Program);
- _mesa_remove_dead_code(shader->Program);
- _mesa_consolidate_registers(shader->Program);
- }
- }
- }
-
shader->CompileStatus = success;
- if (ctx->Shader.Flags & GLSL_LOG) {
- _mesa_write_shader_to_file(shader);
- }
+#if 0
+ _mesa_write_shader_to_file(shader);
+#endif
return success;
}
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 4ee1beccd46..77bcda08716 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -675,12 +675,12 @@ _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 (ctx->Shader.Flags & GLSL_DUMP) {
- _mesa_printf("Mesa original fragment program:\n");
+ if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) {
+ printf("Mesa original fragment program:\n");
_mesa_print_program(&fragProg->Base);
_mesa_print_program_parameters(ctx, &fragProg->Base);
- _mesa_printf("Mesa post-link fragment program:\n");
+ printf("Mesa post-link fragment program:\n");
_mesa_print_program(&shProg->FragmentProgram->Base);
_mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base);
}
@@ -693,26 +693,22 @@ _slang_link(GLcontext *ctx,
/* notify driver that a new vertex program has been compiled/linked */
ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB,
&shProg->VertexProgram->Base);
- if (ctx->Shader.Flags & GLSL_DUMP) {
- _mesa_printf("Mesa original vertex program:\n");
+ if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) {
+ printf("Mesa original vertex program:\n");
_mesa_print_program(&vertProg->Base);
_mesa_print_program_parameters(ctx, &vertProg->Base);
- _mesa_printf("Mesa post-link vertex program:\n");
+ printf("Mesa post-link vertex program:\n");
_mesa_print_program(&shProg->VertexProgram->Base);
_mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base);
}
}
- if (ctx->Shader.Flags & GLSL_DUMP) {
- _mesa_printf("Varying vars:\n");
+ if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) {
+ printf("Varying vars:\n");
_mesa_print_parameter_list(shProg->Varying);
- if (shProg->InfoLog) {
- _mesa_printf("Info Log: %s\n", shProg->InfoLog);
- }
}
-
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 30729ba8d52..d5576d7ee2d 100644
--- a/src/mesa/shader/slang/slang_log.c
+++ b/src/mesa/shader/slang/slang_log.c
@@ -77,11 +77,13 @@ slang_info_log_message(slang_info_log * log, const char *prefix,
slang_string_concat(log->text, msg);
slang_string_concat(log->text, "\n");
+ if (MESA_VERBOSE & VERBOSE_GLSL) {
+ _mesa_printf("Mesa: GLSL %s", log->text);
+ }
+
return 1;
}
-#define EXIT_SUCCESS 13
-
int
slang_info_log_print(slang_info_log * log, const char *msg, ...)
{