diff options
author | Ian Romanick <[email protected]> | 2009-07-29 20:51:38 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2009-07-29 20:51:38 -0700 |
commit | 48183ca8b6adfbb9555428cb8414b821fdd15717 (patch) | |
tree | 80070bfa5a10e5646058154dd9b2efe6a18f514b | |
parent | cbe4133109c95fa6b90d8a601c78f043db456809 (diff) |
ARB prog parser: Get program limits from the context
Some debug code from the older stand-alone version of the assembler
was hanging around and needed to go.
-rw-r--r-- | src/mesa/shader/program_parse.tab.c | 27 | ||||
-rw-r--r-- | src/mesa/shader/program_parse.y | 27 |
2 files changed, 6 insertions, 48 deletions
diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index ae35bd3fef7..6c3c239cfa4 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -5051,7 +5051,6 @@ GLboolean _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, GLsizei len, struct asm_parser_state *state) { - struct gl_program_constants limits; struct asm_instruction *inst; unsigned i; GLubyte *strz; @@ -5077,29 +5076,9 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, state->st = _mesa_symbol_table_ctor(); - /* All of these limits should come from ctx. - */ - limits.MaxInstructions = 128; - limits.MaxAluInstructions = 128; - limits.MaxTexInstructions = 128; - limits.MaxTexIndirections = 128; - limits.MaxAttribs = 16; - limits.MaxTemps = 128; - limits.MaxAddressRegs = 1; - limits.MaxParameters = 128; - limits.MaxLocalParams = 256; - limits.MaxEnvParams = 128; - limits.MaxNativeInstructions = 128; - limits.MaxNativeAluInstructions = 128; - limits.MaxNativeTexInstructions = 128; - limits.MaxNativeTexIndirections = 128; - limits.MaxNativeAttribs = 16; - limits.MaxNativeTemps = 128; - limits.MaxNativeAddressRegs = 1; - limits.MaxNativeParameters = 128; - limits.MaxUniformComponents = 0; - - state->limits = & limits; + state->limits = (target == GL_VERTEX_PROGRAM_ARB) + ? & ctx->Const.VertexProgram + : & ctx->Const.FragmentProgram; state->MaxTextureImageUnits = 16; state->MaxTextureCoordUnits = 8; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 91a4036cbbd..65f713303b0 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2182,7 +2182,6 @@ GLboolean _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, GLsizei len, struct asm_parser_state *state) { - struct gl_program_constants limits; struct asm_instruction *inst; unsigned i; GLubyte *strz; @@ -2208,29 +2207,9 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, state->st = _mesa_symbol_table_ctor(); - /* All of these limits should come from ctx. - */ - limits.MaxInstructions = 128; - limits.MaxAluInstructions = 128; - limits.MaxTexInstructions = 128; - limits.MaxTexIndirections = 128; - limits.MaxAttribs = 16; - limits.MaxTemps = 128; - limits.MaxAddressRegs = 1; - limits.MaxParameters = 128; - limits.MaxLocalParams = 256; - limits.MaxEnvParams = 128; - limits.MaxNativeInstructions = 128; - limits.MaxNativeAluInstructions = 128; - limits.MaxNativeTexInstructions = 128; - limits.MaxNativeTexIndirections = 128; - limits.MaxNativeAttribs = 16; - limits.MaxNativeTemps = 128; - limits.MaxNativeAddressRegs = 1; - limits.MaxNativeParameters = 128; - limits.MaxUniformComponents = 0; - - state->limits = & limits; + state->limits = (target == GL_VERTEX_PROGRAM_ARB) + ? & ctx->Const.VertexProgram + : & ctx->Const.FragmentProgram; state->MaxTextureImageUnits = 16; state->MaxTextureCoordUnits = 8; |