From e41643ab8fa8e6060c800688a58ed43b85e58b18 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Thu, 9 May 2024 12:24:02 +1000 Subject: [PATCH] vkd3d-shader/dxil: Implement DX intrinsic WaveReadLaneAt. --- libs/vkd3d-shader/d3d_asm.c | 1 + libs/vkd3d-shader/dxil.c | 4 ++++ libs/vkd3d-shader/vkd3d_shader_private.h | 1 + 3 files changed, 6 insertions(+) diff --git a/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d-shader/d3d_asm.c index 996ad845..a7609578 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -345,6 +345,7 @@ static const char * const shader_opcode_names[] = [VKD3DSIH_WAVE_OP_UMAX ] = "wave_op_umax", [VKD3DSIH_WAVE_OP_UMIN ] = "wave_op_umin", [VKD3DSIH_WAVE_PREFIX_BIT_COUNT ] = "wave_prefix_bit_count", + [VKD3DSIH_WAVE_READ_LANE_AT ] = "wave_read_lane_at", [VKD3DSIH_XOR ] = "xor", }; diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 22fdcf9f..e6f24b4e 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -453,6 +453,7 @@ enum dx_intrinsic_opcode DX_WAVE_ALL_TRUE = 114, DX_WAVE_ACTIVE_ALL_EQUAL = 115, DX_WAVE_ACTIVE_BALLOT = 116, + DX_WAVE_READ_LANE_AT = 117, DX_WAVE_ACTIVE_OP = 119, DX_WAVE_ACTIVE_BIT = 120, DX_WAVE_PREFIX_OP = 121, @@ -4620,6 +4621,8 @@ static enum vkd3d_shader_opcode map_dx_binary_op(enum dx_intrinsic_opcode op, co return VKD3DSIH_UMAX; case DX_UMIN: return VKD3DSIH_UMIN; + case DX_WAVE_READ_LANE_AT: + return VKD3DSIH_WAVE_READ_LANE_AT; default: vkd3d_unreachable(); } @@ -6267,6 +6270,7 @@ static const struct sm6_dx_opcode_info sm6_dx_op_table[] = [DX_WAVE_IS_FIRST_LANE ] = {"1", "", sm6_parser_emit_dx_void}, [DX_WAVE_PREFIX_BIT_COUNT ] = {"i", "1", sm6_parser_emit_dx_unary}, [DX_WAVE_PREFIX_OP ] = {"n", "Rcc", sm6_parser_emit_dx_wave_op}, + [DX_WAVE_READ_LANE_AT ] = {"n", "Ri", sm6_parser_emit_dx_binary}, }; static bool sm6_parser_validate_operand_type(struct sm6_parser *sm6, const struct sm6_value *value, char info_type, diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 073c4100..d2a49361 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -546,6 +546,7 @@ enum vkd3d_shader_opcode VKD3DSIH_WAVE_OP_UMAX, VKD3DSIH_WAVE_OP_UMIN, VKD3DSIH_WAVE_PREFIX_BIT_COUNT, + VKD3DSIH_WAVE_READ_LANE_AT, VKD3DSIH_XOR, VKD3DSIH_INVALID,