vkd3d-shader/hlsl: Use a switch in validate_static_object_references().

This commit is contained in:
Victor Chiletto 2024-05-17 19:03:34 -03:00 committed by Henri Verbeet
parent 900433e371
commit 317bd46efd
Notes: Henri Verbeet 2024-07-11 00:40:50 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/786

View File

@ -2003,7 +2003,9 @@ static bool validate_static_object_references(struct hlsl_ctx *ctx, struct hlsl_
{ {
unsigned int start, count; unsigned int start, count;
if (instr->type == HLSL_IR_RESOURCE_LOAD) switch (instr->type)
{
case HLSL_IR_RESOURCE_LOAD:
{ {
struct hlsl_ir_resource_load *load = hlsl_ir_resource_load(instr); struct hlsl_ir_resource_load *load = hlsl_ir_resource_load(instr);
@ -2035,8 +2037,9 @@ static bool validate_static_object_references(struct hlsl_ctx *ctx, struct hlsl_
note_non_static_deref_expressions(ctx, &load->sampler, "resource load sampler"); note_non_static_deref_expressions(ctx, &load->sampler, "resource load sampler");
} }
} }
break;
} }
else if (instr->type == HLSL_IR_RESOURCE_STORE) case HLSL_IR_RESOURCE_STORE:
{ {
struct hlsl_ir_resource_store *store = hlsl_ir_resource_store(instr); struct hlsl_ir_resource_store *store = hlsl_ir_resource_store(instr);
@ -2052,6 +2055,10 @@ static bool validate_static_object_references(struct hlsl_ctx *ctx, struct hlsl_
store->resource.var->name); store->resource.var->name);
note_non_static_deref_expressions(ctx, &store->resource, "accessed resource"); note_non_static_deref_expressions(ctx, &store->resource, "accessed resource");
} }
break;
}
default:
break;
} }
return false; return false;