X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fff_fragment_shader.cpp;h=48b84e8fd7324211b178428d418b75521c2f2030;hb=4807a83da0e0f5e3272e85504ee3b2213ef1910a;hp=e10a93b32f91f3e6d179e0d9c3e303c9b6feb464;hpb=a56a505db72b0a5ff973a489a094186d7dfcd9e7;p=mesa.git diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp index e10a93b32f9..48b84e8fd73 100644 --- a/src/mesa/main/ff_fragment_shader.cpp +++ b/src/mesa/main/ff_fragment_shader.cpp @@ -990,7 +990,7 @@ static void load_texture( texenv_fragment_program *p, GLuint unit ) if (p->state->unit[unit].shadow) { texcoord = texcoord->clone(p->mem_ctx, NULL); - tex->shadow_comparitor = new(p->mem_ctx) ir_swizzle(texcoord, + tex->shadow_comparator = new(p->mem_ctx) ir_swizzle(texcoord, coords, 0, 0, 0, 1); coords++; @@ -1202,6 +1202,9 @@ create_new_program(struct gl_context *ctx, struct state_key *key) p.mem_ctx = ralloc_context(NULL); p.shader = _mesa_new_shader(0, MESA_SHADER_FRAGMENT); +#ifdef DEBUG + p.shader->SourceChecksum = 0xf18ed; /* fixed */ +#endif p.shader->ir = new(p.shader) exec_list; state = new(p.shader) _mesa_glsl_parse_state(ctx, MESA_SHADER_FRAGMENT, p.shader); @@ -1251,9 +1254,13 @@ create_new_program(struct gl_context *ctx, struct state_key *key) const struct gl_shader_compiler_options *options = &ctx->Const.ShaderCompilerOptions[MESA_SHADER_FRAGMENT]; - while (do_common_optimization(p.shader->ir, false, false, options, - ctx->Const.NativeIntegers)) - ; + /* Conservative approach: Don't optimize here, the linker does it too. */ + if (!ctx->Const.GLSLOptimizeConservatively) { + while (do_common_optimization(p.shader->ir, false, false, options, + ctx->Const.NativeIntegers)) + ; + } + reparent_ir(p.shader->ir, p.shader->ir); p.shader->CompileStatus = true;