i965/fs_nir: Validate optimization passes
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 7 Nov 2014 19:03:12 +0000 (11:03 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Jan 2015 15:19:01 +0000 (07:19 -0800)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index 4dafe77..05fe396 100644 (file)
@@ -54,14 +54,21 @@ fs_visitor::emit_nir_code()
    if (1)
       nir_print_shader(nir, stderr);
 
-   nir_convert_to_ssa(nir);
-   nir_copy_prop(nir);
-   nir_opt_dce(nir);
-   nir_print_shader(nir, stderr);
-
-   nir_convert_from_ssa(nir);
-   nir_lower_vec_to_movs(nir);
-   nir_print_shader(nir, stderr);
+   if (1) {
+      nir_convert_to_ssa(nir);
+      nir_validate_shader(nir);
+      nir_copy_prop(nir);
+      nir_validate_shader(nir);
+      nir_opt_dce(nir);
+      nir_validate_shader(nir);
+      nir_print_shader(nir, stderr);
+
+      nir_convert_from_ssa(nir);
+      nir_print_shader(nir, stderr);
+      nir_validate_shader(nir);
+      nir_lower_vec_to_movs(nir);
+      nir_validate_shader(nir);
+   }
 
    /* emit the arrays used for inputs and outputs - load/store intrinsics will
     * be converted to reads/writes of these arrays