aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir.h
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2016-11-30 11:31:01 +0100
committerIago Toral Quiroga <[email protected]>2016-12-13 10:32:52 +0100
commit5be2e785b1df2160424eb73e53cca340e0130020 (patch)
tree9f3766b1975786ebbb3b0529099de34be499784e /src/compiler/nir/nir.h
parentf90da64fc65d8da99a5a5a140be7b64c8cf5ee6a (diff)
nir/lower_tex: add lowering for texture gradient on shadow samplers
This is ported from the Intel lowering pass that we use with GLSL IR. This takes care of lowering texture gradients on shadow samplers other than cube maps. Intel hardware requires this for gen < 8. v2 (Ken): - Use the helper function to retrieve ddx/ddy - Swizzle away size components we are not interested in v3: - Get rid of the ddx/ddy helper and use nir_tex_instr_src_index instead (Ken, Eric) v4: - 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.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 826410d5ac3..ba88a249ae8 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2399,6 +2399,13 @@ typedef struct nir_lower_tex_options {
* If true, lower nir_texop_txd on cube maps with nir_texop_txl.
*/
bool lower_txd_cube_map;
+
+ /**
+ * If true, lower nir_texop_txd on shadow samplers (except cube maps)
+ * with nir_texop_txl. Notice that cube map shadow samplers are lowered
+ * with lower_txd_cube_map.
+ */
+ bool lower_txd_shadow;
} nir_lower_tex_options;
bool nir_lower_tex(nir_shader *shader,