ir_to_mesa: Support user-defined varyings using the linker's locations.
Fixes glsl-reload-source.
This commit is contained in:
@@ -929,15 +929,29 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
|
|||||||
!(var_in ^ in))
|
!(var_in ^ in))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == ARRAY_SIZE(builtin_var_to_mesa_reg)) {
|
if (i != ARRAY_SIZE(builtin_var_to_mesa_reg)) {
|
||||||
printf("Failed to find builtin for %s variable %s\n",
|
entry = new(mem_ctx) temp_entry(ir->var,
|
||||||
var_in ? "in" : "out",
|
builtin_var_to_mesa_reg[i].file,
|
||||||
ir->var->name);
|
builtin_var_to_mesa_reg[i].index);
|
||||||
abort();
|
break;
|
||||||
}
|
}
|
||||||
entry = new(mem_ctx) temp_entry(ir->var,
|
|
||||||
builtin_var_to_mesa_reg[i].file,
|
/* If no builtin, then it's a user-generated varying
|
||||||
builtin_var_to_mesa_reg[i].index);
|
* (FINISHME: or a function argument!)
|
||||||
|
*/
|
||||||
|
/* The linker-assigned location is VERT_RESULT_* or FRAG_ATTRIB*
|
||||||
|
*/
|
||||||
|
assert(ir->var->location != -1);
|
||||||
|
if (var_in) {
|
||||||
|
entry = new(mem_ctx) temp_entry(ir->var,
|
||||||
|
PROGRAM_INPUT,
|
||||||
|
ir->var->location);
|
||||||
|
} else {
|
||||||
|
entry = new(mem_ctx) temp_entry(ir->var,
|
||||||
|
PROGRAM_OUTPUT,
|
||||||
|
ir->var->location);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ir_var_auto:
|
case ir_var_auto:
|
||||||
entry = new(mem_ctx) temp_entry(ir->var, PROGRAM_TEMPORARY,
|
entry = new(mem_ctx) temp_entry(ir->var, PROGRAM_TEMPORARY,
|
||||||
|
Reference in New Issue
Block a user