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_buffer_update_counter().
This commit is contained in:
committed by
Henri Verbeet
parent
7d481b6c2d
commit
6b042b3ce3
Notes:
Henri Verbeet
2025-12-08 17:49:13 +01:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1858
@@ -5423,7 +5423,7 @@ static void sm6_parser_emit_dx_barrier(struct sm6_parser *dxil, enum dx_intrinsi
|
|||||||
static void sm6_parser_emit_dx_buffer_update_counter(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
static void sm6_parser_emit_dx_buffer_update_counter(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||||
const struct sm6_value **operands, struct function_emission_state *state)
|
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_params;
|
struct vsir_src_operand *src_params;
|
||||||
const struct sm6_value *resource;
|
const struct sm6_value *resource;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@@ -5441,19 +5441,27 @@ static void sm6_parser_emit_dx_buffer_update_counter(struct sm6_parser *sm6, enu
|
|||||||
}
|
}
|
||||||
i = sm6_value_get_constant_uint(operands[1], sm6);
|
i = sm6_value_get_constant_uint(operands[1], sm6);
|
||||||
if (i != 1 && i != 255)
|
if (i != 1 && i != 255)
|
||||||
{
|
|
||||||
WARN("Unexpected update value %#x.\n", i);
|
|
||||||
vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_IGNORING_OPERANDS,
|
vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_IGNORING_OPERANDS,
|
||||||
"Update value %#x for a UAV counter operation is not supported.", i);
|
"Update value %#x for a UAV counter operation is not supported.", i);
|
||||||
}
|
|
||||||
inc = i;
|
inc = i;
|
||||||
|
|
||||||
vsir_instruction_init(ins, &sm6->p.location, (inc < 0) ? VSIR_OP_IMM_ATOMIC_CONSUME : VSIR_OP_IMM_ATOMIC_ALLOC);
|
if (!(ins = sm6_parser_add_function_instruction(sm6, state)))
|
||||||
if (!(src_params = instruction_src_params_alloc(ins, 1, sm6)))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
state->pushed_instruction = true;
|
||||||
|
|
||||||
|
vsir_instruction_init(ins, &sm6->p.location, (inc < 0) ? VSIR_OP_IMM_ATOMIC_CONSUME : VSIR_OP_IMM_ATOMIC_ALLOC);
|
||||||
|
|
||||||
|
if (!(src_params = instruction_src_params_alloc(ins, 1, sm6)))
|
||||||
|
{
|
||||||
|
vkd3d_shader_instruction_make_nop(ins);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
src_param_init_vector_from_handle(sm6, &src_params[0], &resource->u.handle);
|
src_param_init_vector_from_handle(sm6, &src_params[0], &resource->u.handle);
|
||||||
|
|
||||||
instruction_dst_param_init_ssa_scalar(ins, 0, sm6);
|
if (!instruction_dst_param_init_ssa_scalar(ins, 0, sm6))
|
||||||
|
vkd3d_shader_instruction_make_nop(ins);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sm6_parser_emit_dx_calculate_lod(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
static void sm6_parser_emit_dx_calculate_lod(struct sm6_parser *sm6, enum dx_intrinsic_opcode op,
|
||||||
|
|||||||
Reference in New Issue
Block a user