vkd3d-shader: Implement DMIN instruction.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy 2021-08-10 01:12:29 +10:00 committed by Alexandre Julliard
parent 44a3ebb77c
commit 74a9a0b167
6 changed files with 7 additions and 1 deletions

View File

@ -799,6 +799,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] =
shader_sm5_read_sync},
{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_DEQ, VKD3DSIH_DEQ, "u", "dd"},
{VKD3D_SM5_OP_DGE, VKD3DSIH_DGE, "u", "dd"},
{VKD3D_SM5_OP_DLT, VKD3DSIH_DLT, "u", "dd"},

View File

@ -319,6 +319,7 @@ enum vkd3d_sm4_opcode
VKD3D_SM5_OP_SYNC = 0xbe,
VKD3D_SM5_OP_DADD = 0xbf,
VKD3D_SM5_OP_DMAX = 0xc0,
VKD3D_SM5_OP_DMIN = 0xc1,
VKD3D_SM5_OP_DEQ = 0xc3,
VKD3D_SM5_OP_DGE = 0xc4,
VKD3D_SM5_OP_DLT = 0xc5,

View File

@ -6844,6 +6844,7 @@ static enum GLSLstd450 vkd3d_dxbc_compiler_map_ext_glsl_instruction(
glsl_insts[] =
{
{VKD3DSIH_DMAX, GLSLstd450NMax},
{VKD3DSIH_DMIN, GLSLstd450NMin},
{VKD3DSIH_EXP, GLSLstd450Exp2},
{VKD3DSIH_FIRSTBIT_HI, GLSLstd450FindUMsb},
{VKD3DSIH_FIRSTBIT_LO, GLSLstd450FindILsb},
@ -9534,6 +9535,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler,
vkd3d_dxbc_compiler_emit_alu_instruction(compiler, instruction);
break;
case VKD3DSIH_DMAX:
case VKD3DSIH_DMIN:
case VKD3DSIH_EXP:
case VKD3DSIH_FIRSTBIT_HI:
case VKD3DSIH_FIRSTBIT_LO:

View File

@ -109,6 +109,7 @@ static const char * const shader_opcode_names[] =
/* VKD3DSIH_DIV */ "div",
/* VKD3DSIH_DLT */ "dlt",
/* VKD3DSIH_DMAX */ "dmax",
/* VKD3DSIH_DMIN */ "dmin",
/* VKD3DSIH_DMOV */ "dmov",
/* VKD3DSIH_DNE */ "dne",
/* VKD3DSIH_DP2 */ "dp2",

View File

@ -198,6 +198,7 @@ enum vkd3d_shader_opcode
VKD3DSIH_DIV,
VKD3DSIH_DLT,
VKD3DSIH_DMAX,
VKD3DSIH_DMIN,
VKD3DSIH_DMOV,
VKD3DSIH_DNE,
VKD3DSIH_DP2,

View File

@ -9935,7 +9935,7 @@ static void test_shader_instructions(void)
{&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},
{&ps_dmin_dmax, {.d = {{-1.0, 1.0}}}, {.d = {-1.0, 1.0}}, true, true},
{&ps_dmin_dmax, {.d = {{-1.0, 1.0}}}, {.d = {-1.0, 1.0}}, 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},