vkd3d-shader/hlsl: Always load from a synthetic copy in add_load_component().

This commit is contained in:
Francisco Casas 2023-03-09 20:29:03 -03:00 committed by Alexandre Julliard
parent 82ff408451
commit dc2a34824d
Notes: Alexandre Julliard 2023-04-13 23:20:40 +02:00
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Francisco Casas (@fcasas)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/124
3 changed files with 11 additions and 19 deletions

View File

@ -624,27 +624,19 @@ static struct hlsl_ir_load *add_load_component(struct hlsl_ctx *ctx, struct list
unsigned int comp, const struct vkd3d_shader_location *loc) unsigned int comp, const struct vkd3d_shader_location *loc)
{ {
const struct hlsl_deref *src; const struct hlsl_deref *src;
struct hlsl_ir_store *store;
struct hlsl_ir_load *load; struct hlsl_ir_load *load;
struct hlsl_block block; struct hlsl_block block;
struct hlsl_ir_var *var;
if (var_instr->type == HLSL_IR_LOAD) if (!(var = hlsl_new_synthetic_var(ctx, "deref", var_instr->data_type, &var_instr->loc)))
{ return NULL;
src = &hlsl_ir_load(var_instr)->src;
}
else
{
struct hlsl_ir_store *store;
struct hlsl_ir_var *var;
if (!(var = hlsl_new_synthetic_var(ctx, "deref", var_instr->data_type, &var_instr->loc))) if (!(store = hlsl_new_simple_store(ctx, var, var_instr)))
return NULL; return NULL;
list_add_tail(instrs, &store->node.entry);
if (!(store = hlsl_new_simple_store(ctx, var, var_instr))) src = &store->lhs;
return NULL;
list_add_tail(instrs, &store->node.entry);
src = &store->lhs;
}
if (!(load = hlsl_new_load_component(ctx, &block, src, comp, loc))) if (!(load = hlsl_new_load_component(ctx, &block, src, comp, loc)))
return NULL; return NULL;

View File

@ -276,7 +276,7 @@ float4 main() : sv_target
[test] [test]
draw quad draw quad
todo probe all rgba (2.0, 3.0, 6.0, 7.0) probe all rgba (2.0, 3.0, 6.0, 7.0)
[pixel shader] [pixel shader]
@ -294,4 +294,4 @@ float4 main() : sv_target
[test] [test]
draw quad draw quad
todo probe all rgba (2.0, 3.0, 6.0, 7.0) probe all rgba (2.0, 3.0, 6.0, 7.0)

View File

@ -12,7 +12,7 @@ float4 main() : sv_target
[test] [test]
draw quad draw quad
todo probe all rgba (0.3, 0.3, 0.4, 0.6) probe all rgba (0.3, 0.3, 0.4, 0.6)
[pixel shader] [pixel shader]