diff options
author | Axel Davy <[email protected]> | 2018-04-08 17:06:00 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2019-04-30 19:18:51 +0200 |
commit | 95f25bef546806c8d0e6670aceadf28eb64aea1a (patch) | |
tree | 81af667decebcda855d8b4d18ccb875234a1b356 /src/gallium/state_trackers/nine/swapchain9ex.h | |
parent | e57267a09ee2daf13d54539679e2e322943a58dd (diff) |
st/nine: Recompile optimized shaders based on b/i consts
Boolean and Integer constants are used in d3d9 for flow control.
Boolean are used for if/then/else and Integer constants
for loops.
The compilers can generate better code if these values are known
at compilation.
I haven't met so far a game that would change the values of these
constants frequently (and when they do, they set to the values used
for the previous draw call, and thus the changes get filtered out).
Thus it makes sense to inline these constants and recompile the shaders.
The commit sets a bound to the number of variants for a given shader
to avoid too many shaders to be generated.
One drawback is it means more shader compilations. It would probably
make sense to compile these shaders asynchronously or let the user
control the behaviour with an env var, but this is not done here.
The games I tested hit very few shader variants, and the performance
impact was negligible, but it could help for games with uber shaders.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/swapchain9ex.h')
0 files changed, 0 insertions, 0 deletions