mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/ir: Store a pointer to the instruction array in struct control_point_normaliser.
We stop storing a shallow copy of the vsir_program.instructions on control_point_normaliser.instructions since vkd3d_shader_instruction_array is not meant to be copied by value, which is evidenced by the fact that the struct has to always be copied back to program->instructions before returning.
This commit is contained in:
committed by
Henri Verbeet
parent
9323dc429c
commit
5278b8461f
Notes:
Henri Verbeet
2025-09-17 12:56:43 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1725
@@ -2769,7 +2769,7 @@ static enum vkd3d_result vsir_program_flatten_hull_shader_phases(struct vsir_pro
|
||||
|
||||
struct control_point_normaliser
|
||||
{
|
||||
struct vkd3d_shader_instruction_array instructions;
|
||||
struct vkd3d_shader_instruction_array *instructions;
|
||||
enum vkd3d_shader_opcode phase;
|
||||
struct vkd3d_shader_src_param *outpointid_param;
|
||||
};
|
||||
@@ -2835,9 +2835,9 @@ static enum vkd3d_result control_point_normaliser_emit_hs_input(struct control_p
|
||||
continue;
|
||||
|
||||
vsir_instruction_init(ins, location, VSIR_OP_MOV);
|
||||
ins->dst = shader_dst_param_allocator_get(&normaliser->instructions.dst_params, 1);
|
||||
ins->dst = shader_dst_param_allocator_get(&normaliser->instructions->dst_params, 1);
|
||||
ins->dst_count = 1;
|
||||
ins->src = shader_src_param_allocator_get(&normaliser->instructions.src_params, 1);
|
||||
ins->src = shader_src_param_allocator_get(&normaliser->instructions->src_params, 1);
|
||||
ins->src_count = 1;
|
||||
|
||||
if (!ins->dst || ! ins->src)
|
||||
@@ -2890,8 +2890,8 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
|
||||
ERR("Failed to allocate src param.\n");
|
||||
return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
normaliser.instructions = program->instructions;
|
||||
it = vsir_program_iterator(&normaliser.instructions);
|
||||
normaliser.instructions = &program->instructions;
|
||||
it = vsir_program_iterator(normaliser.instructions);
|
||||
normaliser.phase = VSIR_OP_INVALID;
|
||||
|
||||
for (ins = vsir_program_iterator_head(&it); ins; ins = vsir_program_iterator_next(&it))
|
||||
@@ -2923,7 +2923,6 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
|
||||
input_control_point_count = ins->declaration.count;
|
||||
break;
|
||||
case VSIR_OP_HS_CONTROL_POINT_PHASE:
|
||||
program->instructions = normaliser.instructions;
|
||||
program->normalisation_level = VSIR_NORMALISED_HULL_CONTROL_POINT_IO;
|
||||
return VKD3D_OK;
|
||||
case VSIR_OP_HS_FORK_PHASE:
|
||||
@@ -2932,7 +2931,6 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
|
||||
location = ins->location;
|
||||
ret = control_point_normaliser_emit_hs_input(&normaliser,
|
||||
&program->input_signature, input_control_point_count, &it, &location);
|
||||
program->instructions = normaliser.instructions;
|
||||
program->normalisation_level = VSIR_NORMALISED_HULL_CONTROL_POINT_IO;
|
||||
return ret;
|
||||
default:
|
||||
@@ -2940,7 +2938,6 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
|
||||
}
|
||||
}
|
||||
|
||||
program->instructions = normaliser.instructions;
|
||||
program->normalisation_level = VSIR_NORMALISED_HULL_CONTROL_POINT_IO;
|
||||
return VKD3D_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user