intel/fs: Expose a couple of NIR lowering helpers
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 18 Jul 2019 14:23:23 +0000 (09:23 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 23 Jun 2020 17:43:53 +0000 (17:43 +0000)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5596>

src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_nir.h

index d3dc1f45110ce967b85c4d839dec2808321a473c..63a724e07b7eefbcc754e668b2fd6c974521beaf 100644 (file)
@@ -8402,8 +8402,8 @@ computed_depth_mode(const nir_shader *shader)
  *
  * This should be replaced by global value numbering someday.
  */
-static bool
-move_interpolation_to_top(nir_shader *nir)
+bool
+brw_nir_move_interpolation_to_top(nir_shader *nir)
 {
    bool progress = false;
 
@@ -8468,8 +8468,8 @@ move_interpolation_to_top(nir_shader *nir)
  *
  * Useful when rendering to a non-multisampled buffer.
  */
-static bool
-demote_sample_qualifiers(nir_shader *nir)
+bool
+brw_nir_demote_sample_qualifiers(nir_shader *nir)
 {
    bool progress = true;
 
@@ -8556,8 +8556,8 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
    }
 
    if (!key->multisample_fbo)
-      NIR_PASS_V(shader, demote_sample_qualifiers);
-   NIR_PASS_V(shader, move_interpolation_to_top);
+      NIR_PASS_V(shader, brw_nir_demote_sample_qualifiers);
+   NIR_PASS_V(shader, brw_nir_move_interpolation_to_top);
    brw_postprocess_nir(shader, compiler, true);
 
    /* key->alpha_test_func means simulating alpha testing via discards,
index 246218375f74610128a7f7c5cfea946dcb7221b1..6a3a46384edf9ff974cebe7065f72c6eb32ef98e 100644 (file)
@@ -192,6 +192,9 @@ nir_shader *brw_nir_create_passthrough_tcs(void *mem_ctx,
 #define BRW_NIR_FRAG_OUTPUT_LOCATION_SHIFT 1
 #define BRW_NIR_FRAG_OUTPUT_LOCATION_MASK INTEL_MASK(31, 1)
 
+bool brw_nir_move_interpolation_to_top(nir_shader *nir);
+bool brw_nir_demote_sample_qualifiers(nir_shader *nir);
+
 #ifdef __cplusplus
 }
 #endif