mesa: remove GL_MESA_program_debug extension
authorBrian Paul <brianp@vmware.com>
Sat, 7 Mar 2009 18:53:18 +0000 (11:53 -0700)
committerBrian Paul <brianp@vmware.com>
Sat, 7 Mar 2009 18:53:18 +0000 (11:53 -0700)
This was never fully fleshed out and hasn't been used.

23 files changed:
docs/MESA_shader_debug.spec
src/mesa/SConscript
src/mesa/drivers/common/driverfuncs.c
src/mesa/drivers/dri/tdfx/tdfx_context.c
src/mesa/drivers/glide/fxdd.c
src/mesa/main/dd.h
src/mesa/main/enable.c
src/mesa/main/extensions.c
src/mesa/main/ffvertex_prog.c
src/mesa/main/get.c
src/mesa/main/get_gen.py
src/mesa/main/getstring.c
src/mesa/main/mfeatures.h
src/mesa/main/mtypes.h
src/mesa/shader/arbprogparse.c
src/mesa/shader/nvfragparse.c
src/mesa/shader/nvvertparse.c
src/mesa/shader/prog_debug.c [deleted file]
src/mesa/shader/prog_debug.h [deleted file]
src/mesa/shader/prog_execute.c
src/mesa/shader/prog_instruction.h
src/mesa/sources.mak
src/mesa/swrast/swrast.h

index 1f7d42ac91446e6fa3d1e8b62cff58756c7922db..fab92abc76281fedbd025ff994113cbe740f33a0 100644 (file)
@@ -13,7 +13,7 @@ Contact
 
 Status
 
-    XXX - Not complete yet!!!
+    Obsolete.
 
 Version
 
index 273ce1128063a2bf1dbc2ea64a60809979991c80..2e0168e0bc7c9d90d07999acb7bcf0b15e5323e7 100644 (file)
@@ -189,7 +189,6 @@ if env['platform'] != 'winddk':
                'shader/nvvertparse.c',
                'shader/program.c',
                'shader/prog_cache.c',
-               'shader/prog_debug.c',
                'shader/prog_execute.c',
                'shader/prog_instruction.c',
                'shader/prog_noise.c',
index 9bee212c6a3579f9a151c00efe6365c7dd8c427d..44adaf868284bf6574e8501f9d5861a4ec51eb77 100644 (file)
@@ -134,9 +134,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
    driver->BindProgram = NULL;
    driver->NewProgram = _mesa_new_program;
    driver->DeleteProgram = _mesa_delete_program;
-#if FEATURE_MESA_program_debug
-   driver->GetProgramRegister = _mesa_get_program_register;
-#endif /* FEATURE_MESA_program_debug */
 
    /* simple state commands */
    driver->AlphaFunc = NULL;
index 20046fcb3af2c4eb03cacbbbd99d96b1534e0568..68b5027561bd651def0939373df3619ba0fe079a 100644 (file)
@@ -67,7 +67,6 @@
 #define need_GL_EXT_fog_coord
 #define need_GL_EXT_paletted_texture
 /* #define need_GL_EXT_secondary_color */
-/* #define need_GL_MESA_program_debug */
 /* #define need_GL_NV_vertex_program */
 #include "extension_helper.h"
 
@@ -101,9 +100,6 @@ const struct dri_extension card_extensions[] =
 #ifdef need_GL_NV_vertex_program
     { "GL_NV_vertex_program",              GL_NV_vertex_program_functions }
     { "GL_NV_vertex_program1_1",           NULL },
-#endif
-#ifdef need_GL_MESA_program_debug
-    { "GL_MESA_program_debug",             GL_MESA_program_debug_functions },
 #endif
     { NULL,                                NULL }
 };
index 1bcf2512a63206bf675bc590e2dbb17b9354d234..2bc60399ea2d5358e65166f525216e922aac7b4c 100644 (file)
@@ -1922,7 +1922,6 @@ fxDDInitExtensions(GLcontext * ctx)
       _mesa_enable_extension(ctx, "GL_ARB_vertex_program");
       _mesa_enable_extension(ctx, "GL_NV_vertex_program");
       _mesa_enable_extension(ctx, "GL_NV_vertex_program1_1");
-      _mesa_enable_extension(ctx, "GL_MESA_program_debug");
    }
 #if 0
    /* this requires _tnl_vertex_cull_stage in the pipeline */
index a335f77479d7f6faddcb99042b199a79a6c5e930..d994401e55f8086b538ef0eef145328ce1e388ad 100644 (file)
@@ -602,9 +602,6 @@ struct dd_function_table {
    /** Notify driver that a program string has been specified. */
    void (*ProgramStringNotify)(GLcontext *ctx, GLenum target, 
                               struct gl_program *prog);
-   /** Get value of a program register during program execution. */
-   void (*GetProgramRegister)(GLcontext *ctx, enum register_file file,
-                              GLuint index, GLfloat val[4]);
 
    /** Query if program can be loaded onto hardware */
    GLboolean (*IsProgramNative)(GLcontext *ctx, GLenum target, 
index a824705bdcc0da2a46a65bdc0bd7b89f688906ff..f432be183cb8bad6899e134b45b8100d1c284e61 100644 (file)
@@ -944,18 +944,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state)
          ctx->Depth.BoundsTest = state;
          break;
 
-      /* GL_MESA_program_debug */
-#if FEATURE_MESA_program_debug
-      case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
-         CHECK_EXTENSION(MESA_program_debug, cap);
-         ctx->FragmentProgram.CallbackEnabled = state;
-         break;
-      case GL_VERTEX_PROGRAM_CALLBACK_MESA:
-         CHECK_EXTENSION(MESA_program_debug, cap);
-         ctx->VertexProgram.CallbackEnabled = state;
-         break;
-#endif
-
 #if FEATURE_ATI_fragment_shader
       case GL_FRAGMENT_SHADER_ATI:
         CHECK_EXTENSION(ATI_fragment_shader, cap);
@@ -1398,16 +1386,6 @@ _mesa_IsEnabled( GLenum cap )
          CHECK_EXTENSION(EXT_depth_bounds_test);
          return ctx->Depth.BoundsTest;
 
-      /* GL_MESA_program_debug */
-#if FEATURE_MESA_program_debug
-      case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
-         CHECK_EXTENSION(MESA_program_debug);
-         return ctx->FragmentProgram.CallbackEnabled;
-      case GL_VERTEX_PROGRAM_CALLBACK_MESA:
-         CHECK_EXTENSION(MESA_program_debug);
-         return ctx->VertexProgram.CallbackEnabled;
-#endif
-
 #if FEATURE_ATI_fragment_shader
       case GL_FRAGMENT_SHADER_ATI:
         CHECK_EXTENSION(ATI_fragment_shader);
index 9c8bd13e6921119c33ed00a50104bf9289cf14fc..fbca924ad3db28d3fbdec8a5c681347ebba990d4 100644 (file)
@@ -147,7 +147,6 @@ static const struct {
    { OFF, "GL_INGR_blend_func_separate",       F(EXT_blend_func_separate) },
    { OFF, "GL_MESA_pack_invert",               F(MESA_pack_invert) },
    { OFF, "GL_MESA_packed_depth_stencil",      F(MESA_packed_depth_stencil) },
-   { OFF, "GL_MESA_program_debug",             F(MESA_program_debug) },
    { OFF, "GL_MESA_resize_buffers",            F(MESA_resize_buffers) },
    { OFF, "GL_MESA_texture_array",             F(MESA_texture_array) },
    { OFF, "GL_MESA_ycbcr_texture",             F(MESA_ycbcr_texture) },
@@ -276,9 +275,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
    ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE;
    /*ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE;*/
    ctx->Extensions.MESA_pack_invert = GL_TRUE;
-#if FEATURE_MESA_program_debug
-   ctx->Extensions.MESA_program_debug = GL_TRUE;
-#endif
    ctx->Extensions.MESA_resize_buffers = GL_TRUE;
    ctx->Extensions.MESA_texture_array = GL_TRUE;
    ctx->Extensions.MESA_ycbcr_texture = GL_TRUE;
index 42c8cc97c08900ab15b8f6048de26472901a5877..72b880e28eef55ecbe1caac6308544aa5f4f293d 100644 (file)
@@ -655,7 +655,6 @@ static void emit_op3fn(struct tnl_program *p,
 
    inst = &p->program->Base.Instructions[nr];
    inst->Opcode = (enum prog_opcode) op; 
-   inst->StringPos = 0;
    inst->Data = 0;
    
    emit_arg( &inst->SrcReg[0], src0 );
index 3a8d56140f59aad4d16cacb849e0fbd1bae63188..0937fd053c575bfaf0ed4d9df34d8816ee91b475 100644 (file)
@@ -1715,22 +1715,6 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
          params[0] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMin);
          params[1] = FLOAT_TO_BOOLEAN(ctx->Depth.BoundsMax);
          break;
-      case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetBooleanv");
-         params[0] = ctx->FragmentProgram.CallbackEnabled;
-         break;
-      case GL_VERTEX_PROGRAM_CALLBACK_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetBooleanv");
-         params[0] = ctx->VertexProgram.CallbackEnabled;
-         break;
-      case GL_FRAGMENT_PROGRAM_POSITION_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetBooleanv");
-         params[0] = INT_TO_BOOLEAN(ctx->FragmentProgram.CurrentPosition);
-         break;
-      case GL_VERTEX_PROGRAM_POSITION_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetBooleanv");
-         params[0] = INT_TO_BOOLEAN(ctx->VertexProgram.CurrentPosition);
-         break;
       case GL_MAX_DRAW_BUFFERS_ARB:
          params[0] = INT_TO_BOOLEAN(ctx->Const.MaxDrawBuffers);
          break;
@@ -3541,22 +3525,6 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
          params[0] = ctx->Depth.BoundsMin;
          params[1] = ctx->Depth.BoundsMax;
          break;
-      case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetFloatv");
-         params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.CallbackEnabled);
-         break;
-      case GL_VERTEX_PROGRAM_CALLBACK_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetFloatv");
-         params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.CallbackEnabled);
-         break;
-      case GL_FRAGMENT_PROGRAM_POSITION_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetFloatv");
-         params[0] = (GLfloat)(ctx->FragmentProgram.CurrentPosition);
-         break;
-      case GL_VERTEX_PROGRAM_POSITION_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetFloatv");
-         params[0] = (GLfloat)(ctx->VertexProgram.CurrentPosition);
-         break;
       case GL_MAX_DRAW_BUFFERS_ARB:
          params[0] = (GLfloat)(ctx->Const.MaxDrawBuffers);
          break;
@@ -5367,22 +5335,6 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
          params[0] = IROUND(ctx->Depth.BoundsMin);
          params[1] = IROUND(ctx->Depth.BoundsMax);
          break;
-      case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetIntegerv");
-         params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.CallbackEnabled);
-         break;
-      case GL_VERTEX_PROGRAM_CALLBACK_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetIntegerv");
-         params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.CallbackEnabled);
-         break;
-      case GL_FRAGMENT_PROGRAM_POSITION_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetIntegerv");
-         params[0] = ctx->FragmentProgram.CurrentPosition;
-         break;
-      case GL_VERTEX_PROGRAM_POSITION_MESA:
-         CHECK_EXT1(MESA_program_debug, "GetIntegerv");
-         params[0] = ctx->VertexProgram.CurrentPosition;
-         break;
       case GL_MAX_DRAW_BUFFERS_ARB:
          params[0] = ctx->Const.MaxDrawBuffers;
          break;
index 729f382b4b13d34faeda2f0baf0c9aa4a440ac7b..fa695c48f1ac5b06dbe897ebe751310b5d351e08 100644 (file)
@@ -902,16 +902,6 @@ StateVars = [
          ["ctx->Depth.BoundsMin", "ctx->Depth.BoundsMax"],
          "", ["EXT_depth_bounds_test"] ),
 
-       # GL_MESA_program_debug
-       ( "GL_FRAGMENT_PROGRAM_CALLBACK_MESA", GLboolean,
-         ["ctx->FragmentProgram.CallbackEnabled"], "", ["MESA_program_debug"] ),
-       ( "GL_VERTEX_PROGRAM_CALLBACK_MESA", GLboolean,
-         ["ctx->VertexProgram.CallbackEnabled"], "", ["MESA_program_debug"] ),
-       ( "GL_FRAGMENT_PROGRAM_POSITION_MESA", GLint,
-         ["ctx->FragmentProgram.CurrentPosition"], "", ["MESA_program_debug"] ),
-       ( "GL_VERTEX_PROGRAM_POSITION_MESA", GLint,
-         ["ctx->VertexProgram.CurrentPosition"], "", ["MESA_program_debug"] ),
-
        # GL_ARB_draw_buffers
        ( "GL_MAX_DRAW_BUFFERS_ARB", GLint,
          ["ctx->Const.MaxDrawBuffers"], "", None ),
index a42c44686dddca6fac81a47d9ada80a752468a42..41fd786d7d5aaaa89a097c6c7e1ba57d999a6795 100644 (file)
@@ -242,36 +242,6 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
       case GL_SELECTION_BUFFER_POINTER:
          *params = ctx->Select.Buffer;
          break;
-#if FEATURE_MESA_program_debug
-      case GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA:
-         if (!ctx->Extensions.MESA_program_debug) {
-            _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv");
-            return;
-         }
-         *params = *(GLvoid **) &ctx->FragmentProgram.Callback;
-         break;
-      case GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA:
-         if (!ctx->Extensions.MESA_program_debug) {
-            _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv");
-            return;
-         }
-         *params = ctx->FragmentProgram.CallbackData;
-         break;
-      case GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA:
-         if (!ctx->Extensions.MESA_program_debug) {
-            _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv");
-            return;
-         }
-         *params = *(GLvoid **) &ctx->VertexProgram.Callback;
-         break;
-      case GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA:
-         if (!ctx->Extensions.MESA_program_debug) {
-            _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv");
-            return;
-         }
-         *params = ctx->VertexProgram.CallbackData;
-         break;
-#endif
       default:
          _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
          return;
index 8fb32dd7e941bd5b615d537d4788de4146cb1b69..f5706479423361fd9b95569a554923bf66efee93 100644 (file)
@@ -75,7 +75,6 @@
 #define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL
 #define FEATURE_EXT_timer_query  _HAVE_FULL_GL
 #define FEATURE_ATI_fragment_shader _HAVE_FULL_GL
-#define FEATURE_MESA_program_debug  _HAVE_FULL_GL
 #define FEATURE_NV_fence  _HAVE_FULL_GL
 #define FEATURE_NV_fragment_program  _HAVE_FULL_GL
 #define FEATURE_NV_vertex_program  _HAVE_FULL_GL
index baf5850b83bd80b9c4a2baf9a9e29bada937e8c2..17f6241e04e5773e83966c52ec1ac05622b1e734 100644 (file)
@@ -1856,13 +1856,6 @@ struct gl_vertex_program_state
    /** Cache of fixed-function programs */
    struct gl_program_cache *Cache;
 
-#if FEATURE_MESA_program_debug
-   GLprogramcallbackMESA Callback;
-   GLvoid *CallbackData;
-   GLboolean CallbackEnabled;
-   GLuint CurrentPosition;
-#endif
-
    GLboolean _Overriden;
 };
 
@@ -1892,13 +1885,6 @@ struct gl_fragment_program_state
 
    /** Cache of fixed-function programs */
    struct gl_program_cache *Cache;
-
-#if FEATURE_MESA_program_debug
-   GLprogramcallbackMESA Callback;
-   GLvoid *CallbackData;
-   GLboolean CallbackEnabled;
-   GLuint CurrentPosition;
-#endif
 };
 
 
@@ -2502,7 +2488,6 @@ struct gl_extensions
    GLboolean IBM_multimode_draw_arrays;
    GLboolean MESA_pack_invert;
    GLboolean MESA_packed_depth_stencil;
-   GLboolean MESA_program_debug;
    GLboolean MESA_resize_buffers;
    GLboolean MESA_ycbcr_texture;
    GLboolean MESA_texture_array;
index ccc0318a53fb192e6665720c86360e932448230c..75398cda9033a6300ebfd465feea55babee43a36 100644 (file)
@@ -2752,9 +2752,6 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst,
 
    _mesa_init_instructions(fp, 1);
 
-   /* Record the position in the program string for debugging */
-   fp->StringPos = Program->Position;
-
    /* OP_ALU_INST or OP_TEX_INST */
    instClass = *(*inst)++;
 
@@ -3194,8 +3191,6 @@ parse_vp_instruction (GLcontext * ctx, const GLubyte ** inst,
    code = *(*inst)++;
 
    _mesa_init_instructions(vp, 1);
-   /* Record the position in the program string for debugging */
-   vp->StringPos = Program->Position;
 
    switch (type) {
          /* XXX: */
@@ -3557,10 +3552,6 @@ parse_instructions(GLcontext * ctx, const GLubyte * inst,
       const GLuint numInst = Program->Base.NumInstructions;
       _mesa_init_instructions(Program->Base.Instructions + numInst, 1);
       Program->Base.Instructions[numInst].Opcode = OPCODE_END;
-      /* YYY Wrong Position in program, whatever, at least not random -> crash
-        Program->Position = parse_position (&inst);
-      */
-      Program->Base.Instructions[numInst].StringPos = Program->Position;
    }
    Program->Base.NumInstructions++;
 
index 37418ffb6ef7bfd197d4e9b4609d6e770db96fe5..b935cb562a6bef2c901f5dc776e919a912dd7b9a 100644 (file)
@@ -1311,8 +1311,6 @@ Parse_InstructionSequence(struct parse_state *parseState,
       }
       else if (Parse_String(parseState, "END")) {
          inst->Opcode = OPCODE_END;
-         inst->StringPos = parseState->curLine - parseState->start;
-         assert(inst->StringPos >= 0);
          parseState->numInst++;
          if (Parse_Token(parseState, token)) {
             RETURN_ERROR1("Code after END opcode.");
@@ -1339,8 +1337,6 @@ Parse_InstructionSequence(struct parse_state *parseState,
          inst->SaturateMode = (instMatch.suffixes & (_S))
             ? SATURATE_ZERO_ONE : SATURATE_OFF;
          inst->CondUpdate = (instMatch.suffixes & (_C)) ? GL_TRUE : GL_FALSE;
-         inst->StringPos = parseState->curLine - parseState->start;
-         assert(inst->StringPos >= 0);
 
          /*
           * parse the input and output operands
index 08538c0ee4fbec8907de60dff6063d3868f60cf4..268b577aec9c22b50e9ec34061148463324294ef 100644 (file)
@@ -799,7 +799,6 @@ Parse_UnaryOpInstruction(struct parse_state *parseState,
       RETURN_ERROR1("ABS illegal for vertex program 1.0");
 
    inst->Opcode = opcode;
-   inst->StringPos = parseState->curLine - parseState->start;
 
    /* dest reg */
    if (!Parse_MaskedDstReg(parseState, &inst->DstReg))
@@ -832,7 +831,6 @@ Parse_BiOpInstruction(struct parse_state *parseState,
       RETURN_ERROR1("SUB illegal for vertex program 1.0");
 
    inst->Opcode = opcode;
-   inst->StringPos = parseState->curLine - parseState->start;
 
    /* dest reg */
    if (!Parse_MaskedDstReg(parseState, &inst->DstReg))
@@ -880,7 +878,6 @@ Parse_TriOpInstruction(struct parse_state *parseState,
                        enum prog_opcode opcode)
 {
    inst->Opcode = opcode;
-   inst->StringPos = parseState->curLine - parseState->start;
 
    /* dest reg */
    if (!Parse_MaskedDstReg(parseState, &inst->DstReg))
@@ -951,7 +948,6 @@ Parse_ScalarInstruction(struct parse_state *parseState,
       RETURN_ERROR1("RCC illegal for vertex program 1.0");
 
    inst->Opcode = opcode;
-   inst->StringPos = parseState->curLine - parseState->start;
 
    /* dest reg */
    if (!Parse_MaskedDstReg(parseState, &inst->DstReg))
@@ -977,7 +973,6 @@ static GLboolean
 Parse_AddressInstruction(struct parse_state *parseState, struct prog_instruction *inst)
 {
    inst->Opcode = OPCODE_ARL;
-   inst->StringPos = parseState->curLine - parseState->start;
 
    /* Make ARB_vp backends happy */
    inst->DstReg.File = PROGRAM_ADDRESS;
@@ -1010,7 +1005,6 @@ Parse_EndInstruction(struct parse_state *parseState, struct prog_instruction *in
    GLubyte token[100];
 
    inst->Opcode = OPCODE_END;
-   inst->StringPos = parseState->curLine - parseState->start;
 
    /* this should fail! */
    if (Parse_Token(parseState, token))
@@ -1044,7 +1038,6 @@ Parse_PrintInstruction(struct parse_state *parseState, struct prog_instruction *
    GLint idx;
 
    inst->Opcode = OPCODE_PRINT;
-   inst->StringPos = parseState->curLine - parseState->start;
 
    /* The first argument is a literal string 'just like this' */
    if (!Parse_String(parseState, "'"))
diff --git a/src/mesa/shader/prog_debug.c b/src/mesa/shader/prog_debug.c
deleted file mode 100644 (file)
index 35ce37d..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * 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 "main/glheader.h"
-#include "main/context.h"
-#include "main/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;
-            }
-            ctx->Driver.GetProgramRegister(ctx, PROGRAM_TEMPORARY, i, v);
-         }
-         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) {
-                  ctx->Driver.GetProgramRegister(ctx, PROGRAM_INPUT, i, v);
-                  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.GetProgramRegister(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.GetProgramRegister(ctx, PROGRAM_INPUT, i, v);
-                  return;
-               }
-            }
-            _mesa_error(ctx, GL_INVALID_VALUE,
-                        "glGetProgramRegisterfvMESA(registerName)");
-            return;
-         }
-         else if (_mesa_strcmp(reg, "o[COLR]") == 0 ||
-                  _mesa_strcmp(reg, "o[COLH]") == 0) {
-            /* Fragment output color */
-            ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT,
-                                           FRAG_RESULT_COLOR, v);
-         }
-         else if (_mesa_strcmp(reg, "o[DEPR]") == 0) {
-            /* Fragment output depth */
-            ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT,
-                                           FRAG_RESULT_DEPTH, 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
deleted file mode 100644 (file)
index fc400e1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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 */
index a93733c085288fd3f89d255d976b87e2c2a8f1ea..a60cda674bad25bf02611977ca4eb0d19bf0a7ff 100644 (file)
@@ -186,30 +186,6 @@ get_dst_register_pointer(const struct prog_dst_register *dest,
 
 
 
-#if FEATURE_MESA_program_debug
-static struct gl_program_machine *CurrentMachine = NULL;
-
-/**
- * For GL_MESA_program_debug.
- * Return current value (4*GLfloat) of a program register.
- * Called via ctx->Driver.GetProgramRegister().
- */
-void
-_mesa_get_program_register(GLcontext *ctx, enum register_file file,
-                           GLuint index, GLfloat val[4])
-{
-   if (CurrentMachine) {
-      struct prog_src_register srcReg;
-      const GLfloat *src;
-      srcReg.File = file;
-      srcReg.Index = index;
-      src = get_src_register_pointer(&srcReg, CurrentMachine);
-      COPY_4V(val, src);
-   }
-}
-#endif /* FEATURE_MESA_program_debug */
-
-
 /**
  * Fetch a 4-element float vector from the given source register.
  * Apply swizzling and negating as needed.
@@ -633,10 +609,6 @@ _mesa_execute_program(GLcontext * ctx,
       printf("execute program %u --------------------\n", program->Id);
    }
 
-#if FEATURE_MESA_program_debug
-   CurrentMachine = machine;
-#endif
-
    if (program->Target == GL_VERTEX_PROGRAM_ARB) {
       machine->EnvParams = ctx->VertexProgram.Parameters;
    }
@@ -647,15 +619,6 @@ _mesa_execute_program(GLcontext * ctx,
    for (pc = 0; pc < numInst; pc++) {
       const struct prog_instruction *inst = program->Instructions + pc;
 
-#if FEATURE_MESA_program_debug
-      if (ctx->FragmentProgram.CallbackEnabled &&
-          ctx->FragmentProgram.Callback) {
-         ctx->FragmentProgram.CurrentPosition = inst->StringPos;
-         ctx->FragmentProgram.Callback(program->Target,
-                                       ctx->FragmentProgram.CallbackData);
-      }
-#endif
-
       if (DEBUG_PROG) {
          _mesa_print_instruction(inst);
       }
@@ -1780,9 +1743,5 @@ _mesa_execute_program(GLcontext * ctx,
 
    } /* for pc */
 
-#if FEATURE_MESA_program_debug
-   CurrentMachine = NULL;
-#endif
-
    return GL_TRUE;
 }
index 95dd7fda7f45814c46cd0a9737395a7def681374..4adce11f957ab86191fc36b2fd55391ec86346b4 100644 (file)
@@ -421,11 +421,6 @@ struct prog_instruction
 
    /** for driver use (try to remove someday) */
    GLint Aux;
-
-   /* XXX obsolete - remove someday */
-#if FEATURE_MESA_program_debug
-   GLshort StringPos;
-#endif
 };
 
 
index 08ba345009b8f6f4f39881d8b6bfe2609ab764c2..d8d48476e811da8103a35cc3e2257edcc460d466 100644 (file)
@@ -220,7 +220,6 @@ SHADER_SOURCES = \
        shader/nvvertparse.c \
        shader/program.c \
        shader/prog_cache.c \
-       shader/prog_debug.c \
        shader/prog_execute.c \
        shader/prog_instruction.c \
        shader/prog_noise.c \
index 015f8a05c3ede0417ee6f2c8a9b372e569e14513..c319ca62f9cfc080c708edccbb9b9ce40bd5256d 100644 (file)
@@ -266,12 +266,6 @@ extern void
 _swrast_eject_texture_images(GLcontext *ctx);
 
 
-#if FEATURE_MESA_program_debug
-extern void
-_swrast_get_program_register(GLcontext *, enum register_file file,
-                             GLuint index, GLfloat val[4]);
-#endif /* FEATURE_MESA_program_debug */
-
 
 /**
  * The driver interface for the software rasterizer.