Based in part on a vkd3d-proton patch by Joshua Ashton.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 15 +++++---- libs/vkd3d-shader/trace.c | 41 +++++++++++++++++++++++- libs/vkd3d-shader/vkd3d_shader_private.h | 3 ++ 3 files changed, 52 insertions(+), 7 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 6e7c1746..da102056 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -331,6 +331,7 @@ enum vkd3d_sm4_register_type VKD3D_SM4_RT_OUTPUT = 0x02, VKD3D_SM4_RT_INDEXABLE_TEMP = 0x03, VKD3D_SM4_RT_IMMCONST = 0x04, + VKD3D_SM4_RT_IMMCONST64 = 0x05, VKD3D_SM4_RT_SAMPLER = 0x06, VKD3D_SM4_RT_RESOURCE = 0x07, VKD3D_SM4_RT_CONSTBUFFER = 0x08, @@ -1265,7 +1266,7 @@ static const enum vkd3d_shader_register_type register_type_table[] = /* VKD3D_SM4_RT_OUTPUT */ VKD3DSPR_OUTPUT, /* VKD3D_SM4_RT_INDEXABLE_TEMP */ VKD3DSPR_IDXTEMP, /* VKD3D_SM4_RT_IMMCONST */ VKD3DSPR_IMMCONST, - /* UNKNOWN */ ~0u, + /* VKD3D_SM4_RT_IMMCONST64 */ VKD3DSPR_IMMCONST64, /* VKD3D_SM4_RT_SAMPLER */ VKD3DSPR_SAMPLER, /* VKD3D_SM4_RT_RESOURCE */ VKD3DSPR_RESOURCE, /* VKD3D_SM4_RT_CONSTBUFFER */ VKD3DSPR_CONSTBUFFER, @@ -1656,21 +1657,23 @@ static bool shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr return false; }
- if (register_type == VKD3D_SM4_RT_IMMCONST) + if (register_type == VKD3D_SM4_RT_IMMCONST || register_type == VKD3D_SM4_RT_IMMCONST64) { enum vkd3d_sm4_dimension dimension = (token & VKD3D_SM4_DIMENSION_MASK) >> VKD3D_SM4_DIMENSION_SHIFT; + unsigned int dword_count;
switch (dimension) { case VKD3D_SM4_DIMENSION_SCALAR: param->immconst_type = VKD3D_IMMCONST_SCALAR; - if (end - *ptr < 1) + dword_count = 1 + (register_type == VKD3D_SM4_RT_IMMCONST64); + if (end - *ptr < dword_count) { WARN("Invalid ptr %p, end %p.\n", *ptr, end); return false; } - memcpy(param->u.immconst_uint, *ptr, 1 * sizeof(DWORD)); - *ptr += 1; + memcpy(param->u.immconst_uint, *ptr, dword_count * sizeof(DWORD)); + *ptr += dword_count; break;
case VKD3D_SM4_DIMENSION_VEC4: @@ -1744,7 +1747,7 @@ static bool shader_sm4_read_src_param(struct vkd3d_sm4_data *priv, const DWORD * return false; }
- if (src_param->reg.type == VKD3DSPR_IMMCONST) + if (src_param->reg.type == VKD3DSPR_IMMCONST || src_param->reg.type == VKD3DSPR_IMMCONST64) { src_param->swizzle = VKD3D_SHADER_NO_SWIZZLE; } diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index b80aef67..d66681b9 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -722,6 +722,17 @@ static void shader_print_float_literal(struct vkd3d_d3d_asm_compiler *compiler, prefix, compiler->colours.literal, f, compiler->colours.reset, suffix); }
+static void shader_print_double_literal(struct vkd3d_d3d_asm_compiler *compiler, + const char *prefix, double d, const char *suffix) +{ + if (isfinite(d) && signbit(d)) + vkd3d_string_buffer_printf(&compiler->buffer, "%s-%s%.15e%s%s", + prefix, compiler->colours.literal, -d, compiler->colours.reset, suffix); + else + vkd3d_string_buffer_printf(&compiler->buffer, "%s%s%.15e%s%s", + prefix, compiler->colours.literal, d, compiler->colours.reset, suffix); +} + static void shader_print_int_literal(struct vkd3d_d3d_asm_compiler *compiler, const char *prefix, int i, const char *suffix) { @@ -886,6 +897,10 @@ static void shader_dump_register(struct vkd3d_d3d_asm_compiler *compiler, const shader_addline(buffer, "l"); break;
+ case VKD3DSPR_IMMCONST64: + shader_addline(buffer, "d"); + break; + case VKD3DSPR_CONSTBUFFER: shader_addline(buffer, "cb"); is_descriptor = true; @@ -1058,6 +1073,29 @@ static void shader_dump_register(struct vkd3d_d3d_asm_compiler *compiler, const } shader_addline(buffer, ")"); } + else if (reg->type == VKD3DSPR_IMMCONST64) + { + shader_addline(buffer, "%s(", compiler->colours.reset); + /* A double2 vector is treated as a float4 vector in enum vkd3d_immconst_type. */ + if (reg->immconst_type == VKD3D_IMMCONST_SCALAR || reg->immconst_type == VKD3D_IMMCONST_VEC4) + { + if (reg->data_type == VKD3D_DATA_DOUBLE) + { + shader_print_double_literal(compiler, "", reg->u.immconst_double[0], ""); + if (reg->immconst_type == VKD3D_IMMCONST_VEC4) + shader_print_double_literal(compiler, ", ", reg->u.immconst_double[1], ""); + } + else + { + shader_addline(buffer, "<unhandled data type %#x>", reg->data_type); + } + } + else + { + shader_addline(buffer, "<unhandled immconst_type %#x>", reg->immconst_type); + } + shader_addline(buffer, ")"); + } else if (reg->type != VKD3DSPR_RASTOUT && reg->type != VKD3DSPR_MISCTYPE && reg->type != VKD3DSPR_NULL) @@ -1181,7 +1219,8 @@ static void shader_dump_src_param(struct vkd3d_d3d_asm_compiler *compiler, default: shader_addline(buffer, "_unknown_modifier(%#x)", src_modifier); }
- if (param->reg.type != VKD3DSPR_IMMCONST && param->reg.type != VKD3DSPR_SAMPLER) + if (param->reg.type != VKD3DSPR_IMMCONST && param->reg.type != VKD3DSPR_IMMCONST64 + && param->reg.type != VKD3DSPR_SAMPLER) { static const char swizzle_chars[] = "xyzw"; DWORD swizzle_x = (swizzle >> VKD3D_SHADER_SWIZZLE_SHIFT(0)) & VKD3D_SHADER_SWIZZLE_MASK; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 9e40a3bf..b3cd8cef 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -58,6 +58,7 @@ #include <string.h>
#define VKD3D_VEC4_SIZE 4 +#define VKD3D_DVEC2_SIZE 2
enum vkd3d_shader_error { @@ -387,6 +388,7 @@ enum vkd3d_shader_register_type VKD3DSPR_LABEL = 18, VKD3DSPR_PREDICATE = 19, VKD3DSPR_IMMCONST, + VKD3DSPR_IMMCONST64, VKD3DSPR_CONSTBUFFER, VKD3DSPR_IMMCONSTBUFFER, VKD3DSPR_PRIMID, @@ -619,6 +621,7 @@ struct vkd3d_shader_register { DWORD immconst_uint[VKD3D_VEC4_SIZE]; float immconst_float[VKD3D_VEC4_SIZE]; + double immconst_double[VKD3D_DVEC2_SIZE]; unsigned fp_body_idx; } u; };
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/spirv.c | 81 ++++++++++++++++++++++-- libs/vkd3d-shader/vkd3d_shader_private.h | 7 ++ 2 files changed, 84 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 0abc2d6d..b5f20ce1 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -1147,6 +1147,21 @@ static uint32_t vkd3d_spirv_get_op_constant(struct vkd3d_spirv_builder *builder, vkd3d_spirv_build_op_constant); }
+static uint32_t vkd3d_spirv_build_op_constant64(struct vkd3d_spirv_builder *builder, + uint32_t result_type, const uint32_t *values, unsigned int value_count) +{ + assert(value_count == 2); + return vkd3d_spirv_build_op_trv(builder, &builder->global_stream, + SpvOpConstant, result_type, values, value_count); +} + +static uint32_t vkd3d_spirv_get_op_constant64(struct vkd3d_spirv_builder *builder, + uint32_t result_type, uint64_t value) +{ + return vkd3d_spirv_build_once1v(builder, SpvOpConstant, result_type, + (const uint32_t *)&value, 2, vkd3d_spirv_build_op_constant64); +} + static uint32_t vkd3d_spirv_build_op_constant_composite(struct vkd3d_spirv_builder *builder, uint32_t result_type, const uint32_t *constituents, unsigned int constituent_count) { @@ -2709,6 +2724,35 @@ static uint32_t vkd3d_dxbc_compiler_get_constant(struct vkd3d_dxbc_compiler *com } }
+static uint32_t vkd3d_dxbc_compiler_get_constant64(struct vkd3d_dxbc_compiler *compiler, + enum vkd3d_shader_component_type component_type, unsigned int component_count, const uint64_t *values) +{ + uint32_t type_id, scalar_type_id, component_ids[VKD3D_DVEC2_SIZE]; + struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; + unsigned int i; + + assert(0 < component_count && component_count <= VKD3D_DVEC2_SIZE); + type_id = vkd3d_spirv_get_type_id(builder, component_type, component_count); + + if (component_type != VKD3D_SHADER_COMPONENT_DOUBLE) + { + FIXME("Unhandled component_type %#x.\n", component_type); + return vkd3d_spirv_build_op_undef(builder, &builder->global_stream, type_id); + } + + if (component_count == 1) + { + return vkd3d_spirv_get_op_constant64(builder, type_id, *values); + } + else + { + scalar_type_id = vkd3d_spirv_get_type_id(builder, component_type, 1); + for (i = 0; i < component_count; ++i) + component_ids[i] = vkd3d_spirv_get_op_constant64(builder, scalar_type_id, values[i]); + return vkd3d_spirv_get_op_constant_composite(builder, type_id, component_ids, component_count); + } +} + static uint32_t vkd3d_dxbc_compiler_get_constant_uint(struct vkd3d_dxbc_compiler *compiler, uint32_t value) { @@ -3079,7 +3123,7 @@ static bool vkd3d_dxbc_compiler_get_register_info(const struct vkd3d_dxbc_compil struct vkd3d_symbol reg_symbol, *symbol; struct rb_entry *entry;
- assert(reg->type != VKD3DSPR_IMMCONST); + assert(reg->type != VKD3DSPR_IMMCONST && reg->type != VKD3DSPR_IMMCONST64);
if (reg->type == VKD3DSPR_TEMP) { @@ -3390,6 +3434,33 @@ static uint32_t vkd3d_dxbc_compiler_emit_load_constant(struct vkd3d_dxbc_compile vkd3d_component_type_from_data_type(reg->data_type), component_count, values); }
+static uint32_t vkd3d_dxbc_compiler_emit_load_constant64(struct vkd3d_dxbc_compiler *compiler, + const struct vkd3d_shader_register *reg, DWORD swizzle, DWORD write_mask) +{ + unsigned int component_count = vkd3d_write_mask_component_count(write_mask); + uint64_t values[VKD3D_DVEC2_SIZE] = {0}; + unsigned int i, j; + + assert(reg->type == VKD3DSPR_IMMCONST64); + + if (reg->immconst_type == VKD3D_IMMCONST_SCALAR) + { + for (i = 0; i < component_count; ++i) + values[i] = *reg->u.immconst_uint64; + } + else + { + for (i = 0, j = 0; i < VKD3D_DVEC2_SIZE; ++i) + { + if (write_mask & (VKD3DSP_WRITEMASK_0 << i)) + values[j++] = reg->u.immconst_uint64[vkd3d_swizzle_get_component64(swizzle, i)]; + } + } + + return vkd3d_dxbc_compiler_get_constant64(compiler, + vkd3d_component_type_from_data_type(reg->data_type), component_count, values); +} + static uint32_t vkd3d_dxbc_compiler_emit_load_scalar(struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_register *reg, DWORD swizzle, DWORD write_mask, const struct vkd3d_shader_register_info *reg_info) @@ -3400,7 +3471,7 @@ static uint32_t vkd3d_dxbc_compiler_emit_load_scalar(struct vkd3d_dxbc_compiler enum vkd3d_shader_component_type component_type; unsigned int skipped_component_mask;
- assert(reg->type != VKD3DSPR_IMMCONST); + assert(reg->type != VKD3DSPR_IMMCONST && reg->type != VKD3DSPR_IMMCONST64); assert(vkd3d_write_mask_component_count(write_mask) == 1);
component_idx = vkd3d_write_mask_get_component_idx(write_mask); @@ -3450,6 +3521,8 @@ static uint32_t vkd3d_dxbc_compiler_emit_load_reg(struct vkd3d_dxbc_compiler *co
if (reg->type == VKD3DSPR_IMMCONST) return vkd3d_dxbc_compiler_emit_load_constant(compiler, reg, swizzle, write_mask); + else if (reg->type == VKD3DSPR_IMMCONST64) + return vkd3d_dxbc_compiler_emit_load_constant64(compiler, reg, swizzle, write_mask);
component_count = vkd3d_write_mask_component_count(write_mask); component_type = vkd3d_component_type_from_data_type(reg->data_type); @@ -3665,7 +3738,7 @@ static void vkd3d_dxbc_compiler_emit_store_reg(struct vkd3d_dxbc_compiler *compi unsigned int src_write_mask = write_mask; uint32_t type_id;
- assert(reg->type != VKD3DSPR_IMMCONST); + assert(reg->type != VKD3DSPR_IMMCONST && reg->type != VKD3DSPR_IMMCONST64);
if (!vkd3d_dxbc_compiler_get_register_info(compiler, reg, ®_info)) return; @@ -6840,7 +6913,7 @@ static void vkd3d_dxbc_compiler_emit_mov(struct vkd3d_dxbc_compiler *compiler, uint32_t components[VKD3D_VEC4_SIZE]; unsigned int i, component_count;
- if (src->reg.type == VKD3DSPR_IMMCONST || dst->modifiers || src->modifiers) + if (src->reg.type == VKD3DSPR_IMMCONST || src->reg.type == VKD3DSPR_IMMCONST64 || dst->modifiers || src->modifiers) goto general_implementation;
vkd3d_dxbc_compiler_get_register_info(compiler, &dst->reg, &dst_reg_info); diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index b3cd8cef..c4500499 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -621,6 +621,7 @@ struct vkd3d_shader_register { DWORD immconst_uint[VKD3D_VEC4_SIZE]; float immconst_float[VKD3D_VEC4_SIZE]; + uint64_t immconst_uint64[VKD3D_DVEC2_SIZE]; double immconst_double[VKD3D_DVEC2_SIZE]; unsigned fp_body_idx; } u; @@ -1087,6 +1088,12 @@ static inline unsigned int vkd3d_swizzle_get_component(DWORD swizzle, return (swizzle >> VKD3D_SHADER_SWIZZLE_SHIFT(idx)) & VKD3D_SHADER_SWIZZLE_MASK; }
+static inline unsigned int vkd3d_swizzle_get_component64(DWORD swizzle, + unsigned int idx) +{ + return ((swizzle >> VKD3D_SHADER_SWIZZLE_SHIFT(idx * 2)) & VKD3D_SHADER_SWIZZLE_MASK) / 2u; +} + static inline unsigned int vkd3d_compact_swizzle(unsigned int swizzle, unsigned int write_mask) { unsigned int i, compacted_swizzle = 0;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Based on a vkd3d-proton patch by Joshua Ashton.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/spirv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index b5f20ce1..c18f6944 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -3582,15 +3582,12 @@ static void vkd3d_dxbc_compiler_emit_execution_mode1(struct vkd3d_dxbc_compiler static uint32_t vkd3d_dxbc_compiler_emit_abs(struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_register *reg, DWORD write_mask, uint32_t val_id) { - unsigned int component_count = vkd3d_write_mask_component_count(write_mask); struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; uint32_t type_id;
- if (reg->data_type == VKD3D_DATA_FLOAT) - { - type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_FLOAT, component_count); + type_id = vkd3d_dxbc_compiler_get_type_id_for_reg(compiler, reg, write_mask); + if (reg->data_type == VKD3D_DATA_FLOAT || reg->data_type == VKD3D_DATA_DOUBLE) return vkd3d_spirv_build_op_glsl_std450_fabs(builder, type_id, val_id); - }
FIXME("Unhandled data type %#x.\n", reg->data_type); return val_id;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/spirv.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index c18f6944..be7330e6 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2786,6 +2786,14 @@ static uint32_t vkd3d_dxbc_compiler_get_constant_float_vector(struct vkd3d_dxbc_ component_count, (const uint32_t *)values); }
+static uint32_t vkd3d_dxbc_compiler_get_constant_double_vector(struct vkd3d_dxbc_compiler *compiler, + double value, unsigned int component_count) +{ + const double values[] = {value, value}; + return vkd3d_dxbc_compiler_get_constant64(compiler, VKD3D_SHADER_COMPONENT_DOUBLE, + component_count, (const uint64_t *)values); +} + static uint32_t vkd3d_dxbc_compiler_get_type_id_for_reg(struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_register *reg, DWORD write_mask) { @@ -3763,11 +3771,19 @@ static uint32_t vkd3d_dxbc_compiler_emit_sat(struct vkd3d_dxbc_compiler *compile struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; uint32_t type_id, zero_id, one_id;
- zero_id = vkd3d_dxbc_compiler_get_constant_float_vector(compiler, 0.0f, component_count); - one_id = vkd3d_dxbc_compiler_get_constant_float_vector(compiler, 1.0f, component_count); + if (reg->data_type == VKD3D_DATA_DOUBLE) + { + zero_id = vkd3d_dxbc_compiler_get_constant_double_vector(compiler, 0.0, component_count); + one_id = vkd3d_dxbc_compiler_get_constant_double_vector(compiler, 1.0, component_count); + } + else + { + zero_id = vkd3d_dxbc_compiler_get_constant_float_vector(compiler, 0.0f, component_count); + one_id = vkd3d_dxbc_compiler_get_constant_float_vector(compiler, 1.0f, component_count); + }
type_id = vkd3d_dxbc_compiler_get_type_id_for_reg(compiler, reg, write_mask); - if (reg->data_type == VKD3D_DATA_FLOAT) + if (reg->data_type == VKD3D_DATA_FLOAT || reg->data_type == VKD3D_DATA_DOUBLE) return vkd3d_spirv_build_op_glsl_std450_nclamp(builder, type_id, val_id, zero_id, one_id);
FIXME("Unhandled data type %#x.\n", reg->data_type);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 2 ++ libs/vkd3d-shader/spirv.c | 2 ++ libs/vkd3d-shader/trace.c | 1 + libs/vkd3d-shader/vkd3d_shader_private.h | 1 + tests/d3d12.c | 6 +++--- 5 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index da102056..26911255 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -310,6 +310,7 @@ enum vkd3d_sm4_opcode VKD3D_SM5_OP_IMM_ATOMIC_UMAX = 0xbc, VKD3D_SM5_OP_IMM_ATOMIC_UMIN = 0xbd, VKD3D_SM5_OP_SYNC = 0xbe, + VKD3D_SM5_OP_DADD = 0xbf, VKD3D_SM5_OP_DEQ = 0xc3, VKD3D_SM5_OP_DMOV = 0xc7, VKD3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc, @@ -1251,6 +1252,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = {VKD3D_SM5_OP_IMM_ATOMIC_UMIN, VKD3DSIH_IMM_ATOMIC_UMIN, "uU", "iu"}, {VKD3D_SM5_OP_SYNC, VKD3DSIH_SYNC, "", "", shader_sm5_read_sync}, + {VKD3D_SM5_OP_DADD, VKD3DSIH_DADD, "d", "dd"}, {VKD3D_SM5_OP_DEQ, VKD3DSIH_DEQ, "u", "dd"}, {VKD3D_SM5_OP_DMOV, VKD3DSIH_DMOV, "d", "d"}, {VKD3D_SM5_OP_EVAL_SAMPLE_INDEX, VKD3DSIH_EVAL_SAMPLE_INDEX, "f", "fi"}, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index c18f6944..a2873ff5 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -6756,6 +6756,7 @@ static SpvOp vkd3d_dxbc_compiler_map_alu_instruction(const struct vkd3d_shader_i {VKD3DSIH_AND, SpvOpBitwiseAnd}, {VKD3DSIH_BFREV, SpvOpBitReverse}, {VKD3DSIH_COUNTBITS, SpvOpBitCount}, + {VKD3DSIH_DADD, SpvOpFAdd}, {VKD3DSIH_DIV, SpvOpFDiv}, {VKD3DSIH_FTOI, SpvOpConvertFToS}, {VKD3DSIH_FTOU, SpvOpConvertFToU}, @@ -9495,6 +9496,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, case VKD3DSIH_AND: case VKD3DSIH_BFREV: case VKD3DSIH_COUNTBITS: + case VKD3DSIH_DADD: case VKD3DSIH_DIV: case VKD3DSIH_FTOI: case VKD3DSIH_FTOU: diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index d66681b9..592befe1 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -59,6 +59,7 @@ static const char * const shader_opcode_names[] = /* VKD3DSIH_CRS */ "crs", /* VKD3DSIH_CUT */ "cut", /* VKD3DSIH_CUT_STREAM */ "cut_stream", + /* VKD3DSIH_DADD */ "dadd", /* VKD3DSIH_DCL */ "dcl", /* VKD3DSIH_DCL_CONSTANT_BUFFER */ "dcl_constantBuffer", /* VKD3DSIH_DCL_FUNCTION_BODY */ "dcl_function_body", diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index c4500499..23f2b232 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -148,6 +148,7 @@ enum vkd3d_shader_opcode VKD3DSIH_CRS, VKD3DSIH_CUT, VKD3DSIH_CUT_STREAM, + VKD3DSIH_DADD, VKD3DSIH_DCL, VKD3DSIH_DCL_CONSTANT_BUFFER, VKD3DSIH_DCL_FUNCTION_BODY, diff --git a/tests/d3d12.c b/tests/d3d12.c index a43a7f27..f90526c7 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -9881,12 +9881,12 @@ static void test_shader_instructions(void) {&ps_movc, {{{1, 1, 1, 1}, {1, 2, 3, 4}, {5, 6, 7, 8}}}, {{1, 2, 3, 4}}},
{&ps_dmov, {.d = {{2.5 + 1.0e-9, -3.5 - 1.0e-9}}}, {.d = {3.5 + 1.0e-9, -2.5 - 1.0e-9}}, true}, - {&ps_dadd, {.d = {{2.5, 0.0}}}, {.d = {2.5 + 1.0000002433080226, 2.5 + 2.000000481493771}}, true, true}, + {&ps_dadd, {.d = {{2.5, 0.0}}}, {.d = {2.5 + 1.0000002433080226, 2.5 + 2.000000481493771}}, true}, {&ps_dmin_dmax, {.d = {{-1.0, 1.0}}}, {.d = {-1.0, 1.0}}, true, true}, {&ps_dmovc, {.d = {{0.5, 0.0}}}, {.d = {4.5, 4.5}}, true, true}, {&ps_dmovc, {.d = {{1.5, 0.0}}}, {.d = {1.5, 0.0}}, true, true}, - {&ps_dmodifier, {.d = {{1.5, 0.0}}}, {.d = {1.5f, 2.5f}}, true, true}, - {&ps_dmodifier, {.d = {{-1.5, 0.0}}}, {.d = {1.5f, 1.5f}}, true, true}, + {&ps_dmodifier, {.d = {{1.5, 0.0}}}, {.d = {1.5f, 2.5f}}, true}, + {&ps_dmodifier, {.d = {{-1.5, 0.0}}}, {.d = {1.5f, 1.5f}}, true}, {&ps_deq, {.d = {{0.0, 0.0}}}, {{0xffffffff}}, true}, {&ps_deq, {.d = {{1.0, 0.0}}}, {{0x00000000}}, true}, {&ps_dne, {.d = {{0.0, 0.0}}}, {{0x00000000}}, true, true},
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com