diff options
author | Karol Herbst <[email protected]> | 2019-03-28 17:53:30 +0100 |
---|---|---|
committer | Karol Herbst <[email protected]> | 2019-04-07 15:13:36 +0200 |
commit | 5450f1c9fb098ad85affb4fba9364052482e7016 (patch) | |
tree | 5113d35f457c62a2cdc6bd54e637bb80abaf7725 /src/broadcom/compiler/v3d40_tex.c | |
parent | 4e802089bcfa278f414fb3a0ce5879d840526691 (diff) |
v3d: prefer using nir_src_comp_as_int over nir_src_as_const_value
Signed-off-by: Karol Herbst <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/broadcom/compiler/v3d40_tex.c')
-rw-r--r-- | src/broadcom/compiler/v3d40_tex.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/broadcom/compiler/v3d40_tex.c b/src/broadcom/compiler/v3d40_tex.c index b6feffe53c9..3bed32d839f 100644 --- a/src/broadcom/compiler/v3d40_tex.c +++ b/src/broadcom/compiler/v3d40_tex.c @@ -138,14 +138,13 @@ v3d40_vir_emit_tex(struct v3d_compile *c, nir_tex_instr *instr) case nir_tex_src_offset: { if (nir_src_is_const(instr->src[i].src)) { - nir_const_value *offset = - nir_src_as_const_value(instr->src[i].src); - - p2_unpacked.offset_s = offset->i32[0]; + p2_unpacked.offset_s = nir_src_comp_as_int(instr->src[i].src, 0); if (instr->coord_components >= 2) - p2_unpacked.offset_t = offset->i32[1]; + p2_unpacked.offset_t = + nir_src_comp_as_int(instr->src[i].src, 1); if (instr->coord_components >= 3) - p2_unpacked.offset_r = offset->i32[2]; + p2_unpacked.offset_r = + nir_src_comp_as_int(instr->src[i].src, 2); } else { struct qreg mask = vir_uniform_ui(c, 0xf); struct qreg x, y, offset; |