mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/dxil: Move the function emission state outside the opcode switch.
This commit is contained in:
committed by
Henri Verbeet
parent
fdfb74b20b
commit
6a3f360a2b
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
@@ -8450,6 +8450,8 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6,
|
|||||||
|
|
||||||
for (i = 1, block_idx = 0, ret_found = false; i < block->record_count; ++i)
|
for (i = 1, block_idx = 0, ret_found = false; i < block->record_count; ++i)
|
||||||
{
|
{
|
||||||
|
struct function_emission_state state = {0};
|
||||||
|
|
||||||
sm6->p.location.column = i;
|
sm6->p.location.column = i;
|
||||||
|
|
||||||
if (block_idx >= function->block_count)
|
if (block_idx >= function->block_count)
|
||||||
@@ -8485,6 +8487,9 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6,
|
|||||||
dst->is_back_ref = true;
|
dst->is_back_ref = true;
|
||||||
is_terminator = false;
|
is_terminator = false;
|
||||||
|
|
||||||
|
state.function = function;
|
||||||
|
state.ins = ins;
|
||||||
|
|
||||||
record = block->records[i];
|
record = block->records[i];
|
||||||
switch (record->code)
|
switch (record->code)
|
||||||
{
|
{
|
||||||
@@ -8492,12 +8497,8 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6,
|
|||||||
sm6_parser_emit_alloca(sm6, record, ins, dst);
|
sm6_parser_emit_alloca(sm6, record, ins, dst);
|
||||||
break;
|
break;
|
||||||
case FUNC_CODE_INST_ATOMICRMW:
|
case FUNC_CODE_INST_ATOMICRMW:
|
||||||
{
|
|
||||||
struct function_emission_state state = {function, ins};
|
|
||||||
sm6_parser_emit_atomicrmw(sm6, record, &state, dst);
|
sm6_parser_emit_atomicrmw(sm6, record, &state, dst);
|
||||||
program->temp_count = max(program->temp_count, state.temp_idx);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case FUNC_CODE_INST_BINOP:
|
case FUNC_CODE_INST_BINOP:
|
||||||
sm6_parser_emit_binop(sm6, record, function, ins, dst);
|
sm6_parser_emit_binop(sm6, record, function, ins, dst);
|
||||||
break;
|
break;
|
||||||
@@ -8506,12 +8507,8 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6,
|
|||||||
is_terminator = true;
|
is_terminator = true;
|
||||||
break;
|
break;
|
||||||
case FUNC_CODE_INST_CALL:
|
case FUNC_CODE_INST_CALL:
|
||||||
{
|
|
||||||
struct function_emission_state state = {function, ins};
|
|
||||||
sm6_parser_emit_call(sm6, record, &state, dst);
|
sm6_parser_emit_call(sm6, record, &state, dst);
|
||||||
program->temp_count = max(program->temp_count, state.temp_idx);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case FUNC_CODE_INST_CAST:
|
case FUNC_CODE_INST_CAST:
|
||||||
sm6_parser_emit_cast(sm6, record, ins, dst);
|
sm6_parser_emit_cast(sm6, record, ins, dst);
|
||||||
break;
|
break;
|
||||||
@@ -8553,6 +8550,8 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6,
|
|||||||
return VKD3D_ERROR_INVALID_SHADER;
|
return VKD3D_ERROR_INVALID_SHADER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
program->temp_count = max(program->temp_count, state.temp_idx);
|
||||||
|
|
||||||
if (sm6->p.status < 0)
|
if (sm6->p.status < 0)
|
||||||
return sm6->p.status;
|
return sm6->p.status;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user