wined3d: Implement SM5 f32tof16 instruction.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b8fb617712
commit
00ccd6fd99
|
@ -5106,6 +5106,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
|
|||
/* WINED3DSIH_EXP */ shader_hw_scalar_op,
|
||||
/* WINED3DSIH_EXPP */ shader_hw_scalar_op,
|
||||
/* WINED3DSIH_F16TOF32 */ NULL,
|
||||
/* WINED3DSIH_F32TOF16 */ NULL,
|
||||
/* WINED3DSIH_FCALL */ NULL,
|
||||
/* WINED3DSIH_FRC */ shader_hw_map2gl,
|
||||
/* WINED3DSIH_FTOI */ NULL,
|
||||
|
|
|
@ -3764,13 +3764,17 @@ static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins)
|
|||
shader_addline(buffer, "));\n");
|
||||
}
|
||||
|
||||
static void shader_glsl_f16tof32(const struct wined3d_shader_instruction *ins)
|
||||
static void shader_glsl_float16(const struct wined3d_shader_instruction *ins)
|
||||
{
|
||||
struct wined3d_shader_dst_param dst;
|
||||
struct glsl_src_param src;
|
||||
DWORD write_mask;
|
||||
const char *fmt;
|
||||
unsigned int i;
|
||||
|
||||
fmt = ins->handler_idx == WINED3DSIH_F16TOF32
|
||||
? "unpackHalf2x16(%s).x);\n" : "packHalf2x16(vec2(%s, 0.0)));\n";
|
||||
|
||||
dst = ins->dst[0];
|
||||
for (i = 0; i < 4; ++i)
|
||||
{
|
||||
|
@ -3782,7 +3786,7 @@ static void shader_glsl_f16tof32(const struct wined3d_shader_instruction *ins)
|
|||
continue;
|
||||
|
||||
shader_glsl_add_src_param(ins, &ins->src[0], write_mask, &src);
|
||||
shader_addline(ins->ctx->buffer, "unpackHalf2x16(%s).x);\n", src.param_str);
|
||||
shader_addline(ins->ctx->buffer, fmt, src.param_str);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8913,7 +8917,8 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
|
|||
/* WINED3DSIH_EQ */ shader_glsl_relop,
|
||||
/* WINED3DSIH_EXP */ shader_glsl_scalar_op,
|
||||
/* WINED3DSIH_EXPP */ shader_glsl_expp,
|
||||
/* WINED3DSIH_F16TOF32 */ shader_glsl_f16tof32,
|
||||
/* WINED3DSIH_F16TOF32 */ shader_glsl_float16,
|
||||
/* WINED3DSIH_F32TOF16 */ shader_glsl_float16,
|
||||
/* WINED3DSIH_FCALL */ NULL,
|
||||
/* WINED3DSIH_FRC */ shader_glsl_map2gl,
|
||||
/* WINED3DSIH_FTOI */ shader_glsl_to_int,
|
||||
|
|
|
@ -131,6 +131,7 @@ static const char * const shader_opcode_names[] =
|
|||
/* WINED3DSIH_EXP */ "exp",
|
||||
/* WINED3DSIH_EXPP */ "expp",
|
||||
/* WINED3DSIH_F16TOF32 */ "f16tof32",
|
||||
/* WINED3DSIH_F32TOF16 */ "f32tof16",
|
||||
/* WINED3DSIH_FCALL */ "fcall",
|
||||
/* WINED3DSIH_FRC */ "frc",
|
||||
/* WINED3DSIH_FTOI */ "ftoi",
|
||||
|
|
|
@ -231,6 +231,7 @@ enum wined3d_sm4_opcode
|
|||
WINED3D_SM5_OP_DERIV_RTY_FINE = 0x7d,
|
||||
WINED3D_SM5_OP_GATHER4_C = 0x7e,
|
||||
WINED3D_SM5_OP_RCP = 0x81,
|
||||
WINED3D_SM5_OP_F32TOF16 = 0x82,
|
||||
WINED3D_SM5_OP_F16TOF32 = 0x83,
|
||||
WINED3D_SM5_OP_UBFE = 0x8a,
|
||||
WINED3D_SM5_OP_BFI = 0x8c,
|
||||
|
@ -923,6 +924,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
|
|||
{WINED3D_SM5_OP_DERIV_RTY_FINE, WINED3DSIH_DSY_FINE, "f", "f"},
|
||||
{WINED3D_SM5_OP_GATHER4_C, WINED3DSIH_GATHER4_C, "f", "fRSf"},
|
||||
{WINED3D_SM5_OP_RCP, WINED3DSIH_RCP, "f", "f"},
|
||||
{WINED3D_SM5_OP_F32TOF16, WINED3DSIH_F32TOF16, "u", "f"},
|
||||
{WINED3D_SM5_OP_F16TOF32, WINED3DSIH_F16TOF32, "f", "u"},
|
||||
{WINED3D_SM5_OP_UBFE, WINED3DSIH_UBFE, "u", "iiu"},
|
||||
{WINED3D_SM5_OP_BFI, WINED3DSIH_BFI, "u", "iiuu"},
|
||||
|
|
|
@ -661,6 +661,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
|
|||
WINED3DSIH_EXP,
|
||||
WINED3DSIH_EXPP,
|
||||
WINED3DSIH_F16TOF32,
|
||||
WINED3DSIH_F32TOF16,
|
||||
WINED3DSIH_FCALL,
|
||||
WINED3DSIH_FRC,
|
||||
WINED3DSIH_FTOI,
|
||||
|
|
Loading…
Reference in New Issue