vkd3d-shader: Implement FTOD 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-12 12:55:11 +10:00 committed by Alexandre Julliard
parent 6e3bdb17dc
commit 821389d274
6 changed files with 7 additions and 1 deletions

View File

@ -807,6 +807,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] =
{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_FTOD, VKD3DSIH_FTOD, "d", "f"},
{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, "", "",

View File

@ -327,6 +327,7 @@ enum vkd3d_sm4_opcode
VKD3D_SM5_OP_DNE = 0xc6,
VKD3D_SM5_OP_DMOV = 0xc7,
VKD3D_SM5_OP_DMOVC = 0xc8,
VKD3D_SM5_OP_FTOD = 0xca,
VKD3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc,
VKD3D_SM5_OP_EVAL_CENTROID = 0xcd,
VKD3D_SM5_OP_DCL_GS_INSTANCES = 0xce,

View File

@ -6776,6 +6776,7 @@ static SpvOp vkd3d_dxbc_compiler_map_alu_instruction(const struct vkd3d_shader_i
{VKD3DSIH_DDIV, SpvOpFDiv},
{VKD3DSIH_DIV, SpvOpFDiv},
{VKD3DSIH_DMUL, SpvOpFMul},
{VKD3DSIH_FTOD, SpvOpFConvert},
{VKD3DSIH_FTOI, SpvOpConvertFToS},
{VKD3DSIH_FTOU, SpvOpConvertFToU},
{VKD3DSIH_IADD, SpvOpIAdd},
@ -9528,6 +9529,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler,
case VKD3DSIH_DDIV:
case VKD3DSIH_DIV:
case VKD3DSIH_DMUL:
case VKD3DSIH_FTOD:
case VKD3DSIH_FTOI:
case VKD3DSIH_FTOU:
case VKD3DSIH_IADD:

View File

@ -147,6 +147,7 @@ static const char * const shader_opcode_names[] =
/* VKD3DSIH_FIRSTBIT_LO */ "firstbit_lo",
/* VKD3DSIH_FIRSTBIT_SHI */ "firstbit_shi",
/* VKD3DSIH_FRC */ "frc",
/* VKD3DSIH_FTOD */ "ftod",
/* VKD3DSIH_FTOI */ "ftoi",
/* VKD3DSIH_FTOU */ "ftou",
/* VKD3DSIH_GATHER4 */ "gather4",

View File

@ -236,6 +236,7 @@ enum vkd3d_shader_opcode
VKD3DSIH_FIRSTBIT_LO,
VKD3DSIH_FIRSTBIT_SHI,
VKD3DSIH_FRC,
VKD3DSIH_FTOD,
VKD3DSIH_FTOI,
VKD3DSIH_FTOU,
VKD3DSIH_GATHER4,

View File

@ -10032,7 +10032,7 @@ static void test_shader_instructions(void)
{&ps_dtof, {.d = {{ 1.5}}}, {.f = {1.5f, -1.5f}}, true, true},
{&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_ftod, {.f = {{-2.5f, -2.5f}}}, {.d = {-2.5, 2.5}}, 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},
{&ps_ddiv, {.d = {{ 2.0, -4.0}}}, {.d = {-0.5, -2.0}}, true},