so that most shaders can get lower VGPR usage thanks to lazy input loading.
I think this is a more accurate constraint that prevents the black transitions
in Witcher 2.
Affected shaders (7758):
Max Waves: 57437 -> 58231 (1.38 %)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
/* If this is true, preload FS inputs at the beginning of shaders. Otherwise,
* reload them at each use. This must be true if the shader is using
- * derivatives, because all inputs should be loaded in the WQM mode.
+ * derivatives and KILL, because KILL can leave the WQM and then a lazy
+ * input load isn't in the WQM anymore.
*/
static bool si_preload_fs_inputs(struct si_shader_context *ctx)
{
- return ctx->shader->selector->info.uses_derivatives;
+ struct si_shader_selector *sel = ctx->shader->selector;
+
+ return sel->info.uses_derivatives &&
+ sel->info.uses_kill;
}
static LLVMValueRef