vkd3d-shader/dxil: Pass function emission state to sm6_parser_emit_alloca().

This commit is contained in:
Giovanni Mascellani
2025-11-25 23:00:24 +01:00
committed by Henri Verbeet
parent 6a3f360a2b
commit 3b9fbe3e4a
Notes: Henri Verbeet 2025-12-02 14:37:33 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1839

View File

@@ -4447,6 +4447,7 @@ static const struct sm6_value *sm6_parser_next_function_definition(struct sm6_pa
struct function_emission_state
{
struct sm6_function *function;
const struct dxil_record *record;
struct vkd3d_shader_instruction *ins;
unsigned int temp_idx;
};
@@ -4455,9 +4456,11 @@ static bool sm6_parser_emit_reg_composite_construct(struct sm6_parser *sm6,
const struct vkd3d_shader_register *operand_regs, unsigned int component_count,
struct function_emission_state *state, struct vkd3d_shader_register *reg);
static void sm6_parser_emit_alloca(struct sm6_parser *sm6, const struct dxil_record *record,
struct vkd3d_shader_instruction *ins, struct sm6_value *dst)
static void sm6_parser_emit_alloca(struct sm6_parser *sm6, struct function_emission_state *state)
{
struct sm6_value *dst = sm6_parser_get_current_value(sm6);
struct vkd3d_shader_instruction *ins = state->ins;
const struct dxil_record *record = state->record;
const struct sm6_type *type[2], *elem_type;
const struct sm6_value *size;
unsigned int i, alignment;
@@ -8488,13 +8491,14 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6,
is_terminator = false;
state.function = function;
state.record = block->records[i];
state.ins = ins;
record = block->records[i];
switch (record->code)
{
case FUNC_CODE_INST_ALLOCA:
sm6_parser_emit_alloca(sm6, record, ins, dst);
sm6_parser_emit_alloca(sm6, &state);
break;
case FUNC_CODE_INST_ATOMICRMW:
sm6_parser_emit_atomicrmw(sm6, record, &state, dst);