diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-05-23 05:33:34 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-05-23 05:33:34 +0000 |
commit | 9886815a25d84be79f51e65ebd8e458bb5d26ca8 (patch) | |
tree | a65edf018dd992543337433f7303fb29a6c8e8cf /lib/mesa/src/gallium/auxiliary/nir | |
parent | e2a3acb64af2657b1181806818eacad061103c23 (diff) |
Merge Mesa 19.0.5
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/nir')
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/nir/tgsi_to_nir.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/nir/tgsi_to_nir.c b/lib/mesa/src/gallium/auxiliary/nir/tgsi_to_nir.c index 4fa36cc7d..10e243878 100644 --- a/lib/mesa/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/lib/mesa/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -181,8 +181,8 @@ ttn_emit_declaration(struct ttn_compile *c) /* for arrays, we create variables instead of registers: */ nir_variable *var = rzalloc(b->shader, nir_variable); - var->type = glsl_array_type(glsl_vec4_type(), array_size); - var->data.mode = nir_var_global; + var->type = glsl_array_type(glsl_vec4_type(), array_size, 0); + var->data.mode = nir_var_shader_temp; var->name = ralloc_asprintf(var, "arr_%d", decl->Array.ArrayID); exec_list_push_tail(&b->shader->globals, &var->node); @@ -265,7 +265,7 @@ ttn_emit_declaration(struct ttn_compile *c) var->type = glsl_vec4_type(); if (is_array) - var->type = glsl_array_type(var->type, array_size); + var->type = glsl_array_type(var->type, array_size, 0); switch (file) { case TGSI_FILE_INPUT: @@ -516,8 +516,7 @@ ttn_src_for_file_and_index(struct ttn_compile *c, unsigned file, unsigned index, c->scan->input_semantic_name[index] == TGSI_SEMANTIC_FACE) { nir_ssa_def *tgsi_frontface[4] = { nir_bcsel(&c->build, - nir_load_system_value(&c->build, - nir_intrinsic_load_front_face, 0), + nir_load_front_face(&c->build, 1), nir_imm_float(&c->build, 1.0), nir_imm_float(&c->build, -1.0)), nir_imm_float(&c->build, 0.0), @@ -938,9 +937,7 @@ ttn_kill(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src) static void ttn_kill_if(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src) { - nir_ssa_def *cmp = nir_bany_inequal4(b, nir_flt(b, src[0], - nir_imm_float(b, 0.0)), - nir_imm_int(b, 0)); + nir_ssa_def *cmp = nir_bany(b, nir_flt(b, src[0], nir_imm_float(b, 0.0))); nir_intrinsic_instr *discard = nir_intrinsic_instr_create(b->shader, nir_intrinsic_discard_if); discard->src[0] = nir_src_for_ssa(cmp); @@ -1471,10 +1468,10 @@ static const nir_op op_trans[TGSI_OPCODE_LAST] = { [TGSI_OPCODE_ENDSUB] = 0, /* XXX: no function calls */ [TGSI_OPCODE_NOP] = 0, - [TGSI_OPCODE_FSEQ] = nir_op_feq, - [TGSI_OPCODE_FSGE] = nir_op_fge, - [TGSI_OPCODE_FSLT] = nir_op_flt, - [TGSI_OPCODE_FSNE] = nir_op_fne, + [TGSI_OPCODE_FSEQ] = nir_op_feq32, + [TGSI_OPCODE_FSGE] = nir_op_fge32, + [TGSI_OPCODE_FSLT] = nir_op_flt32, + [TGSI_OPCODE_FSNE] = nir_op_fne32, [TGSI_OPCODE_KILL_IF] = 0, @@ -1485,9 +1482,9 @@ static const nir_op op_trans[TGSI_OPCODE_LAST] = { [TGSI_OPCODE_IMAX] = nir_op_imax, [TGSI_OPCODE_IMIN] = nir_op_imin, [TGSI_OPCODE_INEG] = nir_op_ineg, - [TGSI_OPCODE_ISGE] = nir_op_ige, + [TGSI_OPCODE_ISGE] = nir_op_ige32, [TGSI_OPCODE_ISHR] = nir_op_ishr, - [TGSI_OPCODE_ISLT] = nir_op_ilt, + [TGSI_OPCODE_ISLT] = nir_op_ilt32, [TGSI_OPCODE_F2U] = nir_op_f2u32, [TGSI_OPCODE_U2F] = nir_op_u2f32, [TGSI_OPCODE_UADD] = nir_op_iadd, @@ -1497,11 +1494,11 @@ static const nir_op op_trans[TGSI_OPCODE_LAST] = { [TGSI_OPCODE_UMIN] = nir_op_umin, [TGSI_OPCODE_UMOD] = nir_op_umod, [TGSI_OPCODE_UMUL] = nir_op_imul, - [TGSI_OPCODE_USEQ] = nir_op_ieq, - [TGSI_OPCODE_USGE] = nir_op_uge, + [TGSI_OPCODE_USEQ] = nir_op_ieq32, + [TGSI_OPCODE_USGE] = nir_op_uge32, [TGSI_OPCODE_USHR] = nir_op_ushr, - [TGSI_OPCODE_USLT] = nir_op_ult, - [TGSI_OPCODE_USNE] = nir_op_ine, + [TGSI_OPCODE_USLT] = nir_op_ult32, + [TGSI_OPCODE_USNE] = nir_op_ine32, [TGSI_OPCODE_SWITCH] = 0, /* not emitted by glsl_to_tgsi.cpp */ [TGSI_OPCODE_CASE] = 0, /* not emitted by glsl_to_tgsi.cpp */ |