wined3d: Move the line antialias state to wined3d_rasterizer_state.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-03-06 22:18:36 -06:00 committed by Alexandre Julliard
parent a6009fa21f
commit 8ddf4e20a5
5 changed files with 9 additions and 8 deletions

View File

@ -937,7 +937,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
{
wined3d_device_set_rasterizer_state(device->wined3d_device, NULL);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, FALSE);
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ANTIALIASEDLINEENABLE, FALSE);
wined3d_mutex_unlock();
return;
}
@ -946,8 +945,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceCon
desc = &rasterizer_state_impl->desc;
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEANTIALIAS, desc->MultisampleEnable);
wined3d_device_set_render_state(device->wined3d_device,
WINED3D_RS_ANTIALIASEDLINEENABLE, desc->AntialiasedLineEnable);
wined3d_mutex_unlock();
}

View File

@ -1084,6 +1084,7 @@ static HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, str
wined3d_desc.scale_bias = desc->SlopeScaledDepthBias;
wined3d_desc.depth_clip = desc->DepthClipEnable;
wined3d_desc.scissor = desc->ScissorEnable;
wined3d_desc.line_antialias = desc->AntialiasedLineEnable;
/* We cannot fail after creating a wined3d_rasterizer_state object. It
* would lead to double free. */

View File

@ -3603,6 +3603,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
case WINED3D_RS_SLOPESCALEDEPTHBIAS:
case WINED3D_RS_DEPTHBIAS:
case WINED3D_RS_SCISSORTESTENABLE:
case WINED3D_RS_ANTIALIASEDLINEENABLE:
set_rasterizer_state = TRUE;
break;
@ -3633,6 +3634,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
desc.scale_bias = bias.f;
desc.depth_clip = TRUE;
desc.scissor = state->rs[WINED3D_RS_SCISSORTESTENABLE];
desc.line_antialias = state->rs[WINED3D_RS_ANTIALIASEDLINEENABLE];
if ((entry = wine_rb_get(&device->rasterizer_states, &desc)))
{

View File

@ -1707,9 +1707,9 @@ static void state_msaa(struct wined3d_context *context, const struct wined3d_sta
static void state_line_antialias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
const struct wined3d_rasterizer_state *r = state->rasterizer_state;
if (state->render_states[WINED3D_RS_EDGEANTIALIAS]
|| state->render_states[WINED3D_RS_ANTIALIASEDLINEENABLE])
if (state->render_states[WINED3D_RS_EDGEANTIALIAS] || (r && r->desc.line_antialias))
{
gl_info->gl_ops.gl.p_glEnable(GL_LINE_SMOOTH);
checkGLcall("glEnable(GL_LINE_SMOOTH)");
@ -4334,6 +4334,7 @@ static void rasterizer(struct wined3d_context *context, const struct wined3d_sta
cullmode(r, gl_info);
depth_clip(r, gl_info);
scissor(r, gl_info);
state_line_antialias(context, state, STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE));
}
static void rasterizer_cc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
@ -4351,6 +4352,7 @@ static void rasterizer_cc(struct wined3d_context *context, const struct wined3d_
cullmode(r, gl_info);
depth_clip(r, gl_info);
scissor(r, gl_info);
state_line_antialias(context, state, STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE));
}
static void psorigin_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
@ -4511,7 +4513,6 @@ const struct wined3d_state_entry_template misc_state_template[] =
{ STATE_RENDER(WINED3D_RS_DESTBLEND), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), state_blend }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), { STATE_RENDER(WINED3D_RS_EDGEANTIALIAS), state_line_antialias}, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE), { STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE), state_line_antialias}, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_SEPARATEALPHABLENDENABLE), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_SRCBLENDALPHA), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_DESTBLENDALPHA), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE },
@ -5431,8 +5432,7 @@ static void validate_state_table(struct wined3d_state_entry *state_table)
{ 61, 127},
{149, 150},
{169, 169},
{174, 175},
{177, 177},
{174, 177},
{193, 193},
{195, 197},
{ 0, 0},

View File

@ -2041,6 +2041,7 @@ struct wined3d_rasterizer_state_desc
float scale_bias;
BOOL depth_clip;
BOOL scissor;
BOOL line_antialias;
};
struct wined3d_sampler_desc