mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/ir: Use iterators in instruction_array_normalise_hull_shader_control_point_io().
This commit is contained in:
committed by
Henri Verbeet
parent
97e3877aa4
commit
37ca1b55c9
Notes:
Henri Verbeet
2025-08-06 13:02:54 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1669
@@ -2434,11 +2434,11 @@ static enum vkd3d_result control_point_normaliser_emit_hs_input(struct control_p
|
|||||||
static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_io(
|
static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_io(
|
||||||
struct vsir_program *program, struct vsir_transformation_context *ctx)
|
struct vsir_program *program, struct vsir_transformation_context *ctx)
|
||||||
{
|
{
|
||||||
struct vkd3d_shader_instruction_array *instructions;
|
|
||||||
struct control_point_normaliser normaliser;
|
struct control_point_normaliser normaliser;
|
||||||
unsigned int input_control_point_count;
|
unsigned int input_control_point_count;
|
||||||
struct vkd3d_shader_location location;
|
struct vkd3d_shader_location location;
|
||||||
struct vkd3d_shader_instruction *ins;
|
struct vkd3d_shader_instruction *ins;
|
||||||
|
struct vsir_program_iterator it;
|
||||||
enum vkd3d_result ret;
|
enum vkd3d_result ret;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
@@ -2456,13 +2456,11 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
|
|||||||
return VKD3D_ERROR_OUT_OF_MEMORY;
|
return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
normaliser.instructions = program->instructions;
|
normaliser.instructions = program->instructions;
|
||||||
instructions = &normaliser.instructions;
|
it = vsir_program_iterator(&normaliser.instructions);
|
||||||
normaliser.phase = VSIR_OP_INVALID;
|
normaliser.phase = VSIR_OP_INVALID;
|
||||||
|
|
||||||
for (i = 0; i < normaliser.instructions.count; ++i)
|
for (ins = vsir_program_iterator_head(&it); ins; ins = vsir_program_iterator_next(&it))
|
||||||
{
|
{
|
||||||
ins = &instructions->elements[i];
|
|
||||||
|
|
||||||
switch (ins->opcode)
|
switch (ins->opcode)
|
||||||
{
|
{
|
||||||
case VSIR_OP_HS_CONTROL_POINT_PHASE:
|
case VSIR_OP_HS_CONTROL_POINT_PHASE:
|
||||||
@@ -2482,10 +2480,8 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
|
|||||||
normaliser.phase = VSIR_OP_INVALID;
|
normaliser.phase = VSIR_OP_INVALID;
|
||||||
input_control_point_count = 1;
|
input_control_point_count = 1;
|
||||||
|
|
||||||
for (i = 0; i < instructions->count; ++i)
|
for (ins = vsir_program_iterator_head(&it), i = 0; ins; ins = vsir_program_iterator_next(&it), ++i)
|
||||||
{
|
{
|
||||||
ins = &instructions->elements[i];
|
|
||||||
|
|
||||||
switch (ins->opcode)
|
switch (ins->opcode)
|
||||||
{
|
{
|
||||||
case VSIR_OP_DCL_INPUT_CONTROL_POINT_COUNT:
|
case VSIR_OP_DCL_INPUT_CONTROL_POINT_COUNT:
|
||||||
|
Reference in New Issue
Block a user