diff options
Diffstat (limited to 'src/mesa/shader/ir_to_mesa.cpp')
-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 7cc469f3a7..1a9b0e3948 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, |