wined3d: Handle SM4 breakc instruction modifiers.

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:
Józef Kucia 2016-05-25 10:51:21 +02:00 committed by Alexandre Julliard
parent 422bf938cd
commit 56b22347d2
3 changed files with 8 additions and 5 deletions

View File

@ -4207,10 +4207,11 @@ static void shader_glsl_breakc(const struct wined3d_shader_instruction *ins)
static void shader_glsl_breakp(const struct wined3d_shader_instruction *ins)
{
const char *condition = (ins->flags == WINED3D_SHADER_CONDITIONAL_OP_NZ) ? "bool" : "!bool";
struct glsl_src_param src_param;
shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_0, &src_param);
shader_addline(ins->ctx->buffer, "if (bool(%s)) break;\n", src_param.param_str);
shader_addline(ins->ctx->buffer, "if (%s(%s)) break;\n", condition, src_param.param_str);
}
static void shader_glsl_label(const struct wined3d_shader_instruction *ins)

View File

@ -2259,7 +2259,8 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
shader_addline(&buffer, "%s", shader_opcode_names[ins.handler_idx]);
if (ins.handler_idx == WINED3DSIH_IF)
if (ins.handler_idx == WINED3DSIH_BREAKP
|| ins.handler_idx == WINED3DSIH_IF)
{
switch (ins.flags)
{

View File

@ -381,7 +381,7 @@ static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr,
enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param);
static void shader_sm4_read_if(struct wined3d_shader_instruction *ins,
static void shader_sm4_read_conditional_op(struct wined3d_shader_instruction *ins,
DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count,
struct wined3d_sm4_data *priv)
{
@ -618,7 +618,8 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM4_OP_ADD, WINED3DSIH_ADD, "f", "ff"},
{WINED3D_SM4_OP_AND, WINED3DSIH_AND, "u", "uu"},
{WINED3D_SM4_OP_BREAK, WINED3DSIH_BREAK, "", ""},
{WINED3D_SM4_OP_BREAKC, WINED3DSIH_BREAKP, "", "u"},
{WINED3D_SM4_OP_BREAKC, WINED3DSIH_BREAKP, "", "u",
shader_sm4_read_conditional_op},
{WINED3D_SM4_OP_CUT, WINED3DSIH_CUT, "", ""},
{WINED3D_SM4_OP_DERIV_RTX, WINED3DSIH_DSX, "f", "f"},
{WINED3D_SM4_OP_DERIV_RTY, WINED3DSIH_DSY, "f", "f"},
@ -639,7 +640,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] =
{WINED3D_SM4_OP_GE, WINED3DSIH_GE, "u", "ff"},
{WINED3D_SM4_OP_IADD, WINED3DSIH_IADD, "i", "ii"},
{WINED3D_SM4_OP_IF, WINED3DSIH_IF, "", "u",
shader_sm4_read_if},
shader_sm4_read_conditional_op},
{WINED3D_SM4_OP_IEQ, WINED3DSIH_IEQ, "u", "ii"},
{WINED3D_SM4_OP_IGE, WINED3DSIH_IGE, "u", "ii"},
{WINED3D_SM4_OP_ILT, WINED3DSIH_ILT, "u", "ii"},