diff options
author | Ian Romanick <[email protected]> | 2010-07-18 15:59:43 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-07-20 17:48:24 -0700 |
commit | 2462a536ea5c98867296905e3da127eba7c7bdff (patch) | |
tree | 661139c92c86bda4966b6365cd95820650fc52ef /src/mesa | |
parent | 7e2aa91507a5883e33473e0a94215ee3985baad1 (diff) |
glsl2: Add a constructor for _mesa_glsl_parse_state
Coming changes to the handling of built-in functions necessitate this.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/shader/ir_to_mesa.cpp | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp index 7cc469f3a72..1a9b0e39481 100644 --- a/src/mesa/shader/ir_to_mesa.cpp +++ b/src/mesa/shader/ir_to_mesa.cpp @@ -2155,38 +2155,8 @@ steal_memory(ir_instruction *ir, void *new_ctx) void _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader) { - struct _mesa_glsl_parse_state *state; - - state = talloc_zero(shader, struct _mesa_glsl_parse_state); - switch (shader->Type) { - case GL_VERTEX_SHADER: state->target = vertex_shader; break; - case GL_FRAGMENT_SHADER: state->target = fragment_shader; break; - case GL_GEOMETRY_SHADER: state->target = geometry_shader; break; - } - - state->scanner = NULL; - state->translation_unit.make_empty(); - state->symbols = new(shader) glsl_symbol_table; - state->info_log = talloc_strdup(shader, ""); - state->error = false; - state->loop_or_switch_nesting = NULL; - state->ARB_texture_rectangle_enable = true; - - state->extensions = &ctx->Extensions; - - state->Const.MaxLights = ctx->Const.MaxLights; - state->Const.MaxClipPlanes = ctx->Const.MaxClipPlanes; - state->Const.MaxTextureUnits = ctx->Const.MaxTextureUnits; - state->Const.MaxTextureCoords = ctx->Const.MaxTextureCoordUnits; - state->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs; - state->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents; - state->Const.MaxVaryingFloats = ctx->Const.MaxVarying * 4; - state->Const.MaxVertexTextureImageUnits = ctx->Const.MaxVertexTextureImageUnits; - state->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits; - state->Const.MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits; - state->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents; - - state->Const.MaxDrawBuffers = ctx->Const.MaxDrawBuffers; + struct _mesa_glsl_parse_state *state = + new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader); const char *source = shader->Source; state->error = preprocess(state, &source, &state->info_log, |