mesa: Branch 'glsl-compiler-1' - 6 commits

Brian Paul brianp at kemper.freedesktop.org
Sun Feb 11 21:18:15 UTC 2007


 src/mesa/shader/prog_debug.c          |  265 ++++++++++++++++++++++++++++++++++
 src/mesa/shader/prog_debug.h          |   44 +++++
 src/mesa/shader/prog_parameter.c      |    4 
 src/mesa/shader/program.c             |  250 --------------------------------
 src/mesa/shader/program.h             |   17 --
 src/mesa/shader/slang/slang_codegen.c |    2 
 src/mesa/shader/slang/slang_emit.c    |   22 ++
 src/mesa/sources                      |    1 
 8 files changed, 340 insertions(+), 265 deletions(-)

New commits:
diff-tree 5620392d67278714f7c2a5ccc3101334ac35ab3f (from 942ee025908a95afc57990c57d6754ca1a626b04)
Author: Brian <brian at nostromo.localnet.net>
Date:   Fri Feb 9 15:40:15 2007 -0700

    add prog_debug.c

diff --git a/src/mesa/sources b/src/mesa/sources
index 4d8055b..b35e56a 100644
--- a/src/mesa/sources
+++ b/src/mesa/sources
@@ -158,6 +158,7 @@ SHADER_SOURCES = \
 	shader/nvvertexec.c \
 	shader/nvvertparse.c \
 	shader/program.c \
+	shader/prog_debug.c \
 	shader/prog_instruction.c \
 	shader/prog_parameter.c \
 	shader/prog_print.c \
diff-tree 942ee025908a95afc57990c57d6754ca1a626b04 (from 383ecc0374582900016c6411aff65d27829f876d)
Author: Brian <brian at nostromo.localnet.net>
Date:   Fri Feb 9 15:40:00 2007 -0700

    move GL_MESA_program_debug funcs to prog_debug.c

diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 7a31949..ae26c3c 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.2
+ * Version:  6.5.3
  *
- * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -32,25 +32,13 @@
 #include "glheader.h"
 #include "context.h"
 #include "hash.h"
-#include "imports.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "nvfragparse.h"
 #include "program.h"
 #include "prog_parameter.h"
 #include "prog_instruction.h"
-#include "prog_statevars.h"
-#include "nvvertparse.h"
-#include "atifragshader.h"
 
 
-
-/**********************************************************************/
-/* Utility functions                                                  */
-/**********************************************************************/
-
-
-/* A pointer to this dummy program is put into the hash table when
+/**
+ * A pointer to this dummy program is put into the hash table when
  * glGenPrograms is called.
  */
 struct gl_program _mesa_DummyProgram;
@@ -629,233 +617,3 @@ _mesa_GenPrograms(GLsizei n, GLuint *ids
       ids[i] = first + i;
    }
 }
-
-
-/**********************************************************************/
-/* GL_MESA_program_debug extension                                    */
-/**********************************************************************/
-
-
-/* XXX temporary */
-GLAPI void GLAPIENTRY
-glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
-                      GLvoid *data)
-{
-   _mesa_ProgramCallbackMESA(target, callback, data);
-}
-
-
-void
-_mesa_ProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
-                          GLvoid *data)
-{
-   GET_CURRENT_CONTEXT(ctx);
-
-   switch (target) {
-      case GL_FRAGMENT_PROGRAM_ARB:
-         if (!ctx->Extensions.ARB_fragment_program) {
-            _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
-            return;
-         }
-         ctx->FragmentProgram.Callback = callback;
-         ctx->FragmentProgram.CallbackData = data;
-         break;
-      case GL_FRAGMENT_PROGRAM_NV:
-         if (!ctx->Extensions.NV_fragment_program) {
-            _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
-            return;
-         }
-         ctx->FragmentProgram.Callback = callback;
-         ctx->FragmentProgram.CallbackData = data;
-         break;
-      case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
-         if (!ctx->Extensions.ARB_vertex_program &&
-             !ctx->Extensions.NV_vertex_program) {
-            _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
-            return;
-         }
-         ctx->VertexProgram.Callback = callback;
-         ctx->VertexProgram.CallbackData = data;
-         break;
-      default:
-         _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
-         return;
-   }
-}
-
-
-/* XXX temporary */
-GLAPI void GLAPIENTRY
-glGetProgramRegisterfvMESA(GLenum target,
-                           GLsizei len, const GLubyte *registerName,
-                           GLfloat *v)
-{
-   _mesa_GetProgramRegisterfvMESA(target, len, registerName, v);
-}
-
-
-void
-_mesa_GetProgramRegisterfvMESA(GLenum target,
-                               GLsizei len, const GLubyte *registerName,
-                               GLfloat *v)
-{
-   char reg[1000];
-   GET_CURRENT_CONTEXT(ctx);
-
-   /* We _should_ be inside glBegin/glEnd */
-#if 0
-   if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) {
-      _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramRegisterfvMESA");
-      return;
-   }
-#endif
-
-   /* make null-terminated copy of registerName */
-   len = MIN2((unsigned int) len, sizeof(reg) - 1);
-   _mesa_memcpy(reg, registerName, len);
-   reg[len] = 0;
-
-   switch (target) {
-      case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
-         if (!ctx->Extensions.ARB_vertex_program &&
-             !ctx->Extensions.NV_vertex_program) {
-            _mesa_error(ctx, GL_INVALID_ENUM,
-                        "glGetProgramRegisterfvMESA(target)");
-            return;
-         }
-         if (!ctx->VertexProgram._Enabled) {
-            _mesa_error(ctx, GL_INVALID_OPERATION,
-                        "glGetProgramRegisterfvMESA");
-            return;
-         }
-         /* GL_NV_vertex_program */
-         if (reg[0] == 'R') {
-            /* Temp register */
-            GLint i = _mesa_atoi(reg + 1);
-            if (i >= (GLint)ctx->Const.VertexProgram.MaxTemps) {
-               _mesa_error(ctx, GL_INVALID_VALUE,
-                           "glGetProgramRegisterfvMESA(registerName)");
-               return;
-            }
-#if 0 /* FIX ME */
-            ctx->Driver.GetVertexProgramRegister(ctx, PROGRAM_TEMPORARY, i, v);
-#endif
-         }
-         else if (reg[0] == 'v' && reg[1] == '[') {
-            /* Vertex Input attribute */
-            GLuint i;
-            for (i = 0; i < ctx->Const.VertexProgram.MaxAttribs; i++) {
-               const char *name = _mesa_nv_vertex_input_register_name(i);
-               char number[10];
-               _mesa_sprintf(number, "%d", i);
-               if (_mesa_strncmp(reg + 2, name, 4) == 0 ||
-                   _mesa_strncmp(reg + 2, number, _mesa_strlen(number)) == 0) {
-#if 0 /* FIX ME */
-                  ctx->Driver.GetVertexProgramRegister(ctx, PROGRAM_INPUT,
-                                                       i, v);
-#endif
-                  return;
-               }
-            }
-            _mesa_error(ctx, GL_INVALID_VALUE,
-                        "glGetProgramRegisterfvMESA(registerName)");
-            return;
-         }
-         else if (reg[0] == 'o' && reg[1] == '[') {
-            /* Vertex output attribute */
-         }
-         /* GL_ARB_vertex_program */
-         else if (_mesa_strncmp(reg, "vertex.", 7) == 0) {
-
-         }
-         else {
-            _mesa_error(ctx, GL_INVALID_VALUE,
-                        "glGetProgramRegisterfvMESA(registerName)");
-            return;
-         }
-         break;
-      case GL_FRAGMENT_PROGRAM_ARB:
-         if (!ctx->Extensions.ARB_fragment_program) {
-            _mesa_error(ctx, GL_INVALID_ENUM,
-                        "glGetProgramRegisterfvMESA(target)");
-            return;
-         }
-         if (!ctx->FragmentProgram._Enabled) {
-            _mesa_error(ctx, GL_INVALID_OPERATION,
-                        "glGetProgramRegisterfvMESA");
-            return;
-         }
-         /* XXX to do */
-         break;
-      case GL_FRAGMENT_PROGRAM_NV:
-         if (!ctx->Extensions.NV_fragment_program) {
-            _mesa_error(ctx, GL_INVALID_ENUM,
-                        "glGetProgramRegisterfvMESA(target)");
-            return;
-         }
-         if (!ctx->FragmentProgram._Enabled) {
-            _mesa_error(ctx, GL_INVALID_OPERATION,
-                        "glGetProgramRegisterfvMESA");
-            return;
-         }
-         if (reg[0] == 'R') {
-            /* Temp register */
-            GLint i = _mesa_atoi(reg + 1);
-            if (i >= (GLint)ctx->Const.FragmentProgram.MaxTemps) {
-               _mesa_error(ctx, GL_INVALID_VALUE,
-                           "glGetProgramRegisterfvMESA(registerName)");
-               return;
-            }
-            ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_TEMPORARY,
-                                                   i, v);
-         }
-         else if (reg[0] == 'f' && reg[1] == '[') {
-            /* Fragment input attribute */
-            GLuint i;
-            for (i = 0; i < ctx->Const.FragmentProgram.MaxAttribs; i++) {
-               const char *name = _mesa_nv_fragment_input_register_name(i);
-               if (_mesa_strncmp(reg + 2, name, 4) == 0) {
-                  ctx->Driver.GetFragmentProgramRegister(ctx,
-                                                         PROGRAM_INPUT, i, v);
-                  return;
-               }
-            }
-            _mesa_error(ctx, GL_INVALID_VALUE,
-                        "glGetProgramRegisterfvMESA(registerName)");
-            return;
-         }
-         else if (_mesa_strcmp(reg, "o[COLR]") == 0) {
-            /* Fragment output color */
-            ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT,
-                                                   FRAG_RESULT_COLR, v);
-         }
-         else if (_mesa_strcmp(reg, "o[COLH]") == 0) {
-            /* Fragment output color */
-            ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT,
-                                                   FRAG_RESULT_COLH, v);
-         }
-         else if (_mesa_strcmp(reg, "o[DEPR]") == 0) {
-            /* Fragment output depth */
-            ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT,
-                                                   FRAG_RESULT_DEPR, v);
-         }
-         else {
-            /* try user-defined identifiers */
-            const GLfloat *value = _mesa_lookup_parameter_value(
-                       ctx->FragmentProgram.Current->Base.Parameters, -1, reg);
-            if (value) {
-               COPY_4V(v, value);
-            }
-            else {
-               _mesa_error(ctx, GL_INVALID_VALUE,
-                           "glGetProgramRegisterfvMESA(registerName)");
-               return;
-            }
-         }
-         break;
-      default:
-         _mesa_error(ctx, GL_INVALID_ENUM,
-                     "glGetProgramRegisterfvMESA(target)");
-         return;
-   }
-}
diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h
index 73f5238..5270485 100644
--- a/src/mesa/shader/program.h
+++ b/src/mesa/shader/program.h
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.2
+ * Version:  6.5.3
  *
- * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -103,17 +103,4 @@ _mesa_GenPrograms(GLsizei n, GLuint *ids
 
 
 
-/*
- * GL_MESA_program_debug
- */
-
-extern void
-_mesa_ProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
-                          GLvoid *data);
-
-extern void
-_mesa_GetProgramRegisterfvMESA(GLenum target, GLsizei len,
-                               const GLubyte *registerName, GLfloat *v);
-
-
 #endif /* PROGRAM_H */
diff-tree 383ecc0374582900016c6411aff65d27829f876d (from b3893baf80f913499092d4339b3131527b912188)
Author: Brian <brian at nostromo.localnet.net>
Date:   Fri Feb 9 15:39:32 2007 -0700

    Move experimental GL_MESA_program_debug functions into new file.

diff --git a/src/mesa/shader/prog_debug.c b/src/mesa/shader/prog_debug.c
new file mode 100644
index 0000000..e3e5396
--- /dev/null
+++ b/src/mesa/shader/prog_debug.c
@@ -0,0 +1,265 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  6.5.3
+ *
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#include "glheader.h"
+#include "context.h"
+#include "macros.h"
+#include "nvfragparse.h"
+#include "nvvertparse.h"
+#include "program.h"
+#include "prog_debug.h"
+#include "prog_parameter.h"
+#include "prog_instruction.h"
+
+
+
+/**
+ * Functions for the experimental GL_MESA_program_debug extension.
+ */
+
+
+/* XXX temporary */
+GLAPI void GLAPIENTRY
+glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
+                      GLvoid *data)
+{
+   _mesa_ProgramCallbackMESA(target, callback, data);
+}
+
+
+void
+_mesa_ProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
+                          GLvoid *data)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   switch (target) {
+      case GL_FRAGMENT_PROGRAM_ARB:
+         if (!ctx->Extensions.ARB_fragment_program) {
+            _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
+            return;
+         }
+         ctx->FragmentProgram.Callback = callback;
+         ctx->FragmentProgram.CallbackData = data;
+         break;
+      case GL_FRAGMENT_PROGRAM_NV:
+         if (!ctx->Extensions.NV_fragment_program) {
+            _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
+            return;
+         }
+         ctx->FragmentProgram.Callback = callback;
+         ctx->FragmentProgram.CallbackData = data;
+         break;
+      case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
+         if (!ctx->Extensions.ARB_vertex_program &&
+             !ctx->Extensions.NV_vertex_program) {
+            _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
+            return;
+         }
+         ctx->VertexProgram.Callback = callback;
+         ctx->VertexProgram.CallbackData = data;
+         break;
+      default:
+         _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
+         return;
+   }
+}
+
+
+/* XXX temporary */
+GLAPI void GLAPIENTRY
+glGetProgramRegisterfvMESA(GLenum target,
+                           GLsizei len, const GLubyte *registerName,
+                           GLfloat *v)
+{
+   _mesa_GetProgramRegisterfvMESA(target, len, registerName, v);
+}
+
+
+void
+_mesa_GetProgramRegisterfvMESA(GLenum target,
+                               GLsizei len, const GLubyte *registerName,
+                               GLfloat *v)
+{
+   char reg[1000];
+   GET_CURRENT_CONTEXT(ctx);
+
+   /* We _should_ be inside glBegin/glEnd */
+#if 0
+   if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) {
+      _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramRegisterfvMESA");
+      return;
+   }
+#endif
+
+   /* make null-terminated copy of registerName */
+   len = MIN2((unsigned int) len, sizeof(reg) - 1);
+   _mesa_memcpy(reg, registerName, len);
+   reg[len] = 0;
+
+   switch (target) {
+      case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
+         if (!ctx->Extensions.ARB_vertex_program &&
+             !ctx->Extensions.NV_vertex_program) {
+            _mesa_error(ctx, GL_INVALID_ENUM,
+                        "glGetProgramRegisterfvMESA(target)");
+            return;
+         }
+         if (!ctx->VertexProgram._Enabled) {
+            _mesa_error(ctx, GL_INVALID_OPERATION,
+                        "glGetProgramRegisterfvMESA");
+            return;
+         }
+         /* GL_NV_vertex_program */
+         if (reg[0] == 'R') {
+            /* Temp register */
+            GLint i = _mesa_atoi(reg + 1);
+            if (i >= (GLint)ctx->Const.VertexProgram.MaxTemps) {
+               _mesa_error(ctx, GL_INVALID_VALUE,
+                           "glGetProgramRegisterfvMESA(registerName)");
+               return;
+            }
+#if 0 /* FIX ME */
+            ctx->Driver.GetVertexProgramRegister(ctx, PROGRAM_TEMPORARY, i, v);
+#endif
+         }
+         else if (reg[0] == 'v' && reg[1] == '[') {
+            /* Vertex Input attribute */
+            GLuint i;
+            for (i = 0; i < ctx->Const.VertexProgram.MaxAttribs; i++) {
+               const char *name = _mesa_nv_vertex_input_register_name(i);
+               char number[10];
+               _mesa_sprintf(number, "%d", i);
+               if (_mesa_strncmp(reg + 2, name, 4) == 0 ||
+                   _mesa_strncmp(reg + 2, number, _mesa_strlen(number)) == 0) {
+#if 0 /* FIX ME */
+                  ctx->Driver.GetVertexProgramRegister(ctx, PROGRAM_INPUT,
+                                                       i, v);
+#endif
+                  return;
+               }
+            }
+            _mesa_error(ctx, GL_INVALID_VALUE,
+                        "glGetProgramRegisterfvMESA(registerName)");
+            return;
+         }
+         else if (reg[0] == 'o' && reg[1] == '[') {
+            /* Vertex output attribute */
+         }
+         /* GL_ARB_vertex_program */
+         else if (_mesa_strncmp(reg, "vertex.", 7) == 0) {
+
+         }
+         else {
+            _mesa_error(ctx, GL_INVALID_VALUE,
+                        "glGetProgramRegisterfvMESA(registerName)");
+            return;
+         }
+         break;
+      case GL_FRAGMENT_PROGRAM_ARB:
+         if (!ctx->Extensions.ARB_fragment_program) {
+            _mesa_error(ctx, GL_INVALID_ENUM,
+                        "glGetProgramRegisterfvMESA(target)");
+            return;
+         }
+         if (!ctx->FragmentProgram._Enabled) {
+            _mesa_error(ctx, GL_INVALID_OPERATION,
+                        "glGetProgramRegisterfvMESA");
+            return;
+         }
+         /* XXX to do */
+         break;
+      case GL_FRAGMENT_PROGRAM_NV:
+         if (!ctx->Extensions.NV_fragment_program) {
+            _mesa_error(ctx, GL_INVALID_ENUM,
+                        "glGetProgramRegisterfvMESA(target)");
+            return;
+         }
+         if (!ctx->FragmentProgram._Enabled) {
+            _mesa_error(ctx, GL_INVALID_OPERATION,
+                        "glGetProgramRegisterfvMESA");
+            return;
+         }
+         if (reg[0] == 'R') {
+            /* Temp register */
+            GLint i = _mesa_atoi(reg + 1);
+            if (i >= (GLint)ctx->Const.FragmentProgram.MaxTemps) {
+               _mesa_error(ctx, GL_INVALID_VALUE,
+                           "glGetProgramRegisterfvMESA(registerName)");
+               return;
+            }
+            ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_TEMPORARY,
+                                                   i, v);
+         }
+         else if (reg[0] == 'f' && reg[1] == '[') {
+            /* Fragment input attribute */
+            GLuint i;
+            for (i = 0; i < ctx->Const.FragmentProgram.MaxAttribs; i++) {
+               const char *name = _mesa_nv_fragment_input_register_name(i);
+               if (_mesa_strncmp(reg + 2, name, 4) == 0) {
+                  ctx->Driver.GetFragmentProgramRegister(ctx,
+                                                         PROGRAM_INPUT, i, v);
+                  return;
+               }
+            }
+            _mesa_error(ctx, GL_INVALID_VALUE,
+                        "glGetProgramRegisterfvMESA(registerName)");
+            return;
+         }
+         else if (_mesa_strcmp(reg, "o[COLR]") == 0) {
+            /* Fragment output color */
+            ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT,
+                                                   FRAG_RESULT_COLR, v);
+         }
+         else if (_mesa_strcmp(reg, "o[COLH]") == 0) {
+            /* Fragment output color */
+            ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT,
+                                                   FRAG_RESULT_COLH, v);
+         }
+         else if (_mesa_strcmp(reg, "o[DEPR]") == 0) {
+            /* Fragment output depth */
+            ctx->Driver.GetFragmentProgramRegister(ctx, PROGRAM_OUTPUT,
+                                                   FRAG_RESULT_DEPR, v);
+         }
+         else {
+            /* try user-defined identifiers */
+            const GLfloat *value = _mesa_lookup_parameter_value(
+                       ctx->FragmentProgram.Current->Base.Parameters, -1, reg);
+            if (value) {
+               COPY_4V(v, value);
+            }
+            else {
+               _mesa_error(ctx, GL_INVALID_VALUE,
+                           "glGetProgramRegisterfvMESA(registerName)");
+               return;
+            }
+         }
+         break;
+      default:
+         _mesa_error(ctx, GL_INVALID_ENUM,
+                     "glGetProgramRegisterfvMESA(target)");
+         return;
+   }
+}
diff --git a/src/mesa/shader/prog_debug.h b/src/mesa/shader/prog_debug.h
new file mode 100644
index 0000000..fc400e1
--- /dev/null
+++ b/src/mesa/shader/prog_debug.h
@@ -0,0 +1,44 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  6.5.3
+ *
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef PROG_DEBUG_H
+#define PROG_DEBUG_H 1
+
+
+/*
+ * GL_MESA_program_debug
+ */
+
+extern void
+_mesa_ProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
+                          GLvoid *data);
+
+extern void
+_mesa_GetProgramRegisterfvMESA(GLenum target, GLsizei len,
+                               const GLubyte *registerName, GLfloat *v);
+
+
+
+#endif /* PROG_DEBUG_H */
diff-tree b3893baf80f913499092d4339b3131527b912188 (from 3d479b96385963dd7aacfa9f17cd480256ca6b4f)
Author: Brian <brian at nostromo.localnet.net>
Date:   Fri Feb 9 14:19:12 2007 -0700

    comments, etc

diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 1b43042..b15d737 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -43,9 +43,11 @@
 #define ANNOTATE 0
 
 
+/* XXX temporarily here */
 static GLboolean EmitHighLevelInstructions = GL_TRUE;
 
 
+
 /**
  * Assembly and IR info
  */
@@ -116,7 +118,7 @@ static const slang_ir_info IrInfo[] = {
    { IR_TEX, "IR_TEX", OPCODE_TEX, 4, 1 },
    { IR_TEXB, "IR_TEXB", OPCODE_TXB, 4, 1 },
    { IR_TEXP, "IR_TEXP", OPCODE_TXP, 4, 1 },
-   { IR_FLOAT, "IR_FLOAT", OPCODE_NOP, 0, 0 },
+   { IR_FLOAT, "IR_FLOAT", OPCODE_NOP, 0, 0 }, /* float literal */
    { IR_FIELD, "IR_FIELD", OPCODE_NOP, 0, 0 },
    { IR_ELEMENT, "IR_ELEMENT", OPCODE_NOP, 0, 0 },
    { IR_SWIZZLE, "IR_SWIZZLE", OPCODE_NOP, 0, 0 },
@@ -340,6 +342,14 @@ slang_print_ir(const slang_ir_node *n, i
       printf("BREAK_IF_TRUE\n");
       slang_print_ir(n->Children[0], indent+3);
       break;
+   case IR_CONT_IF_FALSE:
+      printf("CONT_IF_FALSE\n");
+      slang_print_ir(n->Children[0], indent+3);
+      break;
+   case IR_CONT_IF_TRUE:
+      printf("CONT_IF_TRUE\n");
+      slang_print_ir(n->Children[0], indent+3);
+      break;
 
    case IR_VAR:
       printf("VAR %s%s at %s  store %p\n",
@@ -358,11 +368,16 @@ slang_print_ir(const slang_ir_node *n, i
       slang_print_ir(n->Children[0], indent+3);
       break;
    case IR_FLOAT:
-      printf("FLOAT %f %f %f %f\n",
+      printf("FLOAT %g %g %g %g\n",
              n->Value[0], n->Value[1], n->Value[2], n->Value[3]);
       break;
    case IR_I_TO_F:
-      printf("INT_TO_FLOAT %d\n", (int) n->Value[0]);
+      printf("INT_TO_FLOAT\n");
+      slang_print_ir(n->Children[0], indent+3);
+      break;
+   case IR_F_TO_I:
+      printf("FLOAT_TO_INT\n");
+      slang_print_ir(n->Children[0], indent+3);
       break;
    case IR_SWIZZLE:
       printf("SWIZZLE %s of  (store %p) \n",
@@ -1386,6 +1401,7 @@ emit(slang_var_table *vt, slang_ir_node 
    case IR_FLOOR:
    case IR_FRAC:
    case IR_F_TO_I:
+   case IR_I_TO_F:
    case IR_ABS:
    case IR_SIN:
    case IR_COS:
diff-tree 3d479b96385963dd7aacfa9f17cd480256ca6b4f (from cf490a7f81b393242ab5eeec085e79a60bcf6345)
Author: Brian <brian at nostromo.localnet.net>
Date:   Fri Feb 9 14:18:41 2007 -0700

    re-enable free'ing of IR trees

diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 6285454..0edd471 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -487,7 +487,7 @@ static slang_asm_info AsmInfo[] = {
 static void
 _slang_free_ir_tree(slang_ir_node *n)
 {
-#if 0
+#if 1
    GLuint i;
    if (!n)
       return;
diff-tree cf490a7f81b393242ab5eeec085e79a60bcf6345 (from 5e6908944bbc76be020a3f5306c2a674f944f42e)
Author: Brian <brian at nostromo.localnet.net>
Date:   Fri Feb 9 12:04:52 2007 -0700

    always init param vars to silence valgrind warnings

diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c
index 870e826..3ebd559 100644
--- a/src/mesa/shader/prog_parameter.c
+++ b/src/mesa/shader/prog_parameter.c
@@ -131,6 +131,10 @@ _mesa_add_parameter(struct gl_program_pa
             COPY_4V(paramList->ParameterValues[oldNum + i], values);
             values += 4;
          }
+         else {
+            /* silence valgrind */
+            ASSIGN_4V(paramList->ParameterValues[oldNum + i], 0, 0, 0, 0);
+         }
          size -= 4;
       }
 



More information about the mesa-commit mailing list