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_dx_domain_location().
This commit is contained in:
committed by
Henri Verbeet
parent
0f3e6afed3
commit
10449755a3
Notes:
Henri Verbeet
2025-12-10 16:12:08 +01:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1864
@@ -5710,31 +5710,40 @@ static void sm6_parser_emit_dx_discard(struct sm6_parser *dxil, enum dx_intrinsi
|
||||
src_param_init_from_value(src_param, operands[0], 0, dxil);
|
||||
}
|
||||
|
||||
static void sm6_parser_emit_dx_domain_location(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||
static void sm6_parser_emit_dx_domain_location(struct sm6_parser *dxil, enum dx_intrinsic_opcode op,
|
||||
const struct sm6_value **operands, struct function_emission_state *state)
|
||||
{
|
||||
struct vkd3d_shader_instruction *ins = state->ins;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
struct vsir_src_operand *src_param;
|
||||
unsigned int component_idx;
|
||||
|
||||
vsir_instruction_init(ins, &sm6->p.location, VSIR_OP_MOV);
|
||||
if (!(ins = sm6_parser_add_function_instruction(dxil, state)))
|
||||
return;
|
||||
|
||||
if ((component_idx = sm6_value_get_constant_uint(operands[0], sm6)) >= 3)
|
||||
state->pushed_instruction = true;
|
||||
|
||||
vsir_instruction_init(ins, &dxil->p.location, VSIR_OP_MOV);
|
||||
|
||||
if ((component_idx = sm6_value_get_constant_uint(operands[0], dxil)) >= 3)
|
||||
{
|
||||
WARN("Invalid component index %u.\n", component_idx);
|
||||
vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
|
||||
vkd3d_shader_parser_error(&dxil->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND,
|
||||
"Invalid domain location component index %u.", component_idx);
|
||||
component_idx = 0;
|
||||
}
|
||||
|
||||
if (!(src_param = instruction_src_params_alloc(ins, 1, sm6)))
|
||||
if (!(src_param = instruction_src_params_alloc(ins, 1, dxil)))
|
||||
{
|
||||
vkd3d_shader_instruction_make_nop(ins);
|
||||
return;
|
||||
sm6_parser_dcl_register_builtin(sm6, VSIR_OP_DCL_INPUT, VKD3DSPR_TESSCOORD, VSIR_DATA_F32, 3);
|
||||
}
|
||||
|
||||
sm6_parser_dcl_register_builtin(dxil, VSIR_OP_DCL_INPUT, VKD3DSPR_TESSCOORD, VSIR_DATA_F32, 3);
|
||||
vsir_register_init(&src_param->reg, VKD3DSPR_TESSCOORD, VSIR_DATA_F32, 0);
|
||||
src_param->reg.dimension = VSIR_DIMENSION_VEC4;
|
||||
src_param_init_scalar(src_param, component_idx);
|
||||
|
||||
instruction_dst_param_init_ssa_scalar(ins, 0, sm6);
|
||||
if (!instruction_dst_param_init_ssa_scalar(ins, 0, dxil))
|
||||
vkd3d_shader_instruction_make_nop(ins);
|
||||
}
|
||||
|
||||
static void sm6_parser_emit_dx_dot(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||
|
||||
Reference in New Issue
Block a user