Commit 3082c1a9 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the WINED3DRENDERSTATETYPE typedef.

parent 5bddd442
......@@ -587,7 +587,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_Reset(IDirect3DDevice8 *iface,
hr = wined3d_device_reset(This->wined3d_device, &swapchain_desc, reset_enum_callback);
if (SUCCEEDED(hr))
{
hr = wined3d_device_set_render_state(This->wined3d_device, WINED3DRS_POINTSIZE_MIN, 0);
hr = wined3d_device_set_render_state(This->wined3d_device, WINED3D_RS_POINTSIZE_MIN, 0);
This->lost = FALSE;
}
else
......@@ -1439,7 +1439,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(IDirect3DDevice8 *ifac
switch (State)
{
case D3DRS_ZBIAS:
hr = wined3d_device_set_render_state(This->wined3d_device, WINED3DRS_DEPTHBIAS, Value);
hr = wined3d_device_set_render_state(This->wined3d_device, WINED3D_RS_DEPTHBIAS, Value);
break;
default:
......@@ -1462,7 +1462,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetRenderState(IDirect3DDevice8 *ifac
switch (State)
{
case D3DRS_ZBIAS:
hr = wined3d_device_get_render_state(This->wined3d_device, WINED3DRS_DEPTHBIAS, pValue);
hr = wined3d_device_get_render_state(This->wined3d_device, WINED3D_RS_DEPTHBIAS, pValue);
break;
default:
......@@ -3112,7 +3112,7 @@ HRESULT device_init(IDirect3DDevice8Impl *device, IDirect3D8Impl *parent, struct
return hr;
}
hr = wined3d_device_set_render_state(device->wined3d_device, WINED3DRS_POINTSIZE_MIN, 0);
hr = wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_POINTSIZE_MIN, 0);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -2456,7 +2456,7 @@ static HRESULT IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
break;
case D3DRENDERSTATE_ZBIAS:
hr = wined3d_device_get_render_state(This->wined3d_device, WINED3DRS_DEPTHBIAS, Value);
hr = wined3d_device_get_render_state(This->wined3d_device, WINED3D_RS_DEPTHBIAS, Value);
break;
default:
......@@ -2765,7 +2765,7 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
break;
case D3DRENDERSTATE_ZBIAS:
hr = wined3d_device_set_render_state(This->wined3d_device, WINED3DRS_DEPTHBIAS, Value);
hr = wined3d_device_set_render_state(This->wined3d_device, WINED3D_RS_DEPTHBIAS, Value);
break;
default:
......@@ -6972,7 +6972,7 @@ HRESULT d3d_device_init(IDirect3DDeviceImpl *device, IDirectDrawImpl *ddraw, IDi
ddraw->d3ddevice = device;
wined3d_device_set_render_state(ddraw->wined3d_device, WINED3DRS_ZENABLE,
wined3d_device_set_render_state(ddraw->wined3d_device, WINED3D_RS_ZENABLE,
IDirect3DDeviceImpl_UpdateDepthStencil(device));
return D3D_OK;
......
......@@ -156,7 +156,7 @@ HRESULT d3d_execute_buffer_execute(IDirect3DExecuteBufferImpl *This,
/* IDirect3DDevices have color keying always enabled -
* enable it before drawing. This overwrites any ALPHA*
* render state. */
wined3d_device_set_render_state(lpDevice->wined3d_device, WINED3DRS_COLORKEYENABLE, 1);
wined3d_device_set_render_state(lpDevice->wined3d_device, WINED3D_RS_COLORKEYENABLE, 1);
IDirect3DDevice7_DrawIndexedPrimitive(&lpDevice->IDirect3DDevice7_iface,
D3DPT_TRIANGLELIST, D3DFVF_TLVERTEX, tl_vx, 0, This->indices, count * 3, 0);
} break;
......
......@@ -335,9 +335,9 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexB
* the vertex ops
*/
doClip = VertexOp & D3DVOP_CLIP ? TRUE : FALSE;
wined3d_device_get_render_state(device_impl->wined3d_device, WINED3DRS_CLIPPING, (DWORD *)&oldClip);
wined3d_device_get_render_state(device_impl->wined3d_device, WINED3D_RS_CLIPPING, (DWORD *)&oldClip);
if (doClip != oldClip)
wined3d_device_set_render_state(device_impl->wined3d_device, WINED3DRS_CLIPPING, doClip);
wined3d_device_set_render_state(device_impl->wined3d_device, WINED3D_RS_CLIPPING, doClip);
wined3d_device_set_stream_source(device_impl->wined3d_device,
0, Src->wineD3DVertexBuffer, 0, get_flexible_vertex_size(Src->fvf));
......@@ -347,7 +347,7 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexB
/* Restore the states if needed */
if (doClip != oldClip)
wined3d_device_set_render_state(device_impl->wined3d_device, WINED3DRS_CLIPPING, oldClip);
wined3d_device_set_render_state(device_impl->wined3d_device, WINED3D_RS_CLIPPING, oldClip);
wined3d_mutex_unlock();
......
......@@ -867,8 +867,8 @@ static void state_texfactor_atifs(struct wined3d_context *context, const struct
{
const struct wined3d_gl_info *gl_info = context->gl_info;
float col[4];
D3DCOLORTOGLFLOAT4(state->render_states[WINED3DRS_TEXTUREFACTOR], col);
D3DCOLORTOGLFLOAT4(state->render_states[WINED3D_RS_TEXTUREFACTOR], col);
GL_EXTCALL(glSetFragmentShaderConstantATI(ATI_FFP_CONST_TFACTOR, col));
checkGLcall("glSetFragmentShaderConstantATI(ATI_FFP_CONST_TFACTOR, col)");
}
......@@ -934,20 +934,20 @@ static void atifs_apply_pixelshader(struct wined3d_context *context, const struc
static void atifs_srgbwriteenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
if (state->render_states[WINED3DRS_SRGBWRITEENABLE])
if (state->render_states[WINED3D_RS_SRGBWRITEENABLE])
WARN("sRGB writes are not supported by this fragment pipe.\n");
}
static const struct StateEntryTemplate atifs_fragmentstate_template[] = {
{STATE_RENDER(WINED3DRS_TEXTUREFACTOR), { STATE_RENDER(WINED3DRS_TEXTUREFACTOR), state_texfactor_atifs }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3DRS_FOGCOLOR), { STATE_RENDER(WINED3DRS_FOGCOLOR), state_fogcolor }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3DRS_FOGDENSITY), { STATE_RENDER(WINED3DRS_FOGDENSITY), state_fogdensity }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3DRS_FOGENABLE), { STATE_RENDER(WINED3DRS_FOGENABLE), state_fog_fragpart }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3DRS_FOGTABLEMODE), { STATE_RENDER(WINED3DRS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3DRS_FOGVERTEXMODE), { STATE_RENDER(WINED3DRS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3DRS_FOGSTART), { STATE_RENDER(WINED3DRS_FOGSTART), state_fogstartend }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3DRS_FOGEND), { STATE_RENDER(WINED3DRS_FOGSTART), NULL }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3DRS_SRGBWRITEENABLE), { STATE_RENDER(WINED3DRS_SRGBWRITEENABLE), atifs_srgbwriteenable }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), { STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), state_texfactor_atifs }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3D_RS_FOGCOLOR), { STATE_RENDER(WINED3D_RS_FOGCOLOR), state_fogcolor }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3D_RS_FOGDENSITY), { STATE_RENDER(WINED3D_RS_FOGDENSITY), state_fogdensity }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3D_RS_FOGENABLE), { STATE_RENDER(WINED3D_RS_FOGENABLE), state_fog_fragpart }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3D_RS_FOGTABLEMODE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3D_RS_FOGVERTEXMODE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3D_RS_FOGSTART), { STATE_RENDER(WINED3D_RS_FOGSTART), state_fogstartend }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3D_RS_FOGEND), { STATE_RENDER(WINED3D_RS_FOGSTART), NULL }, WINED3D_GL_EXT_NONE },
{STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE), { STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE), atifs_srgbwriteenable }, WINED3D_GL_EXT_NONE },
{STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), { STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), set_tex_op_atifs }, WINED3D_GL_EXT_NONE },
{STATE_TEXTURESTAGE(0, WINED3DTSS_COLORARG1), { STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), NULL }, WINED3D_GL_EXT_NONE },
{STATE_TEXTURESTAGE(0, WINED3DTSS_COLORARG2), { STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), NULL }, WINED3D_GL_EXT_NONE },
......
......@@ -1780,44 +1780,44 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
/* Other misc states */
glDisable(GL_ALPHA_TEST);
checkGLcall("glDisable(GL_ALPHA_TEST)");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_ALPHATESTENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ALPHATESTENABLE));
glDisable(GL_LIGHTING);
checkGLcall("glDisable GL_LIGHTING");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_LIGHTING));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_LIGHTING));
glDisable(GL_DEPTH_TEST);
checkGLcall("glDisable GL_DEPTH_TEST");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_ZENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ZENABLE));
glDisableWINE(GL_FOG);
checkGLcall("glDisable GL_FOG");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_FOGENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_FOGENABLE));
glDisable(GL_BLEND);
checkGLcall("glDisable GL_BLEND");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_ALPHABLENDENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE));
glDisable(GL_CULL_FACE);
checkGLcall("glDisable GL_CULL_FACE");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_CULLMODE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_CULLMODE));
glDisable(GL_STENCIL_TEST);
checkGLcall("glDisable GL_STENCIL_TEST");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_STENCILENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_STENCILENABLE));
glDisable(GL_SCISSOR_TEST);
checkGLcall("glDisable GL_SCISSOR_TEST");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
if (gl_info->supported[ARB_POINT_SPRITE])
{
glDisable(GL_POINT_SPRITE_ARB);
checkGLcall("glDisable GL_POINT_SPRITE_ARB");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_POINTSPRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE));
}
glColorMask(GL_TRUE, GL_TRUE,GL_TRUE,GL_TRUE);
checkGLcall("glColorMask");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE3));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
if (gl_info->supported[EXT_SECONDARY_COLOR])
{
glDisable(GL_COLOR_SUM_EXT);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_SPECULARENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SPECULARENABLE));
checkGLcall("glDisable(GL_COLOR_SUM_EXT)");
}
......@@ -1837,7 +1837,7 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
glDisable(GL_CLIP_PLANE3); checkGLcall("glDisable(clip plane 3)");
glDisable(GL_CLIP_PLANE4); checkGLcall("glDisable(clip plane 4)");
glDisable(GL_CLIP_PLANE5); checkGLcall("glDisable(clip plane 5)");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_CLIPPING));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_CLIPPING));
set_blit_dimension(width, height);
device->frag_pipe->enable_extension(FALSE);
......@@ -2206,8 +2206,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
checkGLcall("glEnable GL_SCISSOR_TEST");
LEAVE_GL();
context_invalidate_state(context, STATE_RENDER(WINED3DRS_ALPHABLENDENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
context_invalidate_state(context, STATE_SCISSORRECT);
return TRUE;
......@@ -2351,7 +2351,7 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
* the alpha blend state changes with different render target formats. */
if (!context->current_rt)
{
context_invalidate_state(context, STATE_RENDER(WINED3DRS_ALPHABLENDENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE));
}
else
{
......@@ -2363,11 +2363,11 @@ static void context_setup_target(struct wined3d_context *context, struct wined3d
/* Disable blending when the alpha mask has changed and when a format doesn't support blending. */
if ((old->alpha_mask && !new->alpha_mask) || (!old->alpha_mask && new->alpha_mask)
|| !(new->flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING))
context_invalidate_state(context, STATE_RENDER(WINED3DRS_ALPHABLENDENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE));
/* Update sRGB writing when switching between formats that do/do not support sRGB writing */
if ((old->flags & WINED3DFMT_FLAG_SRGB_WRITE) != (new->flags & WINED3DFMT_FLAG_SRGB_WRITE))
context_invalidate_state(context, STATE_RENDER(WINED3DRS_SRGBWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE));
}
/* When switching away from an offscreen render target, and we're not
......
......@@ -718,10 +718,10 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
if (context->gl_info->supported[EXT_STENCIL_TWO_SIDE])
{
glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_TWOSIDEDSTENCILMODE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_TWOSIDEDSTENCILMODE));
}
glStencilMask(~0U);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_STENCILWRITEMASK));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_STENCILWRITEMASK));
glClearStencil(stencil);
checkGLcall("glClearStencil");
clear_mask = clear_mask | GL_STENCIL_BUFFER_BIT;
......@@ -732,7 +732,7 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
surface_modify_location(fb->depth_stencil, fb->depth_stencil->draw_binding, TRUE);
glDepthMask(GL_TRUE);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_ZWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ZWRITEENABLE));
glClearDepth(depth);
checkGLcall("glClearDepth");
clear_mask = clear_mask | GL_DEPTH_BUFFER_BIT;
......@@ -749,10 +749,10 @@ HRESULT device_clear_render_targets(struct wined3d_device *device, UINT rt_count
}
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE3));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
glClearColor(color->r, color->g, color->b, color->a);
checkGLcall("glClearColor");
clear_mask = clear_mask | GL_COLOR_BUFFER_BIT;
......@@ -2419,7 +2419,7 @@ HRESULT CDECL wined3d_device_get_viewport(const struct wined3d_device *device, s
}
HRESULT CDECL wined3d_device_set_render_state(struct wined3d_device *device,
WINED3DRENDERSTATETYPE state, DWORD value)
enum wined3d_render_state state, DWORD value)
{
DWORD old_value = device->stateBlock->state.render_states[state];
......@@ -2445,7 +2445,7 @@ HRESULT CDECL wined3d_device_set_render_state(struct wined3d_device *device,
}
HRESULT CDECL wined3d_device_get_render_state(const struct wined3d_device *device,
WINED3DRENDERSTATETYPE state, DWORD *value)
enum wined3d_render_state state, DWORD *value)
{
TRACE("device %p, state %s (%#x), value %p.\n", device, debug_d3drenderstate(state), state, value);
......@@ -3227,7 +3227,7 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
dest_conv = dest_conv_addr;
}
if (device->stateBlock->state.render_states[WINED3DRS_CLIPPING])
if (device->stateBlock->state.render_states[WINED3D_RS_CLIPPING])
{
static BOOL warned = FALSE;
/*
......@@ -4497,8 +4497,8 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device
}
}
if (state->render_states[WINED3DRS_ZENABLE] || state->render_states[WINED3DRS_ZWRITEENABLE] ||
state->render_states[WINED3DRS_STENCILENABLE])
if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE]
|| state->render_states[WINED3D_RS_STENCILENABLE])
{
struct wined3d_surface *ds = device->fb.depth_stencil;
struct wined3d_surface *target = device->fb.render_targets[0];
......@@ -4949,14 +4949,14 @@ HRESULT CDECL wined3d_device_set_depth_stencil(struct wined3d_device *device, st
if (!prev != !depth_stencil)
{
/* Swapping NULL / non NULL depth stencil affects the depth and tests */
device_invalidate_state(device, STATE_RENDER(WINED3DRS_ZENABLE));
device_invalidate_state(device, STATE_RENDER(WINED3DRS_STENCILENABLE));
device_invalidate_state(device, STATE_RENDER(WINED3DRS_STENCILWRITEMASK));
device_invalidate_state(device, STATE_RENDER(WINED3DRS_DEPTHBIAS));
device_invalidate_state(device, STATE_RENDER(WINED3D_RS_ZENABLE));
device_invalidate_state(device, STATE_RENDER(WINED3D_RS_STENCILENABLE));
device_invalidate_state(device, STATE_RENDER(WINED3D_RS_STENCILWRITEMASK));
device_invalidate_state(device, STATE_RENDER(WINED3D_RS_DEPTHBIAS));
}
else if (prev && prev->resource.format->depth_size != depth_stencil->resource.format->depth_size)
{
device_invalidate_state(device, STATE_RENDER(WINED3DRS_DEPTHBIAS));
device_invalidate_state(device, STATE_RENDER(WINED3D_RS_DEPTHBIAS));
}
if (prev)
wined3d_surface_decref(prev);
......
......@@ -143,10 +143,10 @@ static void drawStridedSlow(const struct wined3d_device *device, const struct wi
specular = element->data.addr;
/* special case where the fog density is stored in the specular alpha channel */
if (state->render_states[WINED3DRS_FOGENABLE]
&& (state->render_states[WINED3DRS_FOGVERTEXMODE] == WINED3DFOG_NONE
if (state->render_states[WINED3D_RS_FOGENABLE]
&& (state->render_states[WINED3D_RS_FOGVERTEXMODE] == WINED3DFOG_NONE
|| si->elements[WINED3D_FFP_POSITION].format->id == WINED3DFMT_R32G32B32A32_FLOAT)
&& state->render_states[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE)
&& state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3DFOG_NONE)
{
if (gl_info->supported[EXT_FOG_COORD])
{
......@@ -583,7 +583,7 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
if (!index_count) return;
if (state->render_states[WINED3DRS_COLORWRITEENABLE])
if (state->render_states[WINED3D_RS_COLORWRITEENABLE])
{
/* Invalidate the back buffer memory so LockRect will read it the next time */
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
......@@ -616,7 +616,7 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
* depthstencil for D3DCMP_NEVER and D3DCMP_ALWAYS as well. Also note
* that we never copy the stencil data.*/
DWORD location = context->render_offscreen ? SFLAG_DS_OFFSCREEN : SFLAG_DS_ONSCREEN;
if (state->render_states[WINED3DRS_ZWRITEENABLE] || state->render_states[WINED3DRS_ZENABLE])
if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
{
struct wined3d_surface *ds = device->fb.depth_stencil;
RECT current_rect, draw_rect, r;
......@@ -635,7 +635,7 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
if (!EqualRect(&r, &draw_rect))
surface_load_ds_location(ds, context, location);
if (state->render_states[WINED3DRS_ZWRITEENABLE])
if (state->render_states[WINED3D_RS_ZWRITEENABLE])
{
surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy);
surface_modify_location(ds, ds->draw_binding, TRUE);
......@@ -653,7 +653,7 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
if ((!context->gl_info->supported[WINED3D_GL_VERSION_2_0]
|| (!glPointParameteri && !context->gl_info->supported[NV_POINT_SPRITE]))
&& context->render_offscreen
&& state->render_states[WINED3DRS_POINTSPRITEENABLE]
&& state->render_states[WINED3D_RS_POINTSPRITEENABLE]
&& state->gl_primitive_type == GL_POINTS)
{
FIXME("Point sprite coordinate origin switching not supported.\n");
......@@ -671,7 +671,7 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
if (!use_vs(state))
{
if (!stream_info->position_transformed && context->num_untracked_materials
&& state->render_states[WINED3DRS_LIGHTING])
&& state->render_states[WINED3D_RS_LIGHTING])
{
static BOOL warned;
if (!warned) {
......@@ -682,7 +682,7 @@ void drawPrimitive(struct wined3d_device *device, UINT index_count, UINT StartId
}
emulation = TRUE;
}
else if (context->fog_coord && state->render_states[WINED3DRS_FOGENABLE])
else if (context->fog_coord && state->render_states[WINED3D_RS_FOGENABLE])
{
/* Either write a pipeline replacement shader or convert the specular alpha from unsigned byte
* to a float in the vertex buffer
......@@ -875,7 +875,7 @@ HRESULT tesselate_rectpatch(struct wined3d_device *This, struct WineD3DRectPatch
*/
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
checkGLcall("glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_FILLMODE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_FILLMODE));
if (patch->has_normals)
{
static const GLfloat black[] = {0.0f, 0.0f, 0.0f, 0.0f};
......@@ -887,7 +887,7 @@ HRESULT tesselate_rectpatch(struct wined3d_device *This, struct WineD3DRectPatch
checkGLcall("glEnable(GL_LIGHTING)");
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, black);
checkGLcall("glLightModel for MODEL_AMBIENT");
context_invalidate_state(context, STATE_RENDER(WINED3DRS_AMBIENT));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_AMBIENT));
for (i = 3; i < context->gl_info->limits.lights; ++i)
{
......@@ -919,7 +919,7 @@ HRESULT tesselate_rectpatch(struct wined3d_device *This, struct WineD3DRectPatch
checkGLcall("Setting up light 3");
context_invalidate_state(context, STATE_MATERIAL);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORVERTEX));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORVERTEX));
glDisable(GL_COLOR_MATERIAL);
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, black);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, black);
......
......@@ -612,7 +612,8 @@ static void nvrc_texfactor(struct wined3d_context *context, const struct wined3d
{
const struct wined3d_gl_info *gl_info = context->gl_info;
float col[4];
D3DCOLORTOGLFLOAT4(state->render_states[WINED3DRS_TEXTUREFACTOR], col);
D3DCOLORTOGLFLOAT4(state->render_states[WINED3D_RS_TEXTUREFACTOR], col);
GL_EXTCALL(glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, &col[0]));
}
......@@ -821,15 +822,15 @@ static const struct StateEntryTemplate nvrc_fragmentstate_template[] = {
{ STATE_TEXTURESTAGE(7, WINED3DTSS_ALPHAARG0), { STATE_TEXTURESTAGE(7, WINED3DTSS_ALPHAOP), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_TEXTURESTAGE(7, WINED3DTSS_RESULTARG), { STATE_TEXTURESTAGE(7, WINED3DTSS_COLOROP), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_PIXELSHADER, { STATE_PIXELSHADER, apply_pixelshader }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3DRS_SRGBWRITEENABLE), { STATE_PIXELSHADER, NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3DRS_TEXTUREFACTOR), { STATE_RENDER(WINED3DRS_TEXTUREFACTOR), nvrc_texfactor }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3DRS_FOGCOLOR), { STATE_RENDER(WINED3DRS_FOGCOLOR), state_fogcolor }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3DRS_FOGDENSITY), { STATE_RENDER(WINED3DRS_FOGDENSITY), state_fogdensity }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3DRS_FOGENABLE), { STATE_RENDER(WINED3DRS_FOGENABLE), state_fog_fragpart }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3DRS_FOGTABLEMODE), { STATE_RENDER(WINED3DRS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3DRS_FOGVERTEXMODE), { STATE_RENDER(WINED3DRS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3DRS_FOGSTART), { STATE_RENDER(WINED3DRS_FOGSTART), state_fogstartend }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3DRS_FOGEND), { STATE_RENDER(WINED3DRS_FOGSTART), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE), { STATE_PIXELSHADER, NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), { STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), nvrc_texfactor }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_FOGCOLOR), { STATE_RENDER(WINED3D_RS_FOGCOLOR), state_fogcolor }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_FOGDENSITY), { STATE_RENDER(WINED3D_RS_FOGDENSITY), state_fogdensity }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_FOGENABLE), { STATE_RENDER(WINED3D_RS_FOGENABLE), state_fog_fragpart }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_FOGTABLEMODE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_FOGVERTEXMODE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_FOGSTART), { STATE_RENDER(WINED3D_RS_FOGSTART), state_fogstartend }, WINED3D_GL_EXT_NONE },
{ STATE_RENDER(WINED3D_RS_FOGEND), { STATE_RENDER(WINED3D_RS_FOGSTART), NULL }, WINED3D_GL_EXT_NONE },
{ STATE_SAMPLER(0), { STATE_SAMPLER(0), nvts_texdim }, NV_TEXTURE_SHADER2 },
{ STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler_texdim }, WINED3D_GL_EXT_NONE },
{ STATE_SAMPLER(1), { STATE_SAMPLER(1), nvts_texdim }, NV_TEXTURE_SHADER2 },
......
......@@ -1709,10 +1709,10 @@ HRESULT CDECL wined3d_shader_set_local_constants_float(struct wined3d_shader *sh
void find_vs_compile_args(const struct wined3d_state *state,
const struct wined3d_shader *shader, struct vs_compile_args *args)
{
args->fog_src = state->render_states[WINED3DRS_FOGTABLEMODE]
args->fog_src = state->render_states[WINED3D_RS_FOGTABLEMODE]
== WINED3DFOG_NONE ? VS_FOG_COORD : VS_FOG_Z;
args->clip_enabled = state->render_states[WINED3DRS_CLIPPING]
&& state->render_states[WINED3DRS_CLIPPLANEENABLE];
args->clip_enabled = state->render_states[WINED3D_RS_CLIPPING]
&& state->render_states[WINED3D_RS_CLIPPLANEENABLE];
args->swizzle_map = shader->device->strided_streams.swizzle_map;
}
......@@ -1899,7 +1899,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
UINT i;
memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
if (state->render_states[WINED3DRS_SRGBWRITEENABLE])
if (state->render_states[WINED3D_RS_SRGBWRITEENABLE])
{
const struct wined3d_surface *rt = state->fb->render_targets[0];
if (rt->resource.format->flags & WINED3DFMT_FLAG_SRGB_WRITE) args->srgb_correction = 1;
......@@ -1976,9 +1976,9 @@ void find_ps_compile_args(const struct wined3d_state *state,
else
{
args->vp_mode = vertexshader;
if (state->render_states[WINED3DRS_FOGENABLE])
if (state->render_states[WINED3D_RS_FOGENABLE])
{
switch (state->render_states[WINED3DRS_FOGTABLEMODE])
switch (state->render_states[WINED3D_RS_FOGTABLEMODE])
{
case WINED3DFOG_NONE:
if (device->strided_streams.position_transformed || use_vs(state))
......@@ -1987,7 +1987,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
break;
}
switch (state->render_states[WINED3DRS_FOGVERTEXMODE])
switch (state->render_states[WINED3D_RS_FOGVERTEXMODE])
{
case WINED3DFOG_NONE: /* Fall through. */
case WINED3DFOG_LINEAR: args->fog = FOG_LINEAR; break;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1077,21 +1077,21 @@ static void wined3d_surface_depth_blt_fbo(const struct wined3d_device *device, s
if (gl_mask & GL_DEPTH_BUFFER_BIT)
{
glDepthMask(GL_TRUE);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_ZWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ZWRITEENABLE));
}
if (gl_mask & GL_STENCIL_BUFFER_BIT)
{
if (context->gl_info->supported[EXT_STENCIL_TWO_SIDE])
{
glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_TWOSIDEDSTENCILMODE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_TWOSIDEDSTENCILMODE));
}
glStencilMask(~0U);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_STENCILWRITEMASK));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_STENCILWRITEMASK));
}
glDisable(GL_SCISSOR_TEST);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
gl_info->fbo_ops.glBlitFramebuffer(src_rect->left, src_rect->top, src_rect->right, src_rect->bottom,
dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, gl_mask, GL_NEAREST);
......@@ -1206,13 +1206,13 @@ static void surface_blt_fbo(const struct wined3d_device *device, const WINED3DTE
context_invalidate_state(context, STATE_FRAMEBUFFER);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE3));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
glDisable(GL_SCISSOR_TEST);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
gl_info->fbo_ops.glBlitFramebuffer(src_rect.left, src_rect.top, src_rect.right, src_rect.bottom,
dst_rect.left, dst_rect.top, dst_rect.right, dst_rect.bottom, GL_COLOR_BUFFER_BIT, gl_filter);
......
......@@ -327,13 +327,13 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain,
context_invalidate_state(context, STATE_FRAMEBUFFER);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3DRS_COLORWRITEENABLE3));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3));
glDisable(GL_SCISSOR_TEST);
context_invalidate_state(context, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
/* Note that the texture is upside down */
gl_info->fbo_ops.glBlitFramebuffer(src_rect->left, src_rect->top, src_rect->right, src_rect->bottom,
......
......@@ -2475,7 +2475,7 @@ const char *debug_d3dusagequery(DWORD usagequery) DECLSPEC_HIDDEN;
const char *debug_d3ddeclmethod(WINED3DDECLMETHOD method) DECLSPEC_HIDDEN;
const char *debug_d3ddeclusage(BYTE usage) DECLSPEC_HIDDEN;
const char *debug_d3dprimitivetype(enum wined3d_primitive_type primitive_type) DECLSPEC_HIDDEN;
const char *debug_d3drenderstate(WINED3DRENDERSTATETYPE state) DECLSPEC_HIDDEN;
const char *debug_d3drenderstate(enum wined3d_render_state state) DECLSPEC_HIDDEN;
const char *debug_d3dsamplerstate(DWORD state) DECLSPEC_HIDDEN;
const char *debug_d3dstate(DWORD state) DECLSPEC_HIDDEN;
const char *debug_d3dtexturefiltertype(WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN;
......
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