mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 10:20:21 +00:00
wined3d: Set fixed_function_usage_map to 0 for an sm4 draw without a PS.
Fixes: 5b60f4649b
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56113
This commit is contained in:
parent
0900d919e2
commit
a79db19fdc
|
@ -3735,40 +3735,55 @@ static void context_invalidate_texture_stage(struct wined3d_context *context, DW
|
|||
context_invalidate_state(context, STATE_TEXTURESTAGE(stage, i));
|
||||
}
|
||||
|
||||
static bool use_ffp_ps(const struct wined3d_state *state)
|
||||
{
|
||||
struct wined3d_shader *vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
|
||||
|
||||
if (!use_vs(state))
|
||||
return true;
|
||||
if (vs && vs->reg_maps.shader_version.major >= 4)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void context_update_fixed_function_usage_map(struct wined3d_context *context,
|
||||
const struct wined3d_state *state)
|
||||
{
|
||||
UINT i, start, end;
|
||||
UINT i = 0, start, end;
|
||||
|
||||
context->fixed_function_usage_map = 0;
|
||||
for (i = 0; i < WINED3D_MAX_FFP_TEXTURES; ++i)
|
||||
|
||||
if (use_ffp_ps(state))
|
||||
{
|
||||
enum wined3d_texture_op color_op = state->texture_states[i][WINED3D_TSS_COLOR_OP];
|
||||
enum wined3d_texture_op alpha_op = state->texture_states[i][WINED3D_TSS_ALPHA_OP];
|
||||
DWORD color_arg1 = state->texture_states[i][WINED3D_TSS_COLOR_ARG1] & WINED3DTA_SELECTMASK;
|
||||
DWORD color_arg2 = state->texture_states[i][WINED3D_TSS_COLOR_ARG2] & WINED3DTA_SELECTMASK;
|
||||
DWORD color_arg3 = state->texture_states[i][WINED3D_TSS_COLOR_ARG0] & WINED3DTA_SELECTMASK;
|
||||
DWORD alpha_arg1 = state->texture_states[i][WINED3D_TSS_ALPHA_ARG1] & WINED3DTA_SELECTMASK;
|
||||
DWORD alpha_arg2 = state->texture_states[i][WINED3D_TSS_ALPHA_ARG2] & WINED3DTA_SELECTMASK;
|
||||
DWORD alpha_arg3 = state->texture_states[i][WINED3D_TSS_ALPHA_ARG0] & WINED3DTA_SELECTMASK;
|
||||
for (i = 0; i < WINED3D_MAX_FFP_TEXTURES; ++i)
|
||||
{
|
||||
enum wined3d_texture_op color_op = state->texture_states[i][WINED3D_TSS_COLOR_OP];
|
||||
enum wined3d_texture_op alpha_op = state->texture_states[i][WINED3D_TSS_ALPHA_OP];
|
||||
DWORD color_arg1 = state->texture_states[i][WINED3D_TSS_COLOR_ARG1] & WINED3DTA_SELECTMASK;
|
||||
DWORD color_arg2 = state->texture_states[i][WINED3D_TSS_COLOR_ARG2] & WINED3DTA_SELECTMASK;
|
||||
DWORD color_arg3 = state->texture_states[i][WINED3D_TSS_COLOR_ARG0] & WINED3DTA_SELECTMASK;
|
||||
DWORD alpha_arg1 = state->texture_states[i][WINED3D_TSS_ALPHA_ARG1] & WINED3DTA_SELECTMASK;
|
||||
DWORD alpha_arg2 = state->texture_states[i][WINED3D_TSS_ALPHA_ARG2] & WINED3DTA_SELECTMASK;
|
||||
DWORD alpha_arg3 = state->texture_states[i][WINED3D_TSS_ALPHA_ARG0] & WINED3DTA_SELECTMASK;
|
||||
|
||||
/* Not used, and disable higher stages. */
|
||||
if (color_op == WINED3D_TOP_DISABLE)
|
||||
break;
|
||||
/* Not used, and disable higher stages. */
|
||||
if (color_op == WINED3D_TOP_DISABLE)
|
||||
break;
|
||||
|
||||
if (((color_arg1 == WINED3DTA_TEXTURE) && color_op != WINED3D_TOP_SELECT_ARG2)
|
||||
|| ((color_arg2 == WINED3DTA_TEXTURE) && color_op != WINED3D_TOP_SELECT_ARG1)
|
||||
|| ((color_arg3 == WINED3DTA_TEXTURE)
|
||||
&& (color_op == WINED3D_TOP_MULTIPLY_ADD || color_op == WINED3D_TOP_LERP))
|
||||
|| ((alpha_arg1 == WINED3DTA_TEXTURE) && alpha_op != WINED3D_TOP_SELECT_ARG2)
|
||||
|| ((alpha_arg2 == WINED3DTA_TEXTURE) && alpha_op != WINED3D_TOP_SELECT_ARG1)
|
||||
|| ((alpha_arg3 == WINED3DTA_TEXTURE)
|
||||
&& (alpha_op == WINED3D_TOP_MULTIPLY_ADD || alpha_op == WINED3D_TOP_LERP)))
|
||||
context->fixed_function_usage_map |= (1u << i);
|
||||
if (((color_arg1 == WINED3DTA_TEXTURE) && color_op != WINED3D_TOP_SELECT_ARG2)
|
||||
|| ((color_arg2 == WINED3DTA_TEXTURE) && color_op != WINED3D_TOP_SELECT_ARG1)
|
||||
|| ((color_arg3 == WINED3DTA_TEXTURE)
|
||||
&& (color_op == WINED3D_TOP_MULTIPLY_ADD || color_op == WINED3D_TOP_LERP))
|
||||
|| ((alpha_arg1 == WINED3DTA_TEXTURE) && alpha_op != WINED3D_TOP_SELECT_ARG2)
|
||||
|| ((alpha_arg2 == WINED3DTA_TEXTURE) && alpha_op != WINED3D_TOP_SELECT_ARG1)
|
||||
|| ((alpha_arg3 == WINED3DTA_TEXTURE)
|
||||
&& (alpha_op == WINED3D_TOP_MULTIPLY_ADD || alpha_op == WINED3D_TOP_LERP)))
|
||||
context->fixed_function_usage_map |= (1u << i);
|
||||
|
||||
if ((color_op == WINED3D_TOP_BUMPENVMAP || color_op == WINED3D_TOP_BUMPENVMAP_LUMINANCE)
|
||||
&& i < WINED3D_MAX_FFP_TEXTURES - 1)
|
||||
context->fixed_function_usage_map |= (1u << (i + 1));
|
||||
if ((color_op == WINED3D_TOP_BUMPENVMAP || color_op == WINED3D_TOP_BUMPENVMAP_LUMINANCE)
|
||||
&& i < WINED3D_MAX_FFP_TEXTURES - 1)
|
||||
context->fixed_function_usage_map |= (1u << (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
if (i < context->lowest_disabled_stage)
|
||||
|
|
Loading…
Reference in a new issue