X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_glsl_to_tgsi.cpp;h=60a4e2831a415e4337b4359d95c77ece5d82cbfe;hb=bb4c5d72d7c7cb1d9e7016e2c07c36875f30011a;hp=6745554211b46566ad0ec8e8ead648923add51bb;hpb=82065fa20ee3f2880a070f1f4f75509b910cedde;p=mesa.git diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 6745554211b..60a4e2831a4 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -1775,9 +1775,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir) emit(ir, TGSI_OPCODE_TRUNC, result_dst, op[0]); break; case ir_unop_ceil: - op[0].negate = ~op[0].negate; - emit(ir, TGSI_OPCODE_FLR, result_dst, op[0]); - result_src.negate = ~result_src.negate; + emit(ir, TGSI_OPCODE_CEIL, result_dst, op[0]); break; case ir_unop_floor: emit(ir, TGSI_OPCODE_FLR, result_dst, op[0]); @@ -1925,7 +1923,7 @@ glsl_to_tgsi_visitor::visit(ir_dereference_variable *ir) assert(var->location != -1); entry = new(mem_ctx) variable_storage(var, PROGRAM_OUTPUT, - var->location); + var->location + var->index); break; case ir_var_system_value: entry = new(mem_ctx) variable_storage(var, @@ -2815,6 +2813,10 @@ glsl_to_tgsi_visitor::glsl_to_tgsi_visitor() indirect_addr_temps = false; indirect_addr_consts = false; mem_ctx = ralloc_context(NULL); + ctx = NULL; + prog = NULL; + shader_program = NULL; + options = NULL; } glsl_to_tgsi_visitor::~glsl_to_tgsi_visitor() @@ -3959,7 +3961,7 @@ dst_register(struct st_translate *t, case PROGRAM_TEMPORARY: if (ureg_dst_is_undef(t->temps[index])) - t->temps[index] = ureg_DECL_temporary(t->ureg); + t->temps[index] = ureg_DECL_local_temporary(t->ureg); return t->temps[index]; @@ -4000,7 +4002,7 @@ src_register(struct st_translate *t, assert(index >= 0); assert(index < Elements(t->temps)); if (ureg_dst_is_undef(t->temps[index])) - t->temps[index] = ureg_DECL_temporary(t->ureg); + t->temps[index] = ureg_DECL_local_temporary(t->ureg); return ureg_src(t->temps[index]); case PROGRAM_NAMED_PARAM: @@ -4257,7 +4259,7 @@ emit_wpos_adjustment( struct st_translate *t, * or not, which is determined by testing against the inversion * state variable used below, which will be either +1 or -1. */ - struct ureg_dst adj_temp = ureg_DECL_temporary(ureg); + struct ureg_dst adj_temp = ureg_DECL_local_temporary(ureg); ureg_CMP(ureg, adj_temp, ureg_scalar(wpostrans, invert ? 2 : 0), @@ -4620,7 +4622,7 @@ st_translate_program( */ for (i = 0; i < (unsigned)program->next_temp; i++) { /* XXX use TGSI_FILE_TEMPORARY_ARRAY when it's supported by ureg */ - t->temps[i] = ureg_DECL_temporary(t->ureg); + t->temps[i] = ureg_DECL_local_temporary(t->ureg); } }