Commit ba60b0f5 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Implement SM4 switch instruction.

parent 25dfbbaf
......@@ -5345,6 +5345,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_SQRT */ NULL,
/* WINED3DSIH_STORE_UAV_TYPED */ NULL,
/* WINED3DSIH_SUB */ shader_hw_map2gl,
/* WINED3DSIH_SWITCH */ NULL,
/* WINED3DSIH_TEX */ pshader_hw_tex,
/* WINED3DSIH_TEXBEM */ pshader_hw_texbem,
/* WINED3DSIH_TEXBEML */ pshader_hw_texbem,
......
......@@ -4228,6 +4228,14 @@ static void shader_glsl_rep(const struct wined3d_shader_instruction *ins)
++loop_state->current_depth;
}
static void shader_glsl_switch(const struct wined3d_shader_instruction *ins)
{
struct glsl_src_param src0_param;
shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_0, &src0_param);
shader_addline(ins->ctx->buffer, "switch (%s)\n{\n", src0_param.param_str);
}
static void shader_glsl_if(const struct wined3d_shader_instruction *ins)
{
const char *condition = (ins->flags == WINED3D_SHADER_CONDITIONAL_OP_NZ) ? "bool" : "!bool";
......@@ -8658,6 +8666,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB
/* WINED3DSIH_SQRT */ shader_glsl_map2gl,
/* WINED3DSIH_STORE_UAV_TYPED */ NULL,
/* WINED3DSIH_SUB */ shader_glsl_binop,
/* WINED3DSIH_SWITCH */ shader_glsl_switch,
/* WINED3DSIH_TEX */ shader_glsl_tex,
/* WINED3DSIH_TEXBEM */ shader_glsl_texbem,
/* WINED3DSIH_TEXBEML */ shader_glsl_texbem,
......
......@@ -177,6 +177,7 @@ static const char * const shader_opcode_names[] =
/* WINED3DSIH_SQRT */ "sqrt",
/* WINED3DSIH_STORE_UAV_TYPED */ "store_uav_typed",
/* WINED3DSIH_SUB */ "sub",
/* WINED3DSIH_SWITCH */ "switch",
/* WINED3DSIH_TEX */ "texld",
/* WINED3DSIH_TEXBEM */ "texbem",
/* WINED3DSIH_TEXBEML */ "texbeml",
......
......@@ -172,6 +172,7 @@ enum wined3d_sm4_opcode
WINED3D_SM4_OP_SAMPLE_GRAD = 0x49,
WINED3D_SM4_OP_SAMPLE_B = 0x4a,
WINED3D_SM4_OP_SQRT = 0x4b,
WINED3D_SM4_OP_SWITCH = 0x4c,
WINED3D_SM4_OP_SINCOS = 0x4d,
WINED3D_SM4_OP_UDIV = 0x4e,
WINED3D_SM4_OP_ULT = 0x4f,
......@@ -685,6 +686,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM4_OP_SAMPLE_GRAD, WINED3DSIH_SAMPLE_GRAD, "u", "fRSff"},
{WINED3D_SM4_OP_SAMPLE_B, WINED3DSIH_SAMPLE_B, "u", "fRSf"},
{WINED3D_SM4_OP_SQRT, WINED3DSIH_SQRT, "f", "f"},
{WINED3D_SM4_OP_SWITCH, WINED3DSIH_SWITCH, "", "u"},
{WINED3D_SM4_OP_SINCOS, WINED3DSIH_SINCOS, "ff", "f"},
{WINED3D_SM4_OP_UDIV, WINED3DSIH_UDIV, "uu", "uu"},
{WINED3D_SM4_OP_ULT, WINED3DSIH_ULT, "u", "uu"},
......
......@@ -684,6 +684,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER
WINED3DSIH_SQRT,
WINED3DSIH_STORE_UAV_TYPED,
WINED3DSIH_SUB,
WINED3DSIH_SWITCH,
WINED3DSIH_TEX,
WINED3DSIH_TEXBEM,
WINED3DSIH_TEXBEML,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment