mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/dxil: Allocate instructions directly in sm6_parser_emit_br().
This commit is contained in:
committed by
Henri Verbeet
parent
2855f2d605
commit
c2ff59e80b
Notes:
Henri Verbeet
2025-12-03 15:30:32 +01:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1852
@@ -4943,10 +4943,10 @@ static bool sm6_function_validate_block_index(const struct sm6_function *functio
|
||||
|
||||
static void sm6_parser_emit_br(struct sm6_parser *dxil, struct function_emission_state *state)
|
||||
{
|
||||
struct vkd3d_shader_instruction *ins = state->ins;
|
||||
const struct dxil_record *record = state->record;
|
||||
struct sm6_function *function = state->function;
|
||||
struct vkd3d_shader_src_param *src_params;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
const struct sm6_value *value;
|
||||
unsigned int i = 2;
|
||||
|
||||
@@ -4962,6 +4962,11 @@ static void sm6_parser_emit_br(struct sm6_parser *dxil, struct function_emission
|
||||
if (!sm6_function_validate_block_index(function, record->operands[0], dxil))
|
||||
return;
|
||||
|
||||
if (!(ins = sm6_parser_add_function_instruction(dxil, state)))
|
||||
return;
|
||||
|
||||
state->pushed_instruction = true;
|
||||
|
||||
vsir_instruction_init(ins, &dxil->p.location, VSIR_OP_BRANCH);
|
||||
if (!(src_params = instruction_src_params_alloc(ins, 1, dxil)))
|
||||
{
|
||||
@@ -4988,6 +4993,11 @@ static void sm6_parser_emit_br(struct sm6_parser *dxil, struct function_emission
|
||||
|| !sm6_function_validate_block_index(function, record->operands[1], dxil))
|
||||
return;
|
||||
|
||||
if (!(ins = sm6_parser_add_function_instruction(dxil, state)))
|
||||
return;
|
||||
|
||||
state->pushed_instruction = true;
|
||||
|
||||
vsir_instruction_init(ins, &dxil->p.location, VSIR_OP_BRANCH);
|
||||
if (!(src_params = instruction_src_params_alloc(ins, 3, dxil)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user