forked from Mirrors/wine-wine
wined3d: Implement SM5 f16tof32 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>oldstable
parent
1ea53005e7
commit
b8fb617712
|
@ -5105,6 +5105,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
|
|||
/* WINED3DSIH_EQ */ NULL,
|
||||
/* WINED3DSIH_EXP */ shader_hw_scalar_op,
|
||||
/* WINED3DSIH_EXPP */ shader_hw_scalar_op,
|
||||
/* WINED3DSIH_F16TOF32 */ NULL,
|
||||
/* WINED3DSIH_FCALL */ NULL,
|
||||
/* WINED3DSIH_FRC */ shader_hw_map2gl,
|
||||
/* WINED3DSIH_FTOI */ NULL,
|
||||
|
|
|
@ -3764,6 +3764,28 @@ 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)
|
||||
{
|
||||
struct wined3d_shader_dst_param dst;
|
||||
struct glsl_src_param src;
|
||||
DWORD write_mask;
|
||||
unsigned int i;
|
||||
|
||||
dst = ins->dst[0];
|
||||
for (i = 0; i < 4; ++i)
|
||||
{
|
||||
write_mask = WINED3DSP_WRITEMASK_0 << i;
|
||||
dst.write_mask = ins->dst[0].write_mask & write_mask;
|
||||
|
||||
if (!(write_mask = shader_glsl_append_dst_ext(ins->ctx->buffer, ins,
|
||||
&dst, dst.reg.data_type)))
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
static void shader_glsl_nop(const struct wined3d_shader_instruction *ins) {}
|
||||
|
||||
static void shader_glsl_nrm(const struct wined3d_shader_instruction *ins)
|
||||
|
@ -8891,6 +8913,7 @@ 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_FCALL */ NULL,
|
||||
/* WINED3DSIH_FRC */ shader_glsl_map2gl,
|
||||
/* WINED3DSIH_FTOI */ shader_glsl_to_int,
|
||||
|
|
|
@ -130,6 +130,7 @@ static const char * const shader_opcode_names[] =
|
|||
/* WINED3DSIH_EQ */ "eq",
|
||||
/* WINED3DSIH_EXP */ "exp",
|
||||
/* WINED3DSIH_EXPP */ "expp",
|
||||
/* WINED3DSIH_F16TOF32 */ "f16tof32",
|
||||
/* 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_F16TOF32 = 0x83,
|
||||
WINED3D_SM5_OP_UBFE = 0x8a,
|
||||
WINED3D_SM5_OP_BFI = 0x8c,
|
||||
WINED3D_SM5_OP_BFREV = 0x8d,
|
||||
|
@ -922,6 +923,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_F16TOF32, WINED3DSIH_F16TOF32, "f", "u"},
|
||||
{WINED3D_SM5_OP_UBFE, WINED3DSIH_UBFE, "u", "iiu"},
|
||||
{WINED3D_SM5_OP_BFI, WINED3DSIH_BFI, "u", "iiuu"},
|
||||
{WINED3D_SM5_OP_BFREV, WINED3DSIH_BFREV, "u", "u"},
|
||||
|
|
|
@ -660,6 +660,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
|
|||
WINED3DSIH_EQ,
|
||||
WINED3DSIH_EXP,
|
||||
WINED3DSIH_EXPP,
|
||||
WINED3DSIH_F16TOF32,
|
||||
WINED3DSIH_FCALL,
|
||||
WINED3DSIH_FRC,
|
||||
WINED3DSIH_FTOI,
|
||||
|
|
Loading…
Reference in New Issue