Henri Verbeet pushed to branch master at wine / vkd3d
Commits: 1d74ff07 by Francisco Casas at 2025-02-20T15:44:04+01:00 vkd3d-make/hlsl: Trace the number of registers allocated in allocate_temp_registers().
- - - - - 8e6ddb0c by Elizabeth Figura at 2025-02-20T15:44:09+01:00 vkd3d-shader/hlsl: Don't mark extern variables with an explicit first_write or last_read.
Fix the last few places that care.
- - - - - 321fda9c by Francisco Casas at 2025-02-20T15:44:09+01:00 vkd3d-shader/hlsl: Only use the temp copy for variables that are written.
This can save a significant amount of temp registers because it allows to avoid referencing the temp (and having to store it) when not needed.
For instance, this patch lowers the number of required temps for the following ps_2_0 shader from 24 to 19:
int i; float3x3 mats[4];
float4 main() : sv_target { return mul(mats[i], float3(1, 2, 3)).xyzz; }
Also, it is needed for SM1 vertex shader relative addressing since non-constant loads are required to be directly on the uniform ('c' registers) instead of the temp, and non-constant loads cannot be transformed by copy propagation.
- - - - - e60c89c5 by Francisco Casas at 2025-02-20T15:44:09+01:00 tests: Test unused invalid samples with a static sampler.
- - - - - 153b7c84 by Francisco Casas at 2025-02-20T15:44:09+01:00 vkd3d-shader/hlsl: Run folding passes again after lower_nonconstant_array_loads.
This is because lower_nonconstant_array_loads() can potentially turn nonconstant loads into constant loads, allowing copy-prop to turn these loads into previous instructions, which might help other passes as well.
This patch lowers the number of required temps for the following ps_2_0 shader from 19 to 16:
int i; float3x3 mats[4];
float4 main() : sv_target { return mul(mats[i], float3(1, 2, 3)).xyzz; }
- - - - -
3 changed files:
- libs/vkd3d-shader/hlsl.h - libs/vkd3d-shader/hlsl_codegen.c - tests/hlsl/static-initializer.shader_test
View it on GitLab: https://gitlab.winehq.org/wine/vkd3d/-/compare/f830ac12067d31c0fcfd310753e3c...