From ced1a6b8f5a750fcd3b8d3d0d9bbdee830064e6c Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 28 Jun 2013 16:47:15 +0200 Subject: fontconfig mesa git update 28 June 2013 fontconfig commit 197d06c49b01413303f2c92130594daa4fcaa6ad mesa commit 24b05ff1581b612ab6dbf4937fa4b644b4e61379 --- mesalib/src/glsl/ast_to_hir.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mesalib/src/glsl/ast_to_hir.cpp') diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp index 4b5f04980..efbd72c18 100644 --- a/mesalib/src/glsl/ast_to_hir.cpp +++ b/mesalib/src/glsl/ast_to_hir.cpp @@ -94,6 +94,24 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) detect_conflicting_assignments(state, instructions); state->toplevel_ir = NULL; + + /* Move all of the variable declarations to the front of the IR list, and + * reverse the order. This has the (intended!) side effect that vertex + * shader inputs and fragment shader outputs will appear in the IR in the + * same order that they appeared in the shader code. This results in the + * locations being assigned in the declared order. Many (arguably buggy) + * applications depend on this behavior, and it matches what nearly all + * other drivers do. + */ + foreach_list_safe(node, instructions) { + ir_variable *const var = ((ir_instruction *) node)->as_variable(); + + if (var == NULL) + continue; + + var->remove(); + instructions->push_head(var); + } } -- cgit v1.2.3