From cadd7dd384b33a779d46bd664f456bed4a21a5b7 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 2 Jul 2015 15:41:02 -0700 Subject: i965/fs: Add a very basic validation pass Currently the validation pass only validates that regs_read and regs_written are consistent with the sizes of VGRF's. We can add more as we find it to be useful. Reviewed-by: Matt Turner --- src/mesa/drivers/dri/i965/brw_fs.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp') diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index b9f1051eca4..63bee0aa5fd 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -4781,6 +4781,9 @@ fs_visitor::calculate_register_pressure() void fs_visitor::optimize() { + /* Start by validating the shader we currently have. */ + validate(); + /* bld is the common builder object pointing at the end of the program we * used to translate it into i965 IR. For the optimization and lowering * passes coming next, any code added after the end of the program without @@ -4797,7 +4800,10 @@ fs_visitor::optimize() assign_constant_locations(); demote_pull_constants(); + validate(); + split_virtual_grfs(); + validate(); #define OPT(pass, args...) ({ \ pass_num++; \ @@ -4811,6 +4817,8 @@ fs_visitor::optimize() backend_shader::dump_instructions(filename); \ } \ \ + validate(); \ + \ progress = progress || this_progress; \ this_progress; \ }) @@ -4872,6 +4880,8 @@ fs_visitor::optimize() OPT(lower_integer_multiplication); lower_uniform_pull_constant_loads(); + + validate(); } /** -- cgit v1.2.3