nir/lower_tex: support for lowering RECT textures
[mesa.git] / src / glsl / nir / nir.h
index 83e31533e8bf597601339769696d8a4a2f1a47eb..3c908b9f295e5873ebac96aace1671cc8a1d1883 100644 (file)
@@ -1836,7 +1836,25 @@ void nir_lower_samplers(nir_shader *shader,
                         const struct gl_shader_program *shader_program);
 
 void nir_lower_system_values(nir_shader *shader);
-void nir_lower_tex_projector(nir_shader *shader);
+
+typedef struct nir_lower_tex_options {
+   /**
+    * bitmask of (1 << GLSL_SAMPLER_DIM_x) to control for which
+    * sampler types a texture projector is lowered.
+    */
+   unsigned lower_txp;
+
+   /**
+    * If true, lower rect textures to 2D, using txs to fetch the
+    * texture dimensions and dividing the texture coords by the
+    * texture dims to normalize.
+    */
+   bool lower_rect;
+} nir_lower_tex_options;
+
+void nir_lower_tex(nir_shader *shader,
+                   const nir_lower_tex_options *options);
+
 void nir_lower_idiv(nir_shader *shader);
 
 void nir_lower_clip_vs(nir_shader *shader, unsigned ucp_enables);