nir/lower_tex: add txp lowering option for arrays

this is illegal in vulkan, so zink needs to be able to lower these

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15510>
This commit is contained in:
Mike Blumenkrantz 2022-03-22 10:56:43 -04:00 committed by Marge Bot
parent 821c141f9d
commit 4e35ed8c67
2 changed files with 7 additions and 1 deletions

View file

@ -4823,6 +4823,11 @@ typedef struct nir_lower_tex_options {
*/
unsigned lower_txp;
/**
* If true, lower texture projector for any array sampler dims
*/
bool lower_txp_array;
/**
* If true, lower away nir_tex_src_offset for all texelfetch instructions.
*/

View file

@ -1319,7 +1319,8 @@ nir_lower_tex_block(nir_block *block, nir_builder *b,
/* If we are clamping any coords, we must lower projector first
* as clamping happens *after* projection:
*/
if (lower_txp || sat_mask) {
if (lower_txp || sat_mask ||
(options->lower_txp_array && tex->is_array)) {
progress |= project_src(b, tex);
}