wined3d: Recognize the SM4 discard opcode.

This commit is contained in:
Henri Verbeet 2014-05-20 07:38:45 +02:00 committed by Alexandre Julliard
parent 53d1bbf041
commit c81d3b7336
2 changed files with 4 additions and 0 deletions

View File

@ -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 {

View File

@ -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"},