mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Drop the _ir_ infix from enum hlsl_loop_unroll_type.
This commit is contained in:
parent
a1d995e740
commit
ed6061dfae
Notes:
Henri Verbeet
2024-12-12 17:48:02 +01: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/1053
libs/vkd3d-shader
@ -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_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)
|
unsigned int unroll_limit, const struct vkd3d_shader_location *loc)
|
||||||
{
|
{
|
||||||
struct hlsl_ir_loop *loop;
|
struct hlsl_ir_loop *loop;
|
||||||
|
@ -659,11 +659,11 @@ struct hlsl_ir_if
|
|||||||
struct hlsl_block else_block;
|
struct hlsl_block else_block;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum hlsl_ir_loop_unroll_type
|
enum hlsl_loop_unroll_type
|
||||||
{
|
{
|
||||||
HLSL_IR_LOOP_UNROLL,
|
HLSL_LOOP_UNROLL,
|
||||||
HLSL_IR_LOOP_FORCE_UNROLL,
|
HLSL_LOOP_FORCE_UNROLL,
|
||||||
HLSL_IR_LOOP_FORCE_LOOP
|
HLSL_LOOP_FORCE_LOOP
|
||||||
};
|
};
|
||||||
|
|
||||||
enum hlsl_loop_type
|
enum hlsl_loop_type
|
||||||
@ -682,7 +682,7 @@ struct hlsl_ir_loop
|
|||||||
enum hlsl_loop_type type;
|
enum hlsl_loop_type type;
|
||||||
unsigned int next_index; /* liveness index of the end of the loop */
|
unsigned int next_index; /* liveness index of the end of the loop */
|
||||||
unsigned int unroll_limit;
|
unsigned int unroll_limit;
|
||||||
enum hlsl_ir_loop_unroll_type unroll_type;
|
enum hlsl_loop_unroll_type unroll_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hlsl_ir_switch_case
|
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 *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 *idx, const struct vkd3d_shader_location *loc);
|
||||||
struct hlsl_ir_node *hlsl_new_loop(struct hlsl_ctx *ctx, struct hlsl_block *iter,
|
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);
|
unsigned int unroll_limit, const struct vkd3d_shader_location *loc);
|
||||||
struct hlsl_ir_node *hlsl_new_resource_load(struct hlsl_ctx *ctx,
|
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);
|
const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc);
|
||||||
|
@ -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,
|
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)
|
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;
|
unsigned int i, unroll_limit = 0;
|
||||||
struct hlsl_ir_node *loop;
|
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);
|
hlsl_block_cleanup(&expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
unroll_type = HLSL_IR_LOOP_FORCE_UNROLL;
|
unroll_type = HLSL_LOOP_FORCE_UNROLL;
|
||||||
}
|
}
|
||||||
else if (!strcmp(attr->name, "loop"))
|
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")
|
else if (!strcmp(attr->name, "fastopt")
|
||||||
|| !strcmp(attr->name, "allow_uav_condition"))
|
|| !strcmp(attr->name, "allow_uav_condition"))
|
||||||
|
@ -10123,7 +10123,7 @@ static unsigned int loop_unrolling_get_max_iterations(struct hlsl_ctx *ctx, stru
|
|||||||
return loop->unroll_limit;
|
return loop->unroll_limit;
|
||||||
|
|
||||||
/* All SMs will default to 1024 if [unroll] has been specified without an explicit 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;
|
return 1024;
|
||||||
|
|
||||||
/* SM4 limits implicit unrolling to 254 iterations. */
|
/* 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)) */
|
* i.e [unroll(4)] for (i = 0; i < 8; ++i)) */
|
||||||
if (!loop->unroll_limit && i == max_iterations)
|
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,
|
hlsl_error(ctx, &loop->node.loc, VKD3D_SHADER_ERROR_HLSL_FAILED_FORCED_UNROLL,
|
||||||
"Unable to unroll loop, maximum iterations reached (%u).", max_iterations);
|
"Unable to unroll loop, maximum iterations reached (%u).", max_iterations);
|
||||||
goto fail;
|
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);
|
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;
|
return true;
|
||||||
|
|
||||||
if (!loop_unrolling_unroll_loop(ctx, program, loop))
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user