mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/ir: Avoid memset() in vsir_instruction_init().
Primarily to avoid -Warray-bounds warnings from newer gcc, specifically for the first vsir_instruction_init() call in vsir_update_dcl_temps(). This seems to be a false positive created by the interaction between vsir_program_iterator_insert_after() and vsir_program_iterator_next() error handling; it may be possible to avoid that by rearranging things, but it doesn't seem worth it.
This commit is contained in:
Notes:
Henri Verbeet
2025-09-19 12:54:08 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1738
@@ -1017,16 +1017,15 @@ static void dst_param_init_output(struct vkd3d_shader_dst_param *dst,
|
|||||||
dst->write_mask = write_mask;
|
dst->write_mask = write_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vsir_instruction_init(struct vkd3d_shader_instruction *ins, const struct vkd3d_shader_location *location,
|
void vsir_instruction_init(struct vkd3d_shader_instruction *ins,
|
||||||
enum vkd3d_shader_opcode opcode)
|
const struct vkd3d_shader_location *location, enum vkd3d_shader_opcode opcode)
|
||||||
{
|
{
|
||||||
memset(ins, 0, sizeof(*ins));
|
*ins = (struct vkd3d_shader_instruction)
|
||||||
ins->location = *location;
|
{
|
||||||
ins->opcode = opcode;
|
.location = *location,
|
||||||
ins->resource_data_type[0] = VSIR_DATA_F32;
|
.opcode = opcode,
|
||||||
ins->resource_data_type[1] = VSIR_DATA_F32;
|
.resource_data_type = {VSIR_DATA_F32, VSIR_DATA_F32, VSIR_DATA_F32, VSIR_DATA_F32},
|
||||||
ins->resource_data_type[2] = VSIR_DATA_F32;
|
};
|
||||||
ins->resource_data_type[3] = VSIR_DATA_F32;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool vsir_instruction_init_with_params(struct vsir_program *program,
|
bool vsir_instruction_init_with_params(struct vsir_program *program,
|
||||||
|
|||||||
Reference in New Issue
Block a user