Skip to content

intel/fs: uniform load optimization

This MR optimizes uniform loads on SSBOs & shared memory. This has 2 effects :

  • reducing send messages by using block loads (load a vec8 in a single GRF instead of 8 GRFs)
  • reduce register pressure due to using fewer GRFs

Here are some fossils stats for various recent titles :

Assassin's Creed Odyssey (gaining 3 SIMD16/32 FS shaders, loosing 14 SIMD16/32 FS shaders):

 PERCENTAGE DELTAS       Shaders   Instrs    Cycles  Subgroup size Send messages Max live registers 
 assassins_creed_odyssey 2110      +0.42%    -0.33%      +0.03%        -0.05%          +0.02%       
 ----------------------------------------------------------------------------------------------------
 All affected            1509      +0.44%    -0.34%      +0.05%        -0.05%          +0.03%       
 ----------------------------------------------------------------------------------------------------
 Total                   2110      +0.42%    -0.33%      +0.03%        -0.05%          +0.02%       

Aztec Ruins:

 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Send messages Max live registers 
 aztec_ruins_high  269       -0.19%    +0.36%      -0.80%          -0.11%       
 --------------------------------------------------------------------------------
 All affected      85        -0.25%    +0.39%      -1.15%          -0.24%       
 --------------------------------------------------------------------------------
 Total             269       -0.19%    +0.36%      -0.80%          -0.11%       

Cyberpunk 2077 (gaining 4 SIMD32 FS shaders):

 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Send messages Max live registers 
 cyberpunk_2077    2757      +0.07%    -0.46%      -0.03%          -0.06%       
 --------------------------------------------------------------------------------
 All affected      1893      +0.07%    -0.50%      -0.03%          -0.08%       
 --------------------------------------------------------------------------------
 Total             2757      +0.07%    -0.46%      -0.03%          -0.06%       

Dota2 (gaining 4 SIMD32 FS shaders, loosing 17) :

 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Send messages Max live registers 
 dota2             1595      -0.12%    -0.05%      -0.01%          -0.02%       
 --------------------------------------------------------------------------------
 All affected      809       -0.16%    -0.07%      -0.01%          -0.04%       
 --------------------------------------------------------------------------------
 Total             1595      -0.12%    -0.05%      -0.01%          -0.02%       

Fallout 4 DXVK:

 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Send messages Max live registers 
 fallout_4_dxvk    1639      +0.19%    -0.15%      -0.06%          -0.40%       
 --------------------------------------------------------------------------------
 All affected      1043      +0.25%    -0.18%      -0.08%          -0.54%       
 --------------------------------------------------------------------------------
 Total             1639      +0.19%    -0.15%      -0.06%          -0.40%       

Red Dead Redemption 2: (also gaining 109 SIMD16/SIMD32 FS shader not there before, loosing 8 SIMD32 shaders)

 PERCENTAGE DELTAS    Shaders   Instrs    Cycles  Subgroup size Send messages Spill count Fill count Scratch Memory Size Max live registers 
 red_dead_redemption2 5839      -0.05%    +2.07%      +0.30%        -5.44%      -41.66%     -35.41%        -43.56%             -6.62%       
 --------------------------------------------------------------------------------------------------------------------------------------------
 All affected         4658      -0.05%    +2.08%      +0.37%        -5.57%      -41.66%     -35.41%        -43.56%             -7.06%       
 --------------------------------------------------------------------------------------------------------------------------------------------
 Total                5839      -0.05%    +2.07%      +0.30%        -5.44%      -41.66%     -35.41%        -43.56%             -6.62%       

Rise of the Tomb Raider:

 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Send messages Max live registers 
 witcher_3_dxvk    1075      +0.02%   +13.26%      -0.03%          -0.03%       
 --------------------------------------------------------------------------------
 All affected      657       +0.03%   +15.54%      -0.04%          -0.04%       
 --------------------------------------------------------------------------------
 Total             1075      +0.02%   +13.26%      -0.03%          -0.03%       

Witcher 3 DXVK:

 PERCENTAGE DELTAS Shaders   Instrs    Cycles  Send messages Max live registers 
 witcher_3_dxvk    1075      +0.02%   +13.26%      -0.03%          -0.03%       
 --------------------------------------------------------------------------------
 All affected      657       +0.03%   +15.54%      -0.04%          -0.04%       
 --------------------------------------------------------------------------------
 Total             1075      +0.02%   +13.26%      -0.03%          -0.03%       

Wolftenstein Youngblood:

 PERCENTAGE DELTAS      Shaders   Instrs    Cycles  Subgroup size Send messages Max live registers 
 wolfenstein_youngblood 1077      -0.14%    +0.13%      +0.06%        -2.37%          -2.12%       
 ---------------------------------------------------------------------------------------------------
 All affected           485       -0.16%    +0.14%      +0.14%        -2.68%          -2.81%       
 ---------------------------------------------------------------------------------------------------
 Total                  1077      -0.14%    +0.13%      +0.06%        -2.37%          -2.12%       

This includes :

Edited by Lionel Landwerlin

Merge request reports