mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/dxil: Pass function emission state to sm6_parser_emit_alloca().
This commit is contained in:
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
@@ -4447,6 +4447,7 @@ static const struct sm6_value *sm6_parser_next_function_definition(struct sm6_pa
|
|||||||
struct function_emission_state
|
struct function_emission_state
|
||||||
{
|
{
|
||||||
struct sm6_function *function;
|
struct sm6_function *function;
|
||||||
|
const struct dxil_record *record;
|
||||||
struct vkd3d_shader_instruction *ins;
|
struct vkd3d_shader_instruction *ins;
|
||||||
unsigned int temp_idx;
|
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,
|
const struct vkd3d_shader_register *operand_regs, unsigned int component_count,
|
||||||
struct function_emission_state *state, struct vkd3d_shader_register *reg);
|
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,
|
static void sm6_parser_emit_alloca(struct sm6_parser *sm6, struct function_emission_state *state)
|
||||||
struct vkd3d_shader_instruction *ins, struct sm6_value *dst)
|
|
||||||
{
|
{
|
||||||
|
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_type *type[2], *elem_type;
|
||||||
const struct sm6_value *size;
|
const struct sm6_value *size;
|
||||||
unsigned int i, alignment;
|
unsigned int i, alignment;
|
||||||
@@ -8488,13 +8491,14 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6,
|
|||||||
is_terminator = false;
|
is_terminator = false;
|
||||||
|
|
||||||
state.function = function;
|
state.function = function;
|
||||||
|
state.record = block->records[i];
|
||||||
state.ins = ins;
|
state.ins = ins;
|
||||||
|
|
||||||
record = block->records[i];
|
record = block->records[i];
|
||||||
switch (record->code)
|
switch (record->code)
|
||||||
{
|
{
|
||||||
case FUNC_CODE_INST_ALLOCA:
|
case FUNC_CODE_INST_ALLOCA:
|
||||||
sm6_parser_emit_alloca(sm6, record, ins, dst);
|
sm6_parser_emit_alloca(sm6, &state);
|
||||||
break;
|
break;
|
||||||
case FUNC_CODE_INST_ATOMICRMW:
|
case FUNC_CODE_INST_ATOMICRMW:
|
||||||
sm6_parser_emit_atomicrmw(sm6, record, &state, dst);
|
sm6_parser_emit_atomicrmw(sm6, record, &state, dst);
|
||||||
|
|||||||
Reference in New Issue
Block a user