summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/arbprogram.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-11-19 15:36:28 +0000
committerBrian Paul <[email protected]>2005-11-19 15:36:28 +0000
commit8c41a14c5ef0b8d2b0f1a1cd094f5abc41fa48f8 (patch)
tree81e0ebcd5230a636c59f27b10ee08cd3d4c458ef /src/mesa/shader/arbprogram.c
parent57548094215c8c2d869417c09c9a391f1b7e28f2 (diff)
Remove the _mesa_parse_arb_vertex/fragment_program() functions into
arbprogparse.c and remove arbvertparse.[ch] and arbfragparse.[ch]. Clean up quite a bit of the arb parsing code. Rewrite parser extension code to avoid a mess of string operations every time the parser was used.
Diffstat (limited to 'src/mesa/shader/arbprogram.c')
-rw-r--r--src/mesa/shader/arbprogram.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c
index 35b760bee5a..a7b26e72b58 100644
--- a/src/mesa/shader/arbprogram.c
+++ b/src/mesa/shader/arbprogram.c
@@ -31,16 +31,11 @@
#include "glheader.h"
#include "arbprogram.h"
-#include "arbfragparse.h"
-#include "arbvertparse.h"
+#include "arbprogparse.h"
#include "context.h"
#include "imports.h"
#include "macros.h"
#include "mtypes.h"
-#include "nvprogram.h"
-#include "nvfragparse.h"
-#include "program_instruction.h"
-#include "nvvertparse.h"
void GLAPIENTRY
@@ -195,15 +190,15 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+ if (format != GL_PROGRAM_FORMAT_ASCII_ARB) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(format)");
+ return;
+ }
+
if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
struct vertex_program *prog = ctx->VertexProgram.Current;
- if (format != GL_PROGRAM_FORMAT_ASCII_ARB) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(format)");
- return;
- }
- _mesa_parse_arb_vertex_program(ctx, target, (const GLubyte *) string,
- len, prog);
+ _mesa_parse_arb_vertex_program(ctx, target, string, len, prog);
if (ctx->Driver.ProgramStringNotify)
ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base );
@@ -211,12 +206,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
else if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
struct fragment_program *prog = ctx->FragmentProgram.Current;
- if (format != GL_PROGRAM_FORMAT_ASCII_ARB) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(format)");
- return;
- }
- _mesa_parse_arb_fragment_program(ctx, target, (const GLubyte *) string,
- len, prog);
+ _mesa_parse_arb_fragment_program(ctx, target, string, len, prog);
if (ctx->Driver.ProgramStringNotify)
ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base );