aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-02-20 17:19:50 -0600
committerMarge Bot <[email protected]>2020-02-21 18:48:03 +0000
commit1598370aca6459ba54915a26683a75bb66f88161 (patch)
treeb3c13156f942d372bdbb1d55f5ee8a0e7c49b8c2 /src/gallium
parent265e234e234f75cd5c209f76900009f81e2d6aec (diff)
nir/builder: Return an integer from nir_get_texture_size
It's convenient in a bunch of cases for nir_get_texture_size to return a float but it's very unexpected. This fixes a bug in the R600 NIR code. Fixes: f718ac62688b "r600/sfn: Add a basic nir shader backend" Reviewed-by: Eric Anholt <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3897> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3897>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r600/sfn/sfn_instruction_tex.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/sfn/sfn_instruction_tex.cpp b/src/gallium/drivers/r600/sfn/sfn_instruction_tex.cpp
index 0e7b63db570..0f0de213429 100644
--- a/src/gallium/drivers/r600/sfn/sfn_instruction_tex.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_instruction_tex.cpp
@@ -246,7 +246,7 @@ bool lower_txl_txf_array_or_cube(nir_builder *b, nir_tex_instr *tex)
int min_lod_idx = nir_tex_instr_src_index(tex, nir_tex_src_min_lod);
assert (lod_idx >= 0 || bias_idx >= 0);
- nir_ssa_def *size = nir_get_texture_size(b, tex);
+ nir_ssa_def *size = nir_i2f32(b, nir_get_texture_size(b, tex));
nir_ssa_def *lod = (lod_idx >= 0) ?
nir_ssa_for_src(b, tex->src[lod_idx].src, 1) :
nir_get_texture_lod(b, tex);