nir/lower_tex: use texture_mask instead of shifting on use
In commit292ac71a4a("nir/lower_tex: handle deref casts"), we avoided using texture_index when a texture instruction contained a variable deref. There's no good reason why this should be done to some of the lowering, but not all. So let's fix up code-paths that were added after this change to do the same. The first two patches here crossed paths with the commit that introduced texture_mask, so it's not strange that the change was missed. The last one seems to have just copied what was done around it, propagating the issue. Fixes:880b00dc59("nir/lower_tex: Add support for lowering YUYV formats") Fixes:1358d93650("nir/lower_tex: Add support for lowering Y41x formats") Fixes:65d6f5aed2("nir: add options to lower y_vu, yv_yu, yx_xvxu and xy_vxux") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34365>
This commit is contained in:
committed by
Marge Bot
parent
8e069e1ef9
commit
41b136f674
@@ -1627,17 +1627,17 @@ nir_lower_tex_block(nir_block *block, nir_builder *b,
|
||||
progress = true;
|
||||
}
|
||||
|
||||
if ((1 << tex->texture_index) & options->lower_yu_yv_external) {
|
||||
if (texture_mask & options->lower_yu_yv_external) {
|
||||
lower_yu_yv_external(b, tex, options, texture_index);
|
||||
progress = true;
|
||||
}
|
||||
|
||||
if ((1 << tex->texture_index) & options->lower_yv_yu_external) {
|
||||
if (texture_mask & options->lower_yv_yu_external) {
|
||||
lower_yv_yu_external(b, tex, options, texture_index);
|
||||
progress = true;
|
||||
}
|
||||
|
||||
if ((1 << tex->texture_index) & options->lower_y41x_external) {
|
||||
if (texture_mask & options->lower_y41x_external) {
|
||||
lower_y41x_external(b, tex, options, texture_index);
|
||||
progress = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user