Module: Mesa Branch: main Commit: 81bc09bf97410cfc1b09d1f6471214d0c023e2fd URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=81bc09bf97410cfc1b09d1f6471214d0c023e2fd
Author: Caio Oliveira <[email protected]> Date: Tue Oct 3 11:12:47 2023 -0700 intel/fs: Tweak default case of fs_inst::size_read() In the default case, there's a special case with a few conditions. Prefer the cheapest conditions first, so we can take advantage of short-circuiting. Effect is a small but still significant reduce in shader compilation times, as can be seen by: - Fossil replay for Rise of the Tomb Raider ``` Difference at 95.0% confidence -0.433333 +/- 0.028609 -1.42556% +/- 0.0941163% (Student's t, pooled s = 0.0337886) ``` - Fossil replay for Batman Arkham City ``` Difference at 95.0% confidence -8.84 +/- 0.146083 -1.65932% +/- 0.0274207% (Student's t, pooled s = 0.125423) ``` Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Emma Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25549> --- src/intel/compiler/brw_fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 02d8f56a6a1..1fdf6f05b5f 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -911,7 +911,7 @@ fs_inst::size_read(int arg) const break; default: - if (is_tex() && arg == 0 && src[0].file == VGRF) + if (arg == 0 && src[0].file == VGRF && is_tex()) return mlen * REG_SIZE; break; }
