diff options
author | Iago Toral Quiroga <[email protected]> | 2016-11-30 09:40:43 +0100 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2016-12-13 10:32:00 +0100 |
commit | a8e740c3547b0209d04b505d95a79794db31ce0b (patch) | |
tree | 010a776eb5d4f28abc6ebd422bafa39d76e56a54 /src/compiler/nir/nir.h | |
parent | bac303c286de2a07912333a775bf4af18cd04e7a (diff) |
nir/lower_tex: add lowering for texture gradient on cube maps
This is ported from the Intel lowering pass that we use with GLSL IR.
The NIR pass only handles cube maps, not shadow samplers, which are
also lowered for gen < 8 on Intel hardware. We will add support for
that in a later patch, at which point we should be able to remove
the GLSL IR lowering pass.
v2:
- added a helper to retrieve ddx/ddy parameters (Ken)
- No need to make size.z=1.0, we are only using component x anyway (Iago)
v3:
- Get rid of the ddx/ddy helper and use nir_tex_instr_src_index
instead (Ken, Eric)
v4:
- When emitting the textureLod operation, copy all texture parameters
from the original textureGrad() (except for ddx/ddy) using a loop
- Add a 'continue' statement if the lowering makes progress because it
replaces the original texture instruction
Reviewed-by: Kenneth Graunke <[email protected]> (v3)
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r-- | src/compiler/nir/nir.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 3040cbd2c36..826410d5ac3 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2394,6 +2394,11 @@ typedef struct nir_lower_tex_options { * of the texture are lowered to linear. */ unsigned lower_srgb; + + /** + * If true, lower nir_texop_txd on cube maps with nir_texop_txl. + */ + bool lower_txd_cube_map; } nir_lower_tex_options; bool nir_lower_tex(nir_shader *shader, |