mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
nir/lower_tex: ignore saturate for txf ops
saturate is used for GL_CLAMP emulation, and GL_CLAMP cannot be used
with txf
ref #9226
cc: mesa-stable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23750>
(cherry picked from commit 402ae3b132)
This commit is contained in:
parent
552ac035f0
commit
16964024b6
2 changed files with 10 additions and 8 deletions
|
|
@ -1687,7 +1687,7 @@
|
|||
"description": "nir/lower_tex: ignore saturate for txf ops",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1419,13 +1419,15 @@ nir_lower_tex_block(nir_block *block, nir_builder *b,
|
|||
|
||||
/* mask of src coords to saturate (clamp): */
|
||||
unsigned sat_mask = 0;
|
||||
|
||||
if ((1 << tex->sampler_index) & options->saturate_r)
|
||||
sat_mask |= (1 << 2); /* .z */
|
||||
if ((1 << tex->sampler_index) & options->saturate_t)
|
||||
sat_mask |= (1 << 1); /* .y */
|
||||
if ((1 << tex->sampler_index) & options->saturate_s)
|
||||
sat_mask |= (1 << 0); /* .x */
|
||||
/* ignore saturate for txf ops: these don't use samplers and can't GL_CLAMP */
|
||||
if (nir_tex_instr_need_sampler(tex)) {
|
||||
if ((1 << tex->sampler_index) & options->saturate_r)
|
||||
sat_mask |= (1 << 2); /* .z */
|
||||
if ((1 << tex->sampler_index) & options->saturate_t)
|
||||
sat_mask |= (1 << 1); /* .y */
|
||||
if ((1 << tex->sampler_index) & options->saturate_s)
|
||||
sat_mask |= (1 << 0); /* .x */
|
||||
}
|
||||
|
||||
if (options->lower_index_to_offset)
|
||||
progress |= lower_index_to_offset(b, tex);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue