diff options
author | Jonathan Marek <[email protected]> | 2019-08-01 12:41:38 -0400 |
---|---|---|
committer | Jonathan Marek <[email protected]> | 2019-08-05 22:09:47 -0400 |
commit | a44b4200f381070ca271089d9f6ac664678abedb (patch) | |
tree | c882e608a02728e9a11e3dbb8efe4192544a5ac3 /src | |
parent | f6e7de41d7b15185b746b79f7ef601c9405adc95 (diff) |
tgsi_to_nir: fix nir_gather_ssa_types for TGSI->NIR shaders
Signed-off-by: Jonathan Marek <[email protected]>
Reviewed-By: Timur Kristóf <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/nir/tgsi_to_nir.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index 007fdf52b5d..9c2639c221f 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -521,7 +521,8 @@ static nir_src ttn_src_for_file_and_index(struct ttn_compile *c, unsigned file, unsigned index, struct tgsi_ind_register *indirect, struct tgsi_dimension *dim, - struct tgsi_ind_register *dimind) + struct tgsi_ind_register *dimind, + bool src_is_float) { nir_builder *b = &c->build; nir_src src; @@ -639,13 +640,17 @@ ttn_src_for_file_and_index(struct ttn_compile *c, unsigned file, unsigned index, } load = nir_intrinsic_instr_create(b->shader, op); + if (op == nir_intrinsic_load_uniform) { + nir_intrinsic_set_type(load, src_is_float ? nir_type_float : + nir_type_int); + } load->num_components = 4; if (dim && (dim->Index > 0 || dim->Indirect)) { if (dimind) { load->src[srcn] = ttn_src_for_file_and_index(c, dimind->File, dimind->Index, - NULL, NULL, NULL); + NULL, NULL, NULL, false); } else { /* UBOs start at index 1 in TGSI: */ load->src[srcn] = @@ -699,7 +704,8 @@ ttn_src_for_indirect(struct ttn_compile *c, struct tgsi_ind_register *indirect) src.src = ttn_src_for_file_and_index(c, indirect->File, indirect->Index, - NULL, NULL, NULL); + NULL, NULL, NULL, + false); return nir_mov_alu(b, src, 1); } @@ -804,7 +810,8 @@ ttn_get_src(struct ttn_compile *c, struct tgsi_full_src_register *tgsi_fsrc, src.src = ttn_src_for_file_and_index(c, tgsi_src->File, tgsi_src->Index, - ind, dim, dimind); + ind, dim, dimind, + src_is_float); } src.swizzle[0] = tgsi_src->SwizzleX; @@ -1456,7 +1463,8 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) src.src = ttn_src_for_file_and_index(c, tex_offset->File, tex_offset->Index, - NULL, NULL, NULL); + NULL, NULL, NULL, + true); src.swizzle[0] = tex_offset->SwizzleX; src.swizzle[1] = tex_offset->SwizzleY; |