Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- tests/d3d12.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index aaf4bfca..9e8aa837 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -9432,6 +9432,29 @@ static void test_shader_instructions(void) 0x00000001, 0x00000000, }; static struct named_shader ps_ftod = {"ftod", ps_ftod_code, sizeof(ps_ftod_code)}; + static const DWORD ps_dmul_code[] = + { +#if 0 + double2 src0; + + void main(out uint4 dst : SV_Target) + { + asuint(src0.x * src0.y, dst.x, dst.y); + asuint(src0.x * -src0.y, dst.z, dst.w); + } +#endif + 0x43425844, 0xe8fbac4e, 0x46b3cd8c, 0x6a38f67a, 0xfe02dbd5, 0x00000001, 0x00000134, 0x00000004, + 0x00000030, 0x00000040, 0x00000074, 0x00000124, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x000000a8, 0x00000050, + 0x0000002a, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, + 0x00000000, 0x02000068, 0x00000001, 0x090000c2, 0x00100032, 0x00000000, 0x00208ee6, 0x00000000, + 0x00000000, 0x00208446, 0x00000000, 0x00000000, 0x05000036, 0x00102032, 0x00000000, 0x00100046, + 0x00000000, 0x0a0000c2, 0x00100032, 0x00000000, 0x80208ee6, 0x00000041, 0x00000000, 0x00000000, + 0x00208446, 0x00000000, 0x00000000, 0x05000036, 0x001020c2, 0x00000000, 0x00100406, 0x00000000, + 0x0100003e, 0x30494653, 0x00000008, 0x00000001, 0x00000000, + }; + static const struct named_shader ps_dmul = {"dmul", ps_dmul_code, sizeof(ps_dmul_code)}; static const DWORD ps_ddiv_code[] = { #if 0 @@ -9984,6 +10007,7 @@ static void test_shader_instructions(void) {&ps_utod, {.u = {{3, 0xffffffff}}}, {.d = {3.0, 4294967295.0}}, true, true}, {&ps_itod, {.u = {{3, INT_MIN}}}, {.d = {3.0, -2147483648.0}}, true, true}, {&ps_ftod, {.f = {{-2.5f, -2.5f}}}, {.d = {-2.5, 2.5}}, true, true}, + {&ps_dmul, {.d = {{ 1.5, 3.0}}}, {.d = { 4.5, -4.5}}, true, true}, {&ps_ddiv, {.d = {{ 2.0, 4.0}}}, {.d = { 0.5, 2.0}}, true, true}, {&ps_ddiv, {.d = {{ 2.0, -4.0}}}, {.d = {-0.5, -2.0}}, true, true}, {&ps_drcp, {.d = {{ 2.0, -0.5}}}, {.d = { 0.5, -2.0}}, true, true},
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 1 + libs/vkd3d-shader/sm4.h | 1 + libs/vkd3d-shader/spirv.c | 2 ++ libs/vkd3d-shader/trace.c | 1 + libs/vkd3d-shader/vkd3d_shader_private.h | 1 + tests/d3d12.c | 2 +- 6 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index de55d782..6ec25852 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -800,6 +800,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = {VKD3D_SM5_OP_DADD, VKD3DSIH_DADD, "d", "dd"}, {VKD3D_SM5_OP_DMAX, VKD3DSIH_DMAX, "d", "dd"}, {VKD3D_SM5_OP_DMIN, VKD3DSIH_DMIN, "d", "dd"}, + {VKD3D_SM5_OP_DMUL, VKD3DSIH_DMUL, "d", "dd"}, {VKD3D_SM5_OP_DEQ, VKD3DSIH_DEQ, "u", "dd"}, {VKD3D_SM5_OP_DGE, VKD3DSIH_DGE, "u", "dd"}, {VKD3D_SM5_OP_DLT, VKD3DSIH_DLT, "u", "dd"}, diff --git a/libs/vkd3d-shader/sm4.h b/libs/vkd3d-shader/sm4.h index d9f61898..12380bbb 100644 --- a/libs/vkd3d-shader/sm4.h +++ b/libs/vkd3d-shader/sm4.h @@ -320,6 +320,7 @@ enum vkd3d_sm4_opcode VKD3D_SM5_OP_DADD = 0xbf, VKD3D_SM5_OP_DMAX = 0xc0, VKD3D_SM5_OP_DMIN = 0xc1, + VKD3D_SM5_OP_DMUL = 0xc2, VKD3D_SM5_OP_DEQ = 0xc3, VKD3D_SM5_OP_DGE = 0xc4, VKD3D_SM5_OP_DLT = 0xc5, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 08709e44..7ffba4d7 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -6774,6 +6774,7 @@ static SpvOp vkd3d_dxbc_compiler_map_alu_instruction(const struct vkd3d_shader_i {VKD3DSIH_COUNTBITS, SpvOpBitCount}, {VKD3DSIH_DADD, SpvOpFAdd}, {VKD3DSIH_DIV, SpvOpFDiv}, + {VKD3DSIH_DMUL, SpvOpFMul}, {VKD3DSIH_FTOI, SpvOpConvertFToS}, {VKD3DSIH_FTOU, SpvOpConvertFToU}, {VKD3DSIH_IADD, SpvOpIAdd}, @@ -9520,6 +9521,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, case VKD3DSIH_COUNTBITS: case VKD3DSIH_DADD: case VKD3DSIH_DIV: + case VKD3DSIH_DMUL: case VKD3DSIH_FTOI: case VKD3DSIH_FTOU: case VKD3DSIH_IADD: diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index d0aaa0fb..1e1b026b 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -112,6 +112,7 @@ static const char * const shader_opcode_names[] = /* VKD3DSIH_DMAX */ "dmax", /* VKD3DSIH_DMIN */ "dmin", /* VKD3DSIH_DMOV */ "dmov", + /* VKD3DSIH_DMUL */ "dmul", /* VKD3DSIH_DNE */ "dne", /* VKD3DSIH_DP2 */ "dp2", /* VKD3DSIH_DP2ADD */ "dp2add", diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index b64c4b10..f5fff1ec 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -201,6 +201,7 @@ enum vkd3d_shader_opcode VKD3DSIH_DMAX, VKD3DSIH_DMIN, VKD3DSIH_DMOV, + VKD3DSIH_DMUL, VKD3DSIH_DNE, VKD3DSIH_DP2, VKD3DSIH_DP2ADD, diff --git a/tests/d3d12.c b/tests/d3d12.c index 9e8aa837..585ab62d 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -10007,7 +10007,7 @@ static void test_shader_instructions(void) {&ps_utod, {.u = {{3, 0xffffffff}}}, {.d = {3.0, 4294967295.0}}, true, true}, {&ps_itod, {.u = {{3, INT_MIN}}}, {.d = {3.0, -2147483648.0}}, true, true}, {&ps_ftod, {.f = {{-2.5f, -2.5f}}}, {.d = {-2.5, 2.5}}, true, true}, - {&ps_dmul, {.d = {{ 1.5, 3.0}}}, {.d = { 4.5, -4.5}}, true, true}, + {&ps_dmul, {.d = {{ 1.5, 3.0}}}, {.d = { 4.5, -4.5}}, true}, {&ps_ddiv, {.d = {{ 2.0, 4.0}}}, {.d = { 0.5, 2.0}}, true, true}, {&ps_ddiv, {.d = {{ 2.0, -4.0}}}, {.d = {-0.5, -2.0}}, true, true}, {&ps_drcp, {.d = {{ 2.0, -0.5}}}, {.d = { 0.5, -2.0}}, true, true},
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 1 + libs/vkd3d-shader/sm4.h | 1 + libs/vkd3d-shader/spirv.c | 2 ++ libs/vkd3d-shader/trace.c | 1 + libs/vkd3d-shader/vkd3d_shader_private.h | 1 + tests/d3d12.c | 4 ++-- 6 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 6ec25852..ed7a01a4 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -810,6 +810,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = {VKD3D_SM5_OP_EVAL_CENTROID, VKD3DSIH_EVAL_CENTROID, "f", "f"}, {VKD3D_SM5_OP_DCL_GS_INSTANCES, VKD3DSIH_DCL_GS_INSTANCES, "", "", shader_sm4_read_declaration_count}, + {VKD3D_SM5_OP_DDIV, VKD3DSIH_DDIV, "d", "dd"}, {VKD3D_SM5_OP_DFMA, VKD3DSIH_DFMA, "d", "ddd"}, };
diff --git a/libs/vkd3d-shader/sm4.h b/libs/vkd3d-shader/sm4.h index 12380bbb..aba7d276 100644 --- a/libs/vkd3d-shader/sm4.h +++ b/libs/vkd3d-shader/sm4.h @@ -329,6 +329,7 @@ enum vkd3d_sm4_opcode VKD3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc, VKD3D_SM5_OP_EVAL_CENTROID = 0xcd, VKD3D_SM5_OP_DCL_GS_INSTANCES = 0xce, + VKD3D_SM5_OP_DDIV = 0xd2, VKD3D_SM5_OP_DFMA = 0xd3, };
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 7ffba4d7..3db100e1 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -6773,6 +6773,7 @@ static SpvOp vkd3d_dxbc_compiler_map_alu_instruction(const struct vkd3d_shader_i {VKD3DSIH_BFREV, SpvOpBitReverse}, {VKD3DSIH_COUNTBITS, SpvOpBitCount}, {VKD3DSIH_DADD, SpvOpFAdd}, + {VKD3DSIH_DDIV, SpvOpFDiv}, {VKD3DSIH_DIV, SpvOpFDiv}, {VKD3DSIH_DMUL, SpvOpFMul}, {VKD3DSIH_FTOI, SpvOpConvertFToS}, @@ -9520,6 +9521,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, case VKD3DSIH_BFREV: case VKD3DSIH_COUNTBITS: case VKD3DSIH_DADD: + case VKD3DSIH_DDIV: case VKD3DSIH_DIV: case VKD3DSIH_DMUL: case VKD3DSIH_FTOI: diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 1e1b026b..a7294307 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -100,6 +100,7 @@ static const char * const shader_opcode_names[] = /* VKD3DSIH_DCL_UAV_STRUCTURED */ "dcl_uav_structured", /* VKD3DSIH_DCL_UAV_TYPED */ "dcl_uav_typed", /* VKD3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount", + /* VKD3DSIH_DDIV */ "ddiv", /* VKD3DSIH_DEF */ "def", /* VKD3DSIH_DEFAULT */ "default", /* VKD3DSIH_DEFB */ "defb", diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index f5fff1ec..56a4dde5 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -189,6 +189,7 @@ enum vkd3d_shader_opcode VKD3DSIH_DCL_UAV_STRUCTURED, VKD3DSIH_DCL_UAV_TYPED, VKD3DSIH_DCL_VERTICES_OUT, + VKD3DSIH_DDIV, VKD3DSIH_DEF, VKD3DSIH_DEFAULT, VKD3DSIH_DEFB, diff --git a/tests/d3d12.c b/tests/d3d12.c index 585ab62d..e7a273e6 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -10008,8 +10008,8 @@ static void test_shader_instructions(void) {&ps_itod, {.u = {{3, INT_MIN}}}, {.d = {3.0, -2147483648.0}}, true, true}, {&ps_ftod, {.f = {{-2.5f, -2.5f}}}, {.d = {-2.5, 2.5}}, true, true}, {&ps_dmul, {.d = {{ 1.5, 3.0}}}, {.d = { 4.5, -4.5}}, true}, - {&ps_ddiv, {.d = {{ 2.0, 4.0}}}, {.d = { 0.5, 2.0}}, true, true}, - {&ps_ddiv, {.d = {{ 2.0, -4.0}}}, {.d = {-0.5, -2.0}}, true, true}, + {&ps_ddiv, {.d = {{ 2.0, 4.0}}}, {.d = { 0.5, 2.0}}, true}, + {&ps_ddiv, {.d = {{ 2.0, -4.0}}}, {.d = {-0.5, -2.0}}, true}, {&ps_drcp, {.d = {{ 2.0, -0.5}}}, {.d = { 0.5, -2.0}}, true, true},
{
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 1 + libs/vkd3d-shader/sm4.h | 1 + libs/vkd3d-shader/spirv.c | 10 +++++++--- libs/vkd3d-shader/trace.c | 1 + libs/vkd3d-shader/vkd3d_shader_private.h | 1 + tests/d3d12.c | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index ed7a01a4..8e0f8cbd 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -812,6 +812,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = shader_sm4_read_declaration_count}, {VKD3D_SM5_OP_DDIV, VKD3DSIH_DDIV, "d", "dd"}, {VKD3D_SM5_OP_DFMA, VKD3DSIH_DFMA, "d", "ddd"}, + {VKD3D_SM5_OP_DRCP, VKD3DSIH_DRCP, "d", "d"}, };
static const enum vkd3d_shader_register_type register_type_table[] = diff --git a/libs/vkd3d-shader/sm4.h b/libs/vkd3d-shader/sm4.h index aba7d276..0c56a0cd 100644 --- a/libs/vkd3d-shader/sm4.h +++ b/libs/vkd3d-shader/sm4.h @@ -331,6 +331,7 @@ enum vkd3d_sm4_opcode VKD3D_SM5_OP_DCL_GS_INSTANCES = 0xce, VKD3D_SM5_OP_DDIV = 0xd2, VKD3D_SM5_OP_DFMA = 0xd3, + VKD3D_SM5_OP_DRCP = 0xd4, };
enum vkd3d_sm4_instruction_modifier diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 3db100e1..37c3b310 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -7078,15 +7078,18 @@ static void vkd3d_dxbc_compiler_emit_rcp(struct vkd3d_dxbc_compiler *compiler, struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; const struct vkd3d_shader_dst_param *dst = instruction->dst; const struct vkd3d_shader_src_param *src = instruction->src; - uint32_t type_id, src_id, val_id; + uint32_t type_id, src_id, val_id, div_id; unsigned int component_count;
component_count = vkd3d_write_mask_component_count(dst->write_mask); type_id = vkd3d_dxbc_compiler_get_type_id_for_dst(compiler, dst);
src_id = vkd3d_dxbc_compiler_emit_load_src(compiler, src, dst->write_mask); - val_id = vkd3d_spirv_build_op_fdiv(builder, type_id, - vkd3d_dxbc_compiler_get_constant_float_vector(compiler, 1.0f, component_count), src_id); + if (src->reg.data_type == VKD3D_DATA_DOUBLE) + div_id = vkd3d_dxbc_compiler_get_constant_double_vector(compiler, 1.0, component_count); + else + div_id = vkd3d_dxbc_compiler_get_constant_float_vector(compiler, 1.0f, component_count); + val_id = vkd3d_spirv_build_op_fdiv(builder, type_id, div_id, src_id); vkd3d_dxbc_compiler_emit_store_dst(compiler, dst, val_id); }
@@ -9568,6 +9571,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, case VKD3DSIH_DP2: vkd3d_dxbc_compiler_emit_dot(compiler, instruction); break; + case VKD3DSIH_DRCP: case VKD3DSIH_RCP: vkd3d_dxbc_compiler_emit_rcp(compiler, instruction); break; diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index a7294307..2af3a769 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -119,6 +119,7 @@ static const char * const shader_opcode_names[] = /* VKD3DSIH_DP2ADD */ "dp2add", /* VKD3DSIH_DP3 */ "dp3", /* VKD3DSIH_DP4 */ "dp4", + /* VKD3DSIH_DRCP */ "drcp", /* VKD3DSIH_DST */ "dst", /* VKD3DSIH_DSX */ "dsx", /* VKD3DSIH_DSX_COARSE */ "deriv_rtx_coarse", diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 56a4dde5..94daa08f 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -208,6 +208,7 @@ enum vkd3d_shader_opcode VKD3DSIH_DP2ADD, VKD3DSIH_DP3, VKD3DSIH_DP4, + VKD3DSIH_DRCP, VKD3DSIH_DST, VKD3DSIH_DSX, VKD3DSIH_DSX_COARSE, diff --git a/tests/d3d12.c b/tests/d3d12.c index e7a273e6..b8d53424 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -10010,7 +10010,7 @@ static void test_shader_instructions(void) {&ps_dmul, {.d = {{ 1.5, 3.0}}}, {.d = { 4.5, -4.5}}, true}, {&ps_ddiv, {.d = {{ 2.0, 4.0}}}, {.d = { 0.5, 2.0}}, true}, {&ps_ddiv, {.d = {{ 2.0, -4.0}}}, {.d = {-0.5, -2.0}}, true}, - {&ps_drcp, {.d = {{ 2.0, -0.5}}}, {.d = { 0.5, -2.0}}, true, true}, + {&ps_drcp, {.d = {{ 2.0, -0.5}}}, {.d = { 0.5, -2.0}}, true},
{ &ps_swapc0,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Based in part on a vkd3d-proton patch by Joshua Ashton.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- libs/vkd3d-shader/dxbc.c | 1 + libs/vkd3d-shader/sm4.h | 1 + libs/vkd3d-shader/spirv.c | 3 ++- libs/vkd3d-shader/trace.c | 1 + libs/vkd3d-shader/vkd3d_shader_private.h | 1 + tests/d3d12.c | 4 ++-- 6 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 8e0f8cbd..fab19046 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -806,6 +806,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] = {VKD3D_SM5_OP_DLT, VKD3DSIH_DLT, "u", "dd"}, {VKD3D_SM5_OP_DNE, VKD3DSIH_DNE, "u", "dd"}, {VKD3D_SM5_OP_DMOV, VKD3DSIH_DMOV, "d", "d"}, + {VKD3D_SM5_OP_DMOVC, VKD3DSIH_DMOVC, "d", "udd"}, {VKD3D_SM5_OP_EVAL_SAMPLE_INDEX, VKD3DSIH_EVAL_SAMPLE_INDEX, "f", "fi"}, {VKD3D_SM5_OP_EVAL_CENTROID, VKD3DSIH_EVAL_CENTROID, "f", "f"}, {VKD3D_SM5_OP_DCL_GS_INSTANCES, VKD3DSIH_DCL_GS_INSTANCES, "", "", diff --git a/libs/vkd3d-shader/sm4.h b/libs/vkd3d-shader/sm4.h index 0c56a0cd..335f0161 100644 --- a/libs/vkd3d-shader/sm4.h +++ b/libs/vkd3d-shader/sm4.h @@ -326,6 +326,7 @@ enum vkd3d_sm4_opcode VKD3D_SM5_OP_DLT = 0xc5, VKD3D_SM5_OP_DNE = 0xc6, VKD3D_SM5_OP_DMOV = 0xc7, + VKD3D_SM5_OP_DMOVC = 0xc8, VKD3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc, VKD3D_SM5_OP_EVAL_CENTROID = 0xcd, VKD3D_SM5_OP_DCL_GS_INSTANCES = 0xce, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 37c3b310..5729ea1a 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -6996,7 +6996,7 @@ static void vkd3d_dxbc_compiler_emit_movc(struct vkd3d_dxbc_compiler *compiler, src2_id = vkd3d_dxbc_compiler_emit_load_src(compiler, &src[2], dst->write_mask);
component_count = vkd3d_write_mask_component_count(dst->write_mask); - type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_FLOAT, component_count); + type_id = vkd3d_dxbc_compiler_get_type_id_for_dst(compiler, dst);
condition_id = vkd3d_dxbc_compiler_emit_int_to_bool(compiler, VKD3D_SHADER_CONDITIONAL_OP_NZ, component_count, condition_id); @@ -9513,6 +9513,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, case VKD3DSIH_MOV: vkd3d_dxbc_compiler_emit_mov(compiler, instruction); break; + case VKD3DSIH_DMOVC: case VKD3DSIH_MOVC: vkd3d_dxbc_compiler_emit_movc(compiler, instruction); break; diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c index 2af3a769..830a5fc7 100644 --- a/libs/vkd3d-shader/trace.c +++ b/libs/vkd3d-shader/trace.c @@ -113,6 +113,7 @@ static const char * const shader_opcode_names[] = /* VKD3DSIH_DMAX */ "dmax", /* VKD3DSIH_DMIN */ "dmin", /* VKD3DSIH_DMOV */ "dmov", + /* VKD3DSIH_DMOVC */ "dmovc", /* VKD3DSIH_DMUL */ "dmul", /* VKD3DSIH_DNE */ "dne", /* VKD3DSIH_DP2 */ "dp2", diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 94daa08f..9948045e 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -202,6 +202,7 @@ enum vkd3d_shader_opcode VKD3DSIH_DMAX, VKD3DSIH_DMIN, VKD3DSIH_DMOV, + VKD3DSIH_DMOVC, VKD3DSIH_DMUL, VKD3DSIH_DNE, VKD3DSIH_DP2, diff --git a/tests/d3d12.c b/tests/d3d12.c index b8d53424..ae1394b0 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -9984,8 +9984,8 @@ static void test_shader_instructions(void) {&ps_dmin_dmax, {.d = {{-1.0, 1.0}}}, {.d = {-1.0, 1.0}}, true}, {&ps_dfma, {.d = {{1.0000002433080226, 2.000000481493771}}}, {.d = {1.0000002433080226 * 2.000000481493771 + 1.0000002433080226}}, 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_dmovc, {.d = {{0.5, 0.0}}}, {.d = {4.5, 4.5}}, true}, + {&ps_dmovc, {.d = {{1.5, 0.0}}}, {.d = {1.5, 0.0}}, 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},
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com