diff options
author | Kenneth Graunke <[email protected]> | 2017-09-09 00:19:57 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-10-12 17:22:42 -0700 |
commit | a576c148cd77b3abf44cd673c36bc737dfbedc10 (patch) | |
tree | a4e9e8d0b4c3693695ca6762ccc926a99d991ad5 /src | |
parent | fbf4c2916c14d95209abc6b64737ad8528e62fae (diff) |
nir: Make nir_shader_gather_info() track texelFetch texture accesses.
For TGSI-based drivers, st_glsl_to_tgsi records this information.
For NIR-based drivers, nir_shader_gather_info() will do so.
Reviewed-by: Nicolai Hähnle <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/nir/nir_gather_info.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index ac87bec46c0..f46cee7aa5e 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -264,8 +264,20 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader) static void gather_tex_info(nir_tex_instr *instr, nir_shader *shader) { - if (instr->op == nir_texop_tg4) + switch (instr->op) { + case nir_texop_tg4: shader->info.uses_texture_gather = true; + break; + case nir_texop_txf: + case nir_texop_txf_ms: + case nir_texop_txf_ms_mcs: + shader->info.textures_used_by_txf |= + ((1 << MAX2(instr->texture_array_size, 1)) - 1) << + instr->texture_index; + break; + default: + break; + } } static void |