nir: Add a large constants optimization pass
This pass searches for reasonably large local variables which can be statically proven to be constant and moves them into shader constant data. This is especially useful when large tables are baked into the shader source code because they can be moved into a UBO by the driver to reduce register pressure and make indirect access cheaper. v2 (Jason Ekstrand): - Use a size/align function to ensure we get the right alignments - Use the newly added deref offset helpers Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -160,6 +160,7 @@ files_libnir = files(
|
||||
'nir_opt_global_to_local.c',
|
||||
'nir_opt_if.c',
|
||||
'nir_opt_intrinsics.c',
|
||||
'nir_opt_large_constants.c',
|
||||
'nir_opt_loop_unroll.c',
|
||||
'nir_opt_move_comparisons.c',
|
||||
'nir_opt_move_load_ubo.c',
|
||||
|
Reference in New Issue
Block a user