From ed6061dfaee14c5b6950feaa23edef80aec4bbbf Mon Sep 17 00:00:00 2001 From: Victor Chiletto Date: Tue, 10 Dec 2024 14:12:09 -0300 Subject: [PATCH] vkd3d-shader/hlsl: Drop the _ir_ infix from enum hlsl_loop_unroll_type. --- libs/vkd3d-shader/hlsl.c | 2 +- libs/vkd3d-shader/hlsl.h | 12 ++++++------ libs/vkd3d-shader/hlsl.y | 6 +++--- libs/vkd3d-shader/hlsl_codegen.c | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 3a84afed..b324e196 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -2065,7 +2065,7 @@ struct hlsl_ir_node *hlsl_new_jump(struct hlsl_ctx *ctx, enum hlsl_ir_jump_type } struct hlsl_ir_node *hlsl_new_loop(struct hlsl_ctx *ctx, struct hlsl_block *iter, - struct hlsl_block *block, enum hlsl_ir_loop_unroll_type unroll_type, + struct hlsl_block *block, enum hlsl_loop_unroll_type unroll_type, unsigned int unroll_limit, const struct vkd3d_shader_location *loc) { struct hlsl_ir_loop *loop; diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index d226273e..05bef663 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -659,11 +659,11 @@ struct hlsl_ir_if struct hlsl_block else_block; }; -enum hlsl_ir_loop_unroll_type +enum hlsl_loop_unroll_type { - HLSL_IR_LOOP_UNROLL, - HLSL_IR_LOOP_FORCE_UNROLL, - HLSL_IR_LOOP_FORCE_LOOP + HLSL_LOOP_UNROLL, + HLSL_LOOP_FORCE_UNROLL, + HLSL_LOOP_FORCE_LOOP }; enum hlsl_loop_type @@ -682,7 +682,7 @@ struct hlsl_ir_loop enum hlsl_loop_type type; unsigned int next_index; /* liveness index of the end of the loop */ unsigned int unroll_limit; - enum hlsl_ir_loop_unroll_type unroll_type; + enum hlsl_loop_unroll_type unroll_type; }; struct hlsl_ir_switch_case @@ -1560,7 +1560,7 @@ struct hlsl_ir_node *hlsl_new_compile(struct hlsl_ctx *ctx, enum hlsl_compile_ty struct hlsl_ir_node *hlsl_new_index(struct hlsl_ctx *ctx, struct hlsl_ir_node *val, struct hlsl_ir_node *idx, const struct vkd3d_shader_location *loc); struct hlsl_ir_node *hlsl_new_loop(struct hlsl_ctx *ctx, struct hlsl_block *iter, - struct hlsl_block *block, enum hlsl_ir_loop_unroll_type unroll_type, + struct hlsl_block *block, enum hlsl_loop_unroll_type unroll_type, unsigned int unroll_limit, const struct vkd3d_shader_location *loc); struct hlsl_ir_node *hlsl_new_resource_load(struct hlsl_ctx *ctx, const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc); diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 925f01ef..f59fdc56 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -730,7 +730,7 @@ static struct hlsl_block *create_loop(struct hlsl_ctx *ctx, enum hlsl_loop_type const struct parse_attribute_list *attributes, struct hlsl_block *init, struct hlsl_block *cond, struct hlsl_block *iter, struct hlsl_block *body, const struct vkd3d_shader_location *loc) { - enum hlsl_ir_loop_unroll_type unroll_type = HLSL_IR_LOOP_UNROLL; + enum hlsl_loop_unroll_type unroll_type = HLSL_LOOP_UNROLL; unsigned int i, unroll_limit = 0; struct hlsl_ir_node *loop; @@ -761,11 +761,11 @@ static struct hlsl_block *create_loop(struct hlsl_ctx *ctx, enum hlsl_loop_type hlsl_block_cleanup(&expr); } - unroll_type = HLSL_IR_LOOP_FORCE_UNROLL; + unroll_type = HLSL_LOOP_FORCE_UNROLL; } else if (!strcmp(attr->name, "loop")) { - unroll_type = HLSL_IR_LOOP_FORCE_LOOP; + unroll_type = HLSL_LOOP_FORCE_LOOP; } else if (!strcmp(attr->name, "fastopt") || !strcmp(attr->name, "allow_uav_condition")) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index b8bf6aa1..7a19dafb 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -10123,7 +10123,7 @@ static unsigned int loop_unrolling_get_max_iterations(struct hlsl_ctx *ctx, stru return loop->unroll_limit; /* All SMs will default to 1024 if [unroll] has been specified without an explicit limit. */ - if (loop->unroll_type == HLSL_IR_LOOP_FORCE_UNROLL) + if (loop->unroll_type == HLSL_LOOP_FORCE_UNROLL) return 1024; /* SM4 limits implicit unrolling to 254 iterations. */ @@ -10253,7 +10253,7 @@ static bool loop_unrolling_unroll_loop(struct hlsl_ctx *ctx, struct hlsl_block * * i.e [unroll(4)] for (i = 0; i < 8; ++i)) */ if (!loop->unroll_limit && i == max_iterations) { - if (loop->unroll_type == HLSL_IR_LOOP_FORCE_UNROLL) + if (loop->unroll_type == HLSL_LOOP_FORCE_UNROLL) hlsl_error(ctx, &loop->node.loc, VKD3D_SHADER_ERROR_HLSL_FAILED_FORCED_UNROLL, "Unable to unroll loop, maximum iterations reached (%u).", max_iterations); goto fail; @@ -10287,11 +10287,11 @@ static bool unroll_loops(struct hlsl_ctx *ctx, struct hlsl_ir_node *node, void * loop = hlsl_ir_loop(node); - if (loop->unroll_type != HLSL_IR_LOOP_UNROLL && loop->unroll_type != HLSL_IR_LOOP_FORCE_UNROLL) + if (loop->unroll_type != HLSL_LOOP_UNROLL && loop->unroll_type != HLSL_LOOP_FORCE_UNROLL) return true; if (!loop_unrolling_unroll_loop(ctx, program, loop)) - loop->unroll_type = HLSL_IR_LOOP_FORCE_LOOP; + loop->unroll_type = HLSL_LOOP_FORCE_LOOP; return true; }