vkd3d-shader/hlsl: Parse UAV stores.

This commit is contained in:
Zebediah Figura
2021-08-15 12:08:32 -05:00
committed by Alexandre Julliard
parent 0a2aaa690e
commit 03f9d16047
Notes: Alexandre Julliard 2022-10-31 22:39:35 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/36
4 changed files with 127 additions and 10 deletions

View File

@@ -160,6 +160,10 @@ static bool transform_deref_paths_into_offsets(struct hlsl_ctx *ctx, struct hlsl
replace_deref_path_with_offset(ctx, &hlsl_ir_resource_load(instr)->sampler, instr);
return true;
case HLSL_IR_RESOURCE_STORE:
replace_deref_path_with_offset(ctx, &hlsl_ir_resource_store(instr)->resource, instr);
return true;
default:
return false;
}
@@ -1588,6 +1592,7 @@ static bool dce(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context)
case HLSL_IR_IF:
case HLSL_IR_JUMP:
case HLSL_IR_LOOP:
case HLSL_IR_RESOURCE_STORE:
break;
}
@@ -1724,6 +1729,18 @@ static void compute_liveness_recurse(struct hlsl_block *block, unsigned int loop
load->lod.node->last_read = instr->index;
break;
}
case HLSL_IR_RESOURCE_STORE:
{
struct hlsl_ir_resource_store *store = hlsl_ir_resource_store(instr);
var = store->resource.var;
var->last_read = max(var->last_read, var_last_read);
if (store->resource.offset.node)
store->resource.offset.node->last_read = instr->index;
store->coords.node->last_read = instr->index;
store->value.node->last_read = instr->index;
break;
}
case HLSL_IR_SWIZZLE:
{
struct hlsl_ir_swizzle *swizzle = hlsl_ir_swizzle(instr);