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 vsir program in struct control_point_normaliser.
We will move the dst_params and src_params fields from struct vkd3d_shader_instruction_array to the vsir program next, so we need to widen the scope of this pointer to the whole vsir program.
This commit is contained in:
committed by
Henri Verbeet
parent
5278b8461f
commit
6ed78a0211
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 control_point_normaliser
|
||||||
{
|
{
|
||||||
struct vkd3d_shader_instruction_array *instructions;
|
struct vsir_program *program;
|
||||||
enum vkd3d_shader_opcode phase;
|
enum vkd3d_shader_opcode phase;
|
||||||
struct vkd3d_shader_src_param *outpointid_param;
|
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;
|
continue;
|
||||||
|
|
||||||
vsir_instruction_init(ins, location, VSIR_OP_MOV);
|
vsir_instruction_init(ins, location, VSIR_OP_MOV);
|
||||||
ins->dst = shader_dst_param_allocator_get(&normaliser->instructions->dst_params, 1);
|
ins->dst = vsir_program_get_dst_params(normaliser->program, 1);
|
||||||
ins->dst_count = 1;
|
ins->dst_count = 1;
|
||||||
ins->src = shader_src_param_allocator_get(&normaliser->instructions->src_params, 1);
|
ins->src = vsir_program_get_src_params(normaliser->program, 1);
|
||||||
ins->src_count = 1;
|
ins->src_count = 1;
|
||||||
|
|
||||||
if (!ins->dst || ! ins->src)
|
if (!ins->dst || ! ins->src)
|
||||||
@@ -2846,6 +2846,8 @@ static enum vkd3d_result control_point_normaliser_emit_hs_input(struct control_p
|
|||||||
return VKD3D_ERROR_OUT_OF_MEMORY;
|
return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VKD3D_ASSERT(normaliser->outpointid_param);
|
||||||
|
|
||||||
vsir_dst_param_init_io(&ins->dst[0], VKD3DSPR_OUTPUT, e, 2);
|
vsir_dst_param_init_io(&ins->dst[0], VKD3DSPR_OUTPUT, e, 2);
|
||||||
ins->dst[0].reg.dimension = VSIR_DIMENSION_VEC4;
|
ins->dst[0].reg.dimension = VSIR_DIMENSION_VEC4;
|
||||||
ins->dst[0].reg.idx[0].offset = 0;
|
ins->dst[0].reg.idx[0].offset = 0;
|
||||||
@@ -2890,8 +2892,8 @@ static enum vkd3d_result instruction_array_normalise_hull_shader_control_point_i
|
|||||||
ERR("Failed to allocate src param.\n");
|
ERR("Failed to allocate src param.\n");
|
||||||
return VKD3D_ERROR_OUT_OF_MEMORY;
|
return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
normaliser.instructions = &program->instructions;
|
normaliser.program = program;
|
||||||
it = vsir_program_iterator(normaliser.instructions);
|
it = vsir_program_iterator(&normaliser.program->instructions);
|
||||||
normaliser.phase = VSIR_OP_INVALID;
|
normaliser.phase = VSIR_OP_INVALID;
|
||||||
|
|
||||||
for (ins = vsir_program_iterator_head(&it); ins; ins = vsir_program_iterator_next(&it))
|
for (ins = vsir_program_iterator_head(&it); ins; ins = vsir_program_iterator_next(&it))
|
||||||
|
|||||||
Reference in New Issue
Block a user