mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 18:00:10 +01:00
intel/compiler: Trim vector properly till array index
This fixes the off-by one mistake, we want to trim the vector till the
array index not till the coordinates last component.
v2: (Ian)
- Use tex->coord_component - 1 in nir_trim_vector
Fixes: 73a3257968 ("intel/compiler: Add texture operation lowering pass")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447>
This commit is contained in:
parent
db0291c235
commit
d4ce848476
1 changed files with 2 additions and 1 deletions
|
|
@ -84,7 +84,8 @@ pack_lod_and_array_index(nir_builder *b, nir_tex_instr *tex)
|
|||
/* Second, replace the coordinate with a new value that has one fewer
|
||||
* component (i.e., drop the array index).
|
||||
*/
|
||||
nir_def *reduced_coord = nir_trim_vector(b, coord, 2);
|
||||
nir_def *reduced_coord = nir_trim_vector(b, coord,
|
||||
tex->coord_components - 1);
|
||||
tex->coord_components--;
|
||||
|
||||
/* Finally, remove the old sources and add the new. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue