mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/hlsl: Divert written uniform derefs to temps before copy-propagation passes.
The following pixel shader currently triggers an infinite loop during copy propagation, which is fixed by this commit: sampler s; Texture2D t1, t2; float4 main() : sv_target { Texture2D t = t1; t1 = t2; t2 = t; return t1.Sample(s, float2(0, 0)) + t2.Sample(s, float2(0, 0)); } The infinite loop occurs because copy_propagation_transform_object_load() replaces t1 in the resource_load(t1, ...) instruction with t2, t1, t2, ... repeatedly.
This commit is contained in:
Notes:
Henri Verbeet
2025-04-02 19:43:31 +02:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1436
@@ -12763,6 +12763,9 @@ static void process_entry_function(struct hlsl_ctx *ctx,
|
|||||||
hlsl_transform_ir(ctx, lower_resource_load_bias, body, NULL);
|
hlsl_transform_ir(ctx, lower_resource_load_bias, body, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compute_liveness(ctx, entry_func);
|
||||||
|
transform_derefs(ctx, divert_written_uniform_derefs_to_temp, &entry_func->body);
|
||||||
|
|
||||||
loop_unrolling_execute(ctx, body);
|
loop_unrolling_execute(ctx, body);
|
||||||
hlsl_run_const_passes(ctx, body);
|
hlsl_run_const_passes(ctx, body);
|
||||||
|
|
||||||
@@ -12773,9 +12776,6 @@ static void process_entry_function(struct hlsl_ctx *ctx,
|
|||||||
lower_ir(ctx, lower_casts_to_bool, body);
|
lower_ir(ctx, lower_casts_to_bool, body);
|
||||||
lower_ir(ctx, lower_int_dot, body);
|
lower_ir(ctx, lower_int_dot, body);
|
||||||
|
|
||||||
compute_liveness(ctx, entry_func);
|
|
||||||
transform_derefs(ctx, divert_written_uniform_derefs_to_temp, &entry_func->body);
|
|
||||||
|
|
||||||
if (hlsl_version_lt(ctx, 4, 0))
|
if (hlsl_version_lt(ctx, 4, 0))
|
||||||
hlsl_transform_ir(ctx, lower_separate_samples, body, NULL);
|
hlsl_transform_ir(ctx, lower_separate_samples, body, NULL);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user