mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/ir: Introduce shader_instruction_array_append().
This commit is contained in:
committed by
Henri Verbeet
parent
b7a36fef6a
commit
e935e06e23
Notes:
Henri Verbeet
2025-09-29 13:04:35 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1739
@@ -502,6 +502,14 @@ bool shader_instruction_array_insert_at(struct vkd3d_shader_instruction_array *a
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct vkd3d_shader_instruction *shader_instruction_array_append(struct vkd3d_shader_instruction_array *array)
|
||||||
|
{
|
||||||
|
if (!shader_instruction_array_insert_at(array, array->count, 1))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return &array->elements[array->count - 1];
|
||||||
|
}
|
||||||
|
|
||||||
bool vsir_program_add_icb(struct vsir_program *program, struct vkd3d_shader_immediate_constant_buffer *icb)
|
bool vsir_program_add_icb(struct vsir_program *program, struct vkd3d_shader_immediate_constant_buffer *icb)
|
||||||
{
|
{
|
||||||
if (!vkd3d_array_reserve((void **)&program->icbs, &program->icb_capacity,
|
if (!vkd3d_array_reserve((void **)&program->icbs, &program->icb_capacity,
|
||||||
|
|||||||
@@ -1428,9 +1428,9 @@ struct vkd3d_shader_instruction_array
|
|||||||
size_t count;
|
size_t count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct vkd3d_shader_instruction *shader_instruction_array_append(struct vkd3d_shader_instruction_array *array);
|
||||||
|
bool shader_instruction_array_insert_at(struct vkd3d_shader_instruction_array *instructions, size_t idx, size_t count);
|
||||||
bool shader_instruction_array_reserve(struct vkd3d_shader_instruction_array *instructions, size_t reserve);
|
bool shader_instruction_array_reserve(struct vkd3d_shader_instruction_array *instructions, size_t reserve);
|
||||||
bool shader_instruction_array_insert_at(struct vkd3d_shader_instruction_array *instructions,
|
|
||||||
size_t idx, size_t count);
|
|
||||||
|
|
||||||
struct vsir_program_iterator
|
struct vsir_program_iterator
|
||||||
{
|
{
|
||||||
@@ -1651,12 +1651,7 @@ bool vsir_instruction_init_with_params(struct vsir_program *program,
|
|||||||
|
|
||||||
static inline struct vkd3d_shader_instruction *vsir_program_append(struct vsir_program *program)
|
static inline struct vkd3d_shader_instruction *vsir_program_append(struct vsir_program *program)
|
||||||
{
|
{
|
||||||
struct vkd3d_shader_instruction_array *array = &program->instructions;
|
return shader_instruction_array_append(&program->instructions);
|
||||||
|
|
||||||
if (!shader_instruction_array_insert_at(array, array->count, 1))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return &array->elements[array->count - 1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct vkd3d_shader_dst_param *vsir_program_get_dst_params(
|
static inline struct vkd3d_shader_dst_param *vsir_program_get_dst_params(
|
||||||
|
|||||||
Reference in New Issue
Block a user