Commit c81d3b73 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Recognize the SM4 discard opcode.

parent 53d1bbf0
......@@ -4073,6 +4073,8 @@ static void shader_glsl_texkill(const struct wined3d_shader_instruction *ins)
shader_glsl_add_dst_param(ins, &ins->dst[0], &dst_param);
if (ins->ctx->reg_maps->shader_version.major >= 2)
{
if (ins->ctx->reg_maps->shader_version.major >= 4)
FIXME("SM4 discard not implemented.\n");
/* 2.0 shaders compare all 4 components in texkill */
shader_addline(ins->ctx->buffer, "if (any(lessThan(%s.xyzw, vec4(0.0)))) discard;\n", dst_param.reg_name);
} else {
......
......@@ -78,6 +78,7 @@ enum wined3d_sm4_opcode
WINED3D_SM4_OP_CUT = 0x09,
WINED3D_SM4_OP_DERIV_RTX = 0x0b,
WINED3D_SM4_OP_DERIV_RTY = 0x0c,
WINED3D_SM4_OP_DISCARD = 0x0d,
WINED3D_SM4_OP_DIV = 0x0e,
WINED3D_SM4_OP_DP3 = 0x10,
WINED3D_SM4_OP_DP4 = 0x11,
......@@ -212,6 +213,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM4_OP_CUT, WINED3DSIH_CUT, "", ""},
{WINED3D_SM4_OP_DERIV_RTX, WINED3DSIH_DSX, "F", "F"},
{WINED3D_SM4_OP_DERIV_RTY, WINED3DSIH_DSY, "F", "F"},
{WINED3D_SM4_OP_DISCARD, WINED3DSIH_TEXKILL, "", "U"},
{WINED3D_SM4_OP_DIV, WINED3DSIH_DIV, "F", "FF"},
{WINED3D_SM4_OP_DP3, WINED3DSIH_DP3, "F", "FF"},
{WINED3D_SM4_OP_DP4, WINED3DSIH_DP4, "F", "FF"},
......
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