From 3082c1a9de14e9c21c4f93331b6d595bbca00e34 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 19 Dec 2011 21:00:09 +0100 Subject: [PATCH] wined3d: Get rid of the WINED3DRENDERSTATETYPE typedef. --- dlls/d3d8/device.c | 8 +- dlls/ddraw/device.c | 6 +- dlls/ddraw/executebuffer.c | 2 +- dlls/ddraw/vertexbuffer.c | 6 +- dlls/wined3d/arb_program_shader.c | 53 +- dlls/wined3d/ati_fragment_shader.c | 22 +- dlls/wined3d/context.c | 40 +- dlls/wined3d/device.c | 34 +- dlls/wined3d/drawprim.c | 24 +- dlls/wined3d/nvidia_texture_shader.c | 21 +- dlls/wined3d/shader.c | 14 +- dlls/wined3d/state.c | 754 +++++++++++++-------------- dlls/wined3d/stateblock.c | 430 +++++++-------- dlls/wined3d/surface.c | 18 +- dlls/wined3d/swapchain.c | 10 +- dlls/wined3d/utils.c | 276 +++++----- dlls/wined3d/wined3d_private.h | 2 +- include/wine/wined3d.h | 263 +++++----- 18 files changed, 992 insertions(+), 991 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 923046ddc87..3fcc6b32903 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -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)) { diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 4dc0125d164..ed0d567df85 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -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; diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c index 097046d5888..58b84d683bf 100644 --- a/dlls/ddraw/executebuffer.c +++ b/dlls/ddraw/executebuffer.c @@ -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; diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c index 30398167caa..1991a8d9509 100644 --- a/dlls/ddraw/vertexbuffer.c +++ b/dlls/ddraw/vertexbuffer.c @@ -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(); diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 8b152d321b3..00998572d65 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4476,8 +4476,8 @@ static void find_arb_ps_compile_args(const struct wined3d_state *state, * duplicate the shader than have a no-op KIL instruction in every shader */ if (!device->vs_clipping && use_vs(state) - && state->render_states[WINED3DRS_CLIPPING] - && state->render_states[WINED3DRS_CLIPPLANEENABLE]) + && state->render_states[WINED3D_RS_CLIPPING] + && state->render_states[WINED3D_RS_CLIPPLANEENABLE]) args->clip = 1; else args->clip = 0; @@ -4538,8 +4538,8 @@ static void find_arb_vs_compile_args(const struct wined3d_state *state, if (args->clip.boolclip.clip_texcoord) { - if (state->render_states[WINED3DRS_CLIPPING]) - args->clip.boolclip.clipplane_mask = (unsigned char)state->render_states[WINED3DRS_CLIPPLANEENABLE]; + if (state->render_states[WINED3D_RS_CLIPPING]) + args->clip.boolclip.clipplane_mask = (unsigned char)state->render_states[WINED3D_RS_CLIPPLANEENABLE]; /* clipplane_mask was set to 0 by setting boolclip_compare to 0 */ } @@ -5673,7 +5673,7 @@ static void state_texfactor_arbfp(struct wined3d_context *context, priv->highest_dirty_ps_const = max(priv->highest_dirty_ps_const, ARB_FFP_CONST_TFACTOR + 1); } - D3DCOLORTOGLFLOAT4(state->render_states[WINED3DRS_TEXTUREFACTOR], col); + D3DCOLORTOGLFLOAT4(state->render_states[WINED3D_RS_TEXTUREFACTOR], col); GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_TFACTOR, col)); checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_TFACTOR, col)"); } @@ -5699,7 +5699,7 @@ static void state_arb_specularenable(struct wined3d_context *context, priv->highest_dirty_ps_const = max(priv->highest_dirty_ps_const, ARB_FFP_CONST_SPECULAR_ENABLE + 1); } - if (state->render_states[WINED3DRS_SPECULARENABLE]) + if (state->render_states[WINED3D_RS_SPECULARENABLE]) { /* The specular color has no alpha */ col[0] = 1.0f; col[1] = 1.0f; @@ -6301,7 +6301,7 @@ static void fragment_prog_arbfp(struct wined3d_context *context, const struct wi TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); - if (isStateDirty(context, STATE_RENDER(WINED3DRS_FOGENABLE))) + if (isStateDirty(context, STATE_RENDER(WINED3D_RS_FOGENABLE))) { if (!use_pshader && device->shader_backend == &arb_program_shader_backend && context->last_was_pshader) { @@ -6311,8 +6311,8 @@ static void fragment_prog_arbfp(struct wined3d_context *context, const struct wi { set_bumpmat_arbfp(context, state, STATE_TEXTURESTAGE(i, WINED3DTSS_BUMPENVMAT00)); } - state_texfactor_arbfp(context, state, STATE_RENDER(WINED3DRS_TEXTUREFACTOR)); - state_arb_specularenable(context, state, STATE_RENDER(WINED3DRS_SPECULARENABLE)); + state_texfactor_arbfp(context, state, STATE_RENDER(WINED3D_RS_TEXTUREFACTOR)); + state_arb_specularenable(context, state, STATE_RENDER(WINED3D_RS_SPECULARENABLE)); } else if (use_pshader && !isStateDirty(context, context->state_table[STATE_VSHADER].representative)) { @@ -6364,8 +6364,8 @@ static void fragment_prog_arbfp(struct wined3d_context *context, const struct wi { set_bumpmat_arbfp(context, state, STATE_TEXTURESTAGE(i, WINED3DTSS_BUMPENVMAT00)); } - state_texfactor_arbfp(context, state, STATE_RENDER(WINED3DRS_TEXTUREFACTOR)); - state_arb_specularenable(context, state, STATE_RENDER(WINED3DRS_SPECULARENABLE)); + state_texfactor_arbfp(context, state, STATE_RENDER(WINED3D_RS_TEXTUREFACTOR)); + state_arb_specularenable(context, state, STATE_RENDER(WINED3D_RS_SPECULARENABLE)); } context->last_was_pshader = FALSE; } else { @@ -6408,10 +6408,10 @@ static void state_arbfp_fog(struct wined3d_context *context, const struct wined3 if (!isStateDirty(context, STATE_PIXELSHADER)) fragment_prog_arbfp(context, state, state_id); - if (!state->render_states[WINED3DRS_FOGENABLE]) + if (!state->render_states[WINED3D_RS_FOGENABLE]) return; - if (state->render_states[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE) + if (state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3DFOG_NONE) { if (use_vs(state)) { @@ -6419,7 +6419,7 @@ static void state_arbfp_fog(struct wined3d_context *context, const struct wined3 } else { - if (state->render_states[WINED3DRS_FOGVERTEXMODE] == WINED3DFOG_NONE || context->last_was_rhw) + if (state->render_states[WINED3D_RS_FOGVERTEXMODE] == WINED3DFOG_NONE || context->last_was_rhw) new_source = FOGSOURCE_COORD; else new_source = FOGSOURCE_FFP; @@ -6433,7 +6433,7 @@ static void state_arbfp_fog(struct wined3d_context *context, const struct wined3 if (new_source != context->fog_source) { context->fog_source = new_source; - state_fogstartend(context, state, STATE_RENDER(WINED3DRS_FOGSTART)); + state_fogstartend(context, state, STATE_RENDER(WINED3D_RS_FOGSTART)); } } @@ -6443,8 +6443,9 @@ static void textransform(struct wined3d_context *context, const struct wined3d_s fragment_prog_arbfp(context, state, state_id); } -static const struct StateEntryTemplate arbfp_fragmentstate_template[] = { - {STATE_RENDER(WINED3DRS_TEXTUREFACTOR), { STATE_RENDER(WINED3DRS_TEXTUREFACTOR), state_texfactor_arbfp }, WINED3D_GL_EXT_NONE }, +static const struct StateEntryTemplate arbfp_fragmentstate_template[] = +{ + {STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), { STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), state_texfactor_arbfp }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), { STATE_PIXELSHADER, NULL }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(0, WINED3DTSS_COLORARG1), { STATE_PIXELSHADER, NULL }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(0, WINED3DTSS_COLORARG2), { STATE_PIXELSHADER, NULL }, WINED3D_GL_EXT_NONE }, @@ -6566,14 +6567,14 @@ static const struct StateEntryTemplate arbfp_fragmentstate_template[] = { {STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVLSCALE), { STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVLSCALE), tex_bumpenvlum_arbfp }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVLOFFSET), { STATE_TEXTURESTAGE(7, WINED3DTSS_BUMPENVLSCALE), NULL }, WINED3D_GL_EXT_NONE }, {STATE_PIXELSHADER, { STATE_PIXELSHADER, fragment_prog_arbfp }, WINED3D_GL_EXT_NONE }, - {STATE_RENDER(WINED3DRS_FOGENABLE), { STATE_RENDER(WINED3DRS_FOGENABLE), state_arbfp_fog }, 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_PIXELSHADER, NULL }, 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(WINED3D_RS_FOGENABLE), { STATE_RENDER(WINED3D_RS_FOGENABLE), state_arbfp_fog }, 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_PIXELSHADER, NULL }, 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_TEXTURESTAGE(0,WINED3DTSS_TEXTURETRANSFORMFLAGS),{STATE_TEXTURESTAGE(0, WINED3DTSS_TEXTURETRANSFORMFLAGS), textransform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(1,WINED3DTSS_TEXTURETRANSFORMFLAGS),{STATE_TEXTURESTAGE(1, WINED3DTSS_TEXTURETRANSFORMFLAGS), textransform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(2,WINED3DTSS_TEXTURETRANSFORMFLAGS),{STATE_TEXTURESTAGE(2, WINED3DTSS_TEXTURETRANSFORMFLAGS), textransform }, WINED3D_GL_EXT_NONE }, @@ -6582,7 +6583,7 @@ static const struct StateEntryTemplate arbfp_fragmentstate_template[] = { {STATE_TEXTURESTAGE(5,WINED3DTSS_TEXTURETRANSFORMFLAGS),{STATE_TEXTURESTAGE(5, WINED3DTSS_TEXTURETRANSFORMFLAGS), textransform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(6,WINED3DTSS_TEXTURETRANSFORMFLAGS),{STATE_TEXTURESTAGE(6, WINED3DTSS_TEXTURETRANSFORMFLAGS), textransform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(7,WINED3DTSS_TEXTURETRANSFORMFLAGS),{STATE_TEXTURESTAGE(7, WINED3DTSS_TEXTURETRANSFORMFLAGS), textransform }, WINED3D_GL_EXT_NONE }, - {STATE_RENDER(WINED3DRS_SPECULARENABLE), { STATE_RENDER(WINED3DRS_SPECULARENABLE), state_arb_specularenable}, WINED3D_GL_EXT_NONE }, + {STATE_RENDER(WINED3D_RS_SPECULARENABLE), { STATE_RENDER(WINED3D_RS_SPECULARENABLE), state_arb_specularenable}, WINED3D_GL_EXT_NONE }, {0 /* Terminate */, { 0, 0 }, WINED3D_GL_EXT_NONE }, }; diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index d550a04c3a4..16dc79d162f 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -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 }, diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index c567e01ff40..0a1ebac6def 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -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 diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d6f7a98f473..00670e594a2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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); diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 716119e47a0..f9116a04ad8 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -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); diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index 96c7ed8c357..7cb47ee1198 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -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 }, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 482375009e0..240ba8b67bd 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -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; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 7820048bf8e..872736926f3 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -49,7 +49,7 @@ static void state_nop(struct wined3d_context *context, const struct wined3d_stat static void state_fillmode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - WINED3DFILLMODE mode = state->render_states[WINED3DRS_FILLMODE]; + WINED3DFILLMODE mode = state->render_states[WINED3D_RS_FILLMODE]; switch (mode) { @@ -66,7 +66,7 @@ static void state_fillmode(struct wined3d_context *context, const struct wined3d checkGLcall("glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)"); break; default: - FIXME("Unrecognized WINED3DRS_FILLMODE %d.\n", mode); + FIXME("Unrecognized WINED3D_RS_FILLMODE %d.\n", mode); } } @@ -80,7 +80,7 @@ static void state_lighting(struct wined3d_context *context, const struct wined3d if (isStateDirty(context, STATE_VDECL)) return; - if (state->render_states[WINED3DRS_LIGHTING] + if (state->render_states[WINED3D_RS_LIGHTING] && !context->swapchain->device->strided_streams.position_transformed) { glEnable(GL_LIGHTING); @@ -102,7 +102,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ return; } - switch (state->render_states[WINED3DRS_ZENABLE]) + switch (state->render_states[WINED3D_RS_ZENABLE]) { case WINED3DZB_FALSE: glDisable(GL_DEPTH_TEST); @@ -119,7 +119,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_ break; default: FIXME("Unrecognized D3DZBUFFERTYPE value %#x.\n", - state->render_states[WINED3DRS_ZENABLE]); + state->render_states[WINED3D_RS_ZENABLE]); } } @@ -127,7 +127,7 @@ static void state_cullmode(struct wined3d_context *context, const struct wined3d { /* glFrontFace() is set in context.c at context init and on an * offscreen / onscreen rendering switch. */ - switch (state->render_states[WINED3DRS_CULLMODE]) + switch (state->render_states[WINED3D_RS_CULLMODE]) { case WINED3DCULL_NONE: glDisable(GL_CULL_FACE); @@ -147,13 +147,13 @@ static void state_cullmode(struct wined3d_context *context, const struct wined3d break; default: FIXME("Unrecognized/Unhandled WINED3DCULL value %#x.\n", - state->render_states[WINED3DRS_CULLMODE]); + state->render_states[WINED3D_RS_CULLMODE]); } } static void state_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - switch (state->render_states[WINED3DRS_SHADEMODE]) + switch (state->render_states[WINED3D_RS_SHADEMODE]) { case WINED3DSHADE_FLAT: glShadeModel(GL_FLAT); @@ -168,13 +168,13 @@ static void state_shademode(struct wined3d_context *context, const struct wined3 break; default: FIXME("Unrecognized/Unhandled WINED3DSHADEMODE value %#x.\n", - state->render_states[WINED3DRS_SHADEMODE]); + state->render_states[WINED3D_RS_SHADEMODE]); } } static void state_ditherenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_DITHERENABLE]) + if (state->render_states[WINED3D_RS_DITHERENABLE]) { glEnable(GL_DITHER); checkGLcall("glEnable GL_DITHER"); @@ -190,7 +190,7 @@ static void state_zwritenable(struct wined3d_context *context, const struct wine { /* TODO: Test if in d3d z writing is enabled even if ZENABLE is off. * If yes, this has to be merged with ZENABLE and ZFUNC. */ - if (state->render_states[WINED3DRS_ZWRITEENABLE]) + if (state->render_states[WINED3D_RS_ZWRITEENABLE]) { glDepthMask(1); checkGLcall("glDepthMask(1)"); @@ -204,7 +204,7 @@ static void state_zwritenable(struct wined3d_context *context, const struct wine static void state_zfunc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - GLenum depth_func = CompareFunc(state->render_states[WINED3DRS_ZFUNC]); + GLenum depth_func = CompareFunc(state->render_states[WINED3D_RS_ZFUNC]); if (!depth_func) return; @@ -230,8 +230,8 @@ static void state_zfunc(struct wined3d_context *context, const struct wined3d_st static void state_ambient(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { float col[4]; - D3DCOLORTOGLFLOAT4(state->render_states[WINED3DRS_AMBIENT], col); + D3DCOLORTOGLFLOAT4(state->render_states[WINED3D_RS_AMBIENT], col); TRACE("Setting ambient to (%f,%f,%f,%f)\n", col[0], col[1], col[2], col[3]); glLightModelfv(GL_LIGHT_MODEL_AMBIENT, col); checkGLcall("glLightModel for MODEL_AMBIENT"); @@ -269,18 +269,18 @@ static void state_blendop(struct wined3d_context *context, const struct wined3d_ GLenum blend_equation = GL_FUNC_ADD_EXT; /* BLENDOPALPHA requires GL_EXT_blend_equation_separate, so make sure it is around */ - if (state->render_states[WINED3DRS_BLENDOPALPHA] + if (state->render_states[WINED3D_RS_BLENDOPALPHA] && !gl_info->supported[EXT_BLEND_EQUATION_SEPARATE]) { WARN("Unsupported in local OpenGL implementation: glBlendEquationSeparateEXT\n"); return; } - blend_equation = gl_blend_op(state->render_states[WINED3DRS_BLENDOP]); - blend_equation_alpha = gl_blend_op(state->render_states[WINED3DRS_BLENDOPALPHA]); + blend_equation = gl_blend_op(state->render_states[WINED3D_RS_BLENDOP]); + blend_equation_alpha = gl_blend_op(state->render_states[WINED3D_RS_BLENDOPALPHA]); TRACE("blend_equation %#x, blend_equation_alpha %#x.\n", blend_equation, blend_equation_alpha); - if (state->render_states[WINED3DRS_SEPARATEALPHABLENDENABLE]) + if (state->render_states[WINED3D_RS_SEPARATEALPHABLENDENABLE]) { GL_EXTCALL(glBlendEquationSeparateEXT(blend_equation, blend_equation_alpha)); checkGLcall("glBlendEquationSeparateEXT"); @@ -343,9 +343,9 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st /* According to the red book, GL_LINE_SMOOTH needs GL_BLEND with specific * blending parameters to work. */ - if (state->render_states[WINED3DRS_ALPHABLENDENABLE] - || state->render_states[WINED3DRS_EDGEANTIALIAS] - || state->render_states[WINED3DRS_ANTIALIASEDLINEENABLE]) + if (state->render_states[WINED3D_RS_ALPHABLENDENABLE] + || state->render_states[WINED3D_RS_EDGEANTIALIAS] + || state->render_states[WINED3D_RS_ANTIALIASEDLINEENABLE]) { /* Disable blending in all cases even without pixelshaders. * With blending on we could face a big performance penalty. @@ -370,7 +370,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st /* WINED3D_BLEND_BOTHSRCALPHA and WINED3D_BLEND_BOTHINVSRCALPHA are legacy * source blending values which are still valid up to d3d9. They should * not occur as dest blend values. */ - d3d_blend = state->render_states[WINED3DRS_SRCBLEND]; + d3d_blend = state->render_states[WINED3D_RS_SRCBLEND]; if (d3d_blend == WINED3D_BLEND_BOTHSRCALPHA) { srcBlend = GL_SRC_ALPHA; @@ -384,20 +384,20 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st else { srcBlend = gl_blend_factor(d3d_blend, target->resource.format); - dstBlend = gl_blend_factor(state->render_states[WINED3DRS_DESTBLEND], + dstBlend = gl_blend_factor(state->render_states[WINED3D_RS_DESTBLEND], target->resource.format); } - if (state->render_states[WINED3DRS_EDGEANTIALIAS] - || state->render_states[WINED3DRS_ANTIALIASEDLINEENABLE]) + if (state->render_states[WINED3D_RS_EDGEANTIALIAS] + || state->render_states[WINED3D_RS_ANTIALIASEDLINEENABLE]) { glEnable(GL_LINE_SMOOTH); checkGLcall("glEnable(GL_LINE_SMOOTH)"); if(srcBlend != GL_SRC_ALPHA) { - WARN("WINED3DRS_EDGEANTIALIAS enabled, but unexpected src blending param\n"); + WARN("WINED3D_RS_EDGEANTIALIAS enabled, but unexpected src blending param\n"); } if(dstBlend != GL_ONE_MINUS_SRC_ALPHA && dstBlend != GL_ONE) { - WARN("WINED3DRS_EDGEANTIALIAS enabled, but unexpected dst blending param\n"); + WARN("WINED3D_RS_EDGEANTIALIAS enabled, but unexpected dst blending param\n"); } } else { glDisable(GL_LINE_SMOOTH); @@ -405,10 +405,10 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st } /* Re-apply BLENDOP(ALPHA) because of a possible SEPARATEALPHABLENDENABLE change */ - if (!isStateDirty(context, STATE_RENDER(WINED3DRS_BLENDOP))) - state_blendop(context, state, STATE_RENDER(WINED3DRS_BLENDOPALPHA)); + if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_BLENDOP))) + state_blendop(context, state, STATE_RENDER(WINED3D_RS_BLENDOPALPHA)); - if (state->render_states[WINED3DRS_SEPARATEALPHABLENDENABLE]) + if (state->render_states[WINED3D_RS_SEPARATEALPHABLENDENABLE]) { GLenum srcBlendAlpha, dstBlendAlpha; @@ -422,7 +422,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st /* WINED3D_BLEND_BOTHSRCALPHA and WINED3D_BLEND_BOTHINVSRCALPHA are legacy * source blending values which are still valid up to d3d9. They should * not occur as dest blend values. */ - d3d_blend = state->render_states[WINED3DRS_SRCBLENDALPHA]; + d3d_blend = state->render_states[WINED3D_RS_SRCBLENDALPHA]; if (d3d_blend == WINED3D_BLEND_BOTHSRCALPHA) { srcBlendAlpha = GL_SRC_ALPHA; @@ -436,7 +436,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st else { srcBlendAlpha = gl_blend_factor(d3d_blend, target->resource.format); - dstBlendAlpha = gl_blend_factor(state->render_states[WINED3DRS_DESTBLENDALPHA], + dstBlendAlpha = gl_blend_factor(state->render_states[WINED3D_RS_DESTBLENDALPHA], target->resource.format); } @@ -449,8 +449,8 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st } /* Colorkey fixup for stage 0 alphaop depends on - * WINED3DRS_ALPHABLENDENABLE state, so it may need updating. */ - if (state->render_states[WINED3DRS_COLORKEYENABLE]) + * WINED3D_RS_ALPHABLENDENABLE state, so it may need updating. */ + if (state->render_states[WINED3D_RS_COLORKEYENABLE]) context_apply_state(context, state, STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP)); } @@ -464,8 +464,9 @@ static void state_blendfactor(struct wined3d_context *context, const struct wine const struct wined3d_gl_info *gl_info = context->gl_info; float col[4]; - TRACE("Setting blend factor to %#x.\n", state->render_states[WINED3DRS_BLENDFACTOR]); - D3DCOLORTOGLFLOAT4(state->render_states[WINED3DRS_BLENDFACTOR], col); + TRACE("Setting blend factor to %#x.\n", state->render_states[WINED3D_RS_BLENDFACTOR]); + + D3DCOLORTOGLFLOAT4(state->render_states[WINED3D_RS_BLENDFACTOR], col); GL_EXTCALL(glBlendColorEXT (col[0],col[1],col[2],col[3])); checkGLcall("glBlendColor"); } @@ -481,7 +482,7 @@ static void state_alpha(struct wined3d_context *context, const struct wined3d_st /* Find out if the texture on the first stage has a ckey set * The alpha state func reads the texture settings, even though alpha and texture are not grouped * together. This is to avoid making a huge alpha+texture+texture stage+ckey block due to the hardly - * used WINED3DRS_COLORKEYENABLE state(which is d3d <= 3 only). The texture function will call alpha + * used WINED3D_RS_COLORKEYENABLE state(which is d3d <= 3 only). The texture function will call alpha * in case it finds some texture+colorkeyenable combination which needs extra care. */ if (state->textures[0]) @@ -507,8 +508,8 @@ static void state_alpha(struct wined3d_context *context, const struct wined3d_st context_apply_state(context, state, STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP)); context->last_was_ckey = enable_ckey; - if (state->render_states[WINED3DRS_ALPHATESTENABLE] - || (state->render_states[WINED3DRS_COLORKEYENABLE] && enable_ckey)) + if (state->render_states[WINED3D_RS_ALPHATESTENABLE] + || (state->render_states[WINED3D_RS_COLORKEYENABLE] && enable_ckey)) { glEnable(GL_ALPHA_TEST); checkGLcall("glEnable GL_ALPHA_TEST"); @@ -521,15 +522,15 @@ static void state_alpha(struct wined3d_context *context, const struct wined3d_st return; } - if (state->render_states[WINED3DRS_COLORKEYENABLE] && enable_ckey) + if (state->render_states[WINED3D_RS_COLORKEYENABLE] && enable_ckey) { glParm = GL_NOTEQUAL; ref = 0.0f; } else { - ref = ((float)state->render_states[WINED3DRS_ALPHAREF]) / 255.0f; - glParm = CompareFunc(state->render_states[WINED3DRS_ALPHAFUNC]); + ref = ((float)state->render_states[WINED3D_RS_ALPHAREF]) / 255.0f; + glParm = CompareFunc(state->render_states[WINED3D_RS_ALPHAFUNC]); } if(glParm) { glAlphaFunc(glParm, ref); @@ -566,7 +567,7 @@ static void state_clipping(struct wined3d_context *context, const struct wined3d * conditions I got sick of tracking down. The shader state handler disables all clip planes because * of that - don't do anything here and keep them disabled */ - if (state->render_states[WINED3DRS_CLIPPLANEENABLE]) + if (state->render_states[WINED3D_RS_CLIPPLANEENABLE]) { static BOOL warned = FALSE; if(!warned) { @@ -594,10 +595,10 @@ static void state_clipping(struct wined3d_context *context, const struct wined3d /* If enabling / disabling all * TODO: Is this correct? Doesn't D3DRS_CLIPPING disable clipping on the viewport frustrum? */ - if (state->render_states[WINED3DRS_CLIPPING]) + if (state->render_states[WINED3D_RS_CLIPPING]) { - enable = state->render_states[WINED3DRS_CLIPPLANEENABLE]; - disable = ~state->render_states[WINED3DRS_CLIPPLANEENABLE]; + enable = state->render_states[WINED3D_RS_CLIPPLANEENABLE]; + disable = ~state->render_states[WINED3D_RS_CLIPPLANEENABLE]; } else { @@ -650,11 +651,11 @@ static void state_specularenable(struct wined3d_context *context, const struct w * * That's pretty much fine as it is, except for variable B, which needs to take * either GL_SPARE0_PLUS_SECONDARY_COLOR_NV or GL_SPARE0_NV, depending on - * whether WINED3DRS_SPECULARENABLE is enabled or not. + * whether WINED3D_RS_SPECULARENABLE is enabled or not. */ TRACE("Setting specular enable state and materials\n"); - if (state->render_states[WINED3DRS_SPECULARENABLE]) + if (state->render_states[WINED3D_RS_SPECULARENABLE]) { glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float *)&state->material.specular); checkGLcall("glMaterialfv"); @@ -745,14 +746,13 @@ static void state_texfactor(struct wined3d_context *context, const struct wined3 /* Note the texture color applies to all textures whereas * GL_TEXTURE_ENV_COLOR applies to active only. */ float col[4]; - D3DCOLORTOGLFLOAT4(state->render_states[WINED3DRS_TEXTUREFACTOR], col); + D3DCOLORTOGLFLOAT4(state->render_states[WINED3D_RS_TEXTUREFACTOR], col); /* And now the default texture color as well */ for (i = 0; i < gl_info->limits.texture_stages; ++i) { - /* Note the WINED3DRS value applies to all textures, but GL has one - * per texture, so apply it now ready to be used! - */ + /* Note the WINED3D_RS value applies to all textures, but GL has one + * per texture, so apply it now ready to be used! */ context_active_texture(context, gl_info, i); glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &col[0]); @@ -799,20 +799,20 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ return; } - onesided_enable = state->render_states[WINED3DRS_STENCILENABLE]; - twosided_enable = state->render_states[WINED3DRS_TWOSIDEDSTENCILMODE]; - if (!(func = CompareFunc(state->render_states[WINED3DRS_STENCILFUNC]))) + onesided_enable = state->render_states[WINED3D_RS_STENCILENABLE]; + twosided_enable = state->render_states[WINED3D_RS_TWOSIDEDSTENCILMODE]; + if (!(func = CompareFunc(state->render_states[WINED3D_RS_STENCILFUNC]))) func = GL_ALWAYS; - if (!(func_ccw = CompareFunc(state->render_states[WINED3DRS_CCW_STENCILFUNC]))) + if (!(func_ccw = CompareFunc(state->render_states[WINED3D_RS_CCW_STENCILFUNC]))) func_ccw = GL_ALWAYS; - ref = state->render_states[WINED3DRS_STENCILREF]; - mask = state->render_states[WINED3DRS_STENCILMASK]; - stencilFail = StencilOp(state->render_states[WINED3DRS_STENCILFAIL]); - depthFail = StencilOp(state->render_states[WINED3DRS_STENCILZFAIL]); - stencilPass = StencilOp(state->render_states[WINED3DRS_STENCILPASS]); - stencilFail_ccw = StencilOp(state->render_states[WINED3DRS_CCW_STENCILFAIL]); - depthFail_ccw = StencilOp(state->render_states[WINED3DRS_CCW_STENCILZFAIL]); - stencilPass_ccw = StencilOp(state->render_states[WINED3DRS_CCW_STENCILPASS]); + ref = state->render_states[WINED3D_RS_STENCILREF]; + mask = state->render_states[WINED3D_RS_STENCILMASK]; + stencilFail = StencilOp(state->render_states[WINED3D_RS_STENCILFAIL]); + depthFail = StencilOp(state->render_states[WINED3D_RS_STENCILZFAIL]); + stencilPass = StencilOp(state->render_states[WINED3D_RS_STENCILPASS]); + stencilFail_ccw = StencilOp(state->render_states[WINED3D_RS_CCW_STENCILFAIL]); + depthFail_ccw = StencilOp(state->render_states[WINED3D_RS_CCW_STENCILZFAIL]); + stencilPass_ccw = StencilOp(state->render_states[WINED3D_RS_CCW_STENCILPASS]); TRACE("(onesided %d, twosided %d, ref %x, mask %x, " "GL_FRONT: func: %x, fail %x, zfail %x, zpass %x " @@ -875,7 +875,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ static void state_stencilwrite2s(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3DRS_STENCILWRITEMASK] : 0; + DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; const struct wined3d_gl_info *gl_info = context->gl_info; GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK)); @@ -889,7 +889,7 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct w static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3DRS_STENCILWRITEMASK] : 0; + DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0; glStencilMask(mask); checkGLcall("glStencilMask"); @@ -901,11 +901,11 @@ static void state_fog_vertexpart(struct wined3d_context *context, const struct w const struct wined3d_gl_info *gl_info = context->gl_info; TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); - if (!state->render_states[WINED3DRS_FOGENABLE]) + if (!state->render_states[WINED3D_RS_FOGENABLE]) return; /* Table fog on: Never use fog coords, and use per-fragment fog */ - if (state->render_states[WINED3DRS_FOGTABLEMODE] != WINED3DFOG_NONE) + if (state->render_states[WINED3D_RS_FOGTABLEMODE] != WINED3DFOG_NONE) { glHint(GL_FOG_HINT, GL_NICEST); if(context->fog_coord) { @@ -926,7 +926,7 @@ static void state_fog_vertexpart(struct wined3d_context *context, const struct w /* Otherwise use per-vertex fog in any case */ glHint(GL_FOG_HINT, GL_FASTEST); - if (state->render_states[WINED3DRS_FOGVERTEXMODE] == WINED3DFOG_NONE || context->last_was_rhw) + if (state->render_states[WINED3D_RS_FOGVERTEXMODE] == WINED3DFOG_NONE || context->last_was_rhw) { /* No fog at all, or transformed vertices: Use fog coord */ if(!context->fog_coord) { @@ -944,7 +944,7 @@ static void state_fog_vertexpart(struct wined3d_context *context, const struct w context->fog_coord = FALSE; } - if (state->render_states[WINED3DRS_RANGEFOGENABLE]) + if (state->render_states[WINED3D_RS_RANGEFOGENABLE]) { if (gl_info->supported[NV_FOG_DISTANCE]) { @@ -984,9 +984,9 @@ void state_fogstartend(struct wined3d_context *context, const struct wined3d_sta break; case FOGSOURCE_FFP: - tmpvalue.d = state->render_states[WINED3DRS_FOGSTART]; + tmpvalue.d = state->render_states[WINED3D_RS_FOGSTART]; fogstart = tmpvalue.f; - tmpvalue.d = state->render_states[WINED3DRS_FOGEND]; + tmpvalue.d = state->render_states[WINED3D_RS_FOGEND]; fogend = tmpvalue.f; /* In GL, fogstart == fogend disables fog, in D3D everything's fogged.*/ if(fogstart == fogend) { @@ -1019,7 +1019,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); - if (!state->render_states[WINED3DRS_FOGENABLE]) + if (!state->render_states[WINED3D_RS_FOGENABLE]) { /* No fog? Disable it, and we're done :-) */ glDisableWINE(GL_FOG); @@ -1073,7 +1073,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st /* DX 7 sdk: "If both render states(vertex and table fog) are set to valid modes, * the system will apply only pixel(=table) fog effects." */ - if (state->render_states[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE) + if (state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3DFOG_NONE) { if (use_vs(state)) { @@ -1083,7 +1083,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st } else { - switch (state->render_states[WINED3DRS_FOGVERTEXMODE]) + switch (state->render_states[WINED3D_RS_FOGVERTEXMODE]) { /* If processed vertices are used, fall through to the NONE case */ case WINED3DFOG_EXP: @@ -1124,15 +1124,15 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st break; default: - FIXME("Unexpected WINED3DRS_FOGVERTEXMODE %#x.\n", - state->render_states[WINED3DRS_FOGVERTEXMODE]); + FIXME("Unexpected WINED3D_RS_FOGVERTEXMODE %#x.\n", + state->render_states[WINED3D_RS_FOGVERTEXMODE]); new_source = FOGSOURCE_FFP; /* Make the compiler happy */ } } } else { new_source = FOGSOURCE_FFP; - switch (state->render_states[WINED3DRS_FOGTABLEMODE]) + switch (state->render_states[WINED3D_RS_FOGTABLEMODE]) { case WINED3DFOG_EXP: glFogi(GL_FOG_MODE, GL_EXP); @@ -1151,8 +1151,8 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st case WINED3DFOG_NONE: /* Won't happen */ default: - FIXME("Unexpected WINED3DRS_FOGTABLEMODE %#x.\n", - state->render_states[WINED3DRS_FOGTABLEMODE]); + FIXME("Unexpected WINED3D_RS_FOGTABLEMODE %#x.\n", + state->render_states[WINED3D_RS_FOGTABLEMODE]); } } @@ -1161,7 +1161,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st if (new_source != context->fog_source) { context->fog_source = new_source; - state_fogstartend(context, state, STATE_RENDER(WINED3DRS_FOGSTART)); + state_fogstartend(context, state, STATE_RENDER(WINED3D_RS_FOGSTART)); } } @@ -1169,7 +1169,7 @@ void state_fogcolor(struct wined3d_context *context, const struct wined3d_state { float col[4]; - D3DCOLORTOGLFLOAT4(state->render_states[WINED3DRS_FOGCOLOR], col); + D3DCOLORTOGLFLOAT4(state->render_states[WINED3D_RS_FOGCOLOR], col); glFogfv(GL_FOG_COLOR, &col[0]); checkGLcall("glFog GL_FOG_COLOR"); } @@ -1181,7 +1181,7 @@ void state_fogdensity(struct wined3d_context *context, const struct wined3d_stat float f; } tmpvalue; - tmpvalue.d = state->render_states[WINED3DRS_FOGDENSITY]; + tmpvalue.d = state->render_states[WINED3D_RS_FOGDENSITY]; glFogfv(GL_FOG_DENSITY, &tmpvalue.f); checkGLcall("glFogf(GL_FOG_DENSITY, (float) Value)"); } @@ -1201,55 +1201,55 @@ static void state_colormat(struct wined3d_context *context, const struct wined3d context->num_untracked_materials = 0; if ((device->strided_streams.use_map & (1 << WINED3D_FFP_DIFFUSE)) - && state->render_states[WINED3DRS_COLORVERTEX]) + && state->render_states[WINED3D_RS_COLORVERTEX]) { TRACE("diff %d, amb %d, emis %d, spec %d\n", - state->render_states[WINED3DRS_DIFFUSEMATERIALSOURCE], - state->render_states[WINED3DRS_AMBIENTMATERIALSOURCE], - state->render_states[WINED3DRS_EMISSIVEMATERIALSOURCE], - state->render_states[WINED3DRS_SPECULARMATERIALSOURCE]); + state->render_states[WINED3D_RS_DIFFUSEMATERIALSOURCE], + state->render_states[WINED3D_RS_AMBIENTMATERIALSOURCE], + state->render_states[WINED3D_RS_EMISSIVEMATERIALSOURCE], + state->render_states[WINED3D_RS_SPECULARMATERIALSOURCE]); - if (state->render_states[WINED3DRS_DIFFUSEMATERIALSOURCE] == WINED3DMCS_COLOR1) + if (state->render_states[WINED3D_RS_DIFFUSEMATERIALSOURCE] == WINED3DMCS_COLOR1) { - if (state->render_states[WINED3DRS_AMBIENTMATERIALSOURCE] == WINED3DMCS_COLOR1) + if (state->render_states[WINED3D_RS_AMBIENTMATERIALSOURCE] == WINED3DMCS_COLOR1) Parm = GL_AMBIENT_AND_DIFFUSE; else Parm = GL_DIFFUSE; - if (state->render_states[WINED3DRS_EMISSIVEMATERIALSOURCE] == WINED3DMCS_COLOR1) + if (state->render_states[WINED3D_RS_EMISSIVEMATERIALSOURCE] == WINED3DMCS_COLOR1) { context->untracked_materials[context->num_untracked_materials] = GL_EMISSION; context->num_untracked_materials++; } - if (state->render_states[WINED3DRS_SPECULARMATERIALSOURCE] == WINED3DMCS_COLOR1) + if (state->render_states[WINED3D_RS_SPECULARMATERIALSOURCE] == WINED3DMCS_COLOR1) { context->untracked_materials[context->num_untracked_materials] = GL_SPECULAR; context->num_untracked_materials++; } } - else if (state->render_states[WINED3DRS_AMBIENTMATERIALSOURCE] == WINED3DMCS_COLOR1) + else if (state->render_states[WINED3D_RS_AMBIENTMATERIALSOURCE] == WINED3DMCS_COLOR1) { Parm = GL_AMBIENT; - if (state->render_states[WINED3DRS_EMISSIVEMATERIALSOURCE] == WINED3DMCS_COLOR1) + if (state->render_states[WINED3D_RS_EMISSIVEMATERIALSOURCE] == WINED3DMCS_COLOR1) { context->untracked_materials[context->num_untracked_materials] = GL_EMISSION; context->num_untracked_materials++; } - if (state->render_states[WINED3DRS_SPECULARMATERIALSOURCE] == WINED3DMCS_COLOR1) + if (state->render_states[WINED3D_RS_SPECULARMATERIALSOURCE] == WINED3DMCS_COLOR1) { context->untracked_materials[context->num_untracked_materials] = GL_SPECULAR; context->num_untracked_materials++; } } - else if (state->render_states[WINED3DRS_EMISSIVEMATERIALSOURCE] == WINED3DMCS_COLOR1) + else if (state->render_states[WINED3D_RS_EMISSIVEMATERIALSOURCE] == WINED3DMCS_COLOR1) { Parm = GL_EMISSION; - if (state->render_states[WINED3DRS_SPECULARMATERIALSOURCE] == WINED3DMCS_COLOR1) + if (state->render_states[WINED3D_RS_SPECULARMATERIALSOURCE] == WINED3DMCS_COLOR1) { context->untracked_materials[context->num_untracked_materials] = GL_SPECULAR; context->num_untracked_materials++; } } - else if (state->render_states[WINED3DRS_SPECULARMATERIALSOURCE] == WINED3DMCS_COLOR1) + else if (state->render_states[WINED3D_RS_SPECULARMATERIALSOURCE] == WINED3DMCS_COLOR1) { Parm = GL_SPECULAR; } @@ -1294,7 +1294,7 @@ static void state_colormat(struct wined3d_context *context, const struct wined3d case GL_SPECULAR: /* Only change material color if specular is enabled, otherwise it is set to black */ - if (state->render_states[WINED3DRS_SPECULARENABLE]) + if (state->render_states[WINED3D_RS_SPECULARENABLE]) { glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float *)&state->material.specular); checkGLcall("glMaterialfv"); @@ -1318,7 +1318,7 @@ static void state_linepattern(struct wined3d_context *context, const struct wine DWORD d; struct wined3d_line_pattern lp; } tmppattern; - tmppattern.d = state->render_states[WINED3DRS_LINEPATTERN]; + tmppattern.d = state->render_states[WINED3D_RS_LINEPATTERN]; TRACE("Line pattern: repeat %d bits %x.\n", tmppattern.lp.repeat_factor, tmppattern.lp.line_pattern); @@ -1345,7 +1345,7 @@ static void state_normalize(struct wined3d_context *context, const struct wined3 * from the opengl lighting equation, as d3d does. Normalization of 0/0/0 can lead to a division * by zero and is not properly defined in opengl, so avoid it */ - if (state->render_states[WINED3DRS_NORMALIZENORMALS] + if (state->render_states[WINED3D_RS_NORMALIZENORMALS] && (context->swapchain->device->strided_streams.use_map & (1 << WINED3D_FFP_NORMAL))) { glEnable(GL_NORMALIZE); @@ -1365,15 +1365,15 @@ static void state_psizemin_w(struct wined3d_context *context, const struct wined float f; } tmpvalue; - tmpvalue.d = state->render_states[WINED3DRS_POINTSIZE_MIN]; + tmpvalue.d = state->render_states[WINED3D_RS_POINTSIZE_MIN]; if (tmpvalue.f != 1.0f) { - FIXME("WINED3DRS_POINTSIZE_MIN not supported on this opengl, value is %f\n", tmpvalue.f); + FIXME("WINED3D_RS_POINTSIZE_MIN not supported on this opengl, value is %f\n", tmpvalue.f); } - tmpvalue.d = state->render_states[WINED3DRS_POINTSIZE_MAX]; + tmpvalue.d = state->render_states[WINED3D_RS_POINTSIZE_MAX]; if (tmpvalue.f != 64.0f) { - FIXME("WINED3DRS_POINTSIZE_MAX not supported on this opengl, value is %f\n", tmpvalue.f); + FIXME("WINED3D_RS_POINTSIZE_MAX not supported on this opengl, value is %f\n", tmpvalue.f); } } @@ -1387,8 +1387,8 @@ static void state_psizemin_ext(struct wined3d_context *context, const struct win float f; } min, max; - min.d = state->render_states[WINED3DRS_POINTSIZE_MIN]; - max.d = state->render_states[WINED3DRS_POINTSIZE_MAX]; + min.d = state->render_states[WINED3D_RS_POINTSIZE_MIN]; + max.d = state->render_states[WINED3D_RS_POINTSIZE_MAX]; /* Max point size trumps min point size */ if(min.f > max.f) { @@ -1410,8 +1410,8 @@ static void state_psizemin_arb(struct wined3d_context *context, const struct win float f; } min, max; - min.d = state->render_states[WINED3DRS_POINTSIZE_MIN]; - max.d = state->render_states[WINED3DRS_POINTSIZE_MAX]; + min.d = state->render_states[WINED3D_RS_POINTSIZE_MIN]; + max.d = state->render_states[WINED3D_RS_POINTSIZE_MAX]; /* Max point size trumps min point size */ if(min.f > max.f) { @@ -1441,12 +1441,12 @@ static void state_pscale(struct wined3d_context *context, const struct wined3d_s float f; } pointSize, A, B, C; - pointSize.d = state->render_states[WINED3DRS_POINTSIZE]; - A.d = state->render_states[WINED3DRS_POINTSCALE_A]; - B.d = state->render_states[WINED3DRS_POINTSCALE_B]; - C.d = state->render_states[WINED3DRS_POINTSCALE_C]; + pointSize.d = state->render_states[WINED3D_RS_POINTSIZE]; + A.d = state->render_states[WINED3D_RS_POINTSCALE_A]; + B.d = state->render_states[WINED3D_RS_POINTSCALE_B]; + C.d = state->render_states[WINED3D_RS_POINTSCALE_C]; - if (state->render_states[WINED3DRS_POINTSCALEENABLE]) + if (state->render_states[WINED3D_RS_POINTSCALEENABLE]) { DWORD h = state->viewport.height; GLfloat scaleFactor; @@ -1494,7 +1494,7 @@ static void state_pscale(struct wined3d_context *context, const struct wined3d_s GL_EXTCALL(glPointParameterfvEXT)(GL_DISTANCE_ATTENUATION_EXT, att); checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...)"); } - else if (state->render_states[WINED3DRS_POINTSCALEENABLE]) + else if (state->render_states[WINED3D_RS_POINTSCALEENABLE]) { WARN("POINT_PARAMETERS not supported in this version of opengl\n"); } @@ -1505,15 +1505,15 @@ static void state_pscale(struct wined3d_context *context, const struct wined3d_s static void state_debug_monitor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - WARN("token: %#x.\n", state->render_states[WINED3DRS_DEBUGMONITORTOKEN]); + WARN("token: %#x.\n", state->render_states[WINED3D_RS_DEBUGMONITORTOKEN]); } static void state_colorwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - DWORD mask0 = state->render_states[WINED3DRS_COLORWRITEENABLE]; - DWORD mask1 = state->render_states[WINED3DRS_COLORWRITEENABLE1]; - DWORD mask2 = state->render_states[WINED3DRS_COLORWRITEENABLE2]; - DWORD mask3 = state->render_states[WINED3DRS_COLORWRITEENABLE3]; + DWORD mask0 = state->render_states[WINED3D_RS_COLORWRITEENABLE]; + DWORD mask1 = state->render_states[WINED3D_RS_COLORWRITEENABLE1]; + DWORD mask2 = state->render_states[WINED3D_RS_COLORWRITEENABLE2]; + DWORD mask3 = state->render_states[WINED3D_RS_COLORWRITEENABLE3]; TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n", mask0 & WINED3DCOLORWRITEENABLE_RED ? 1 : 0, @@ -1529,7 +1529,7 @@ static void state_colorwrite(struct wined3d_context *context, const struct wined if (!((mask1 == mask0 && mask2 == mask0 && mask3 == mask0) || (mask1 == 0xf && mask2 == 0xf && mask3 == 0xf))) { - FIXME("WINED3DRS_COLORWRITEENABLE/1/2/3, %#x/%#x/%#x/%#x not yet implemented.\n", + FIXME("WINED3D_RS_COLORWRITEENABLE/1/2/3, %#x/%#x/%#x/%#x not yet implemented.\n", mask0, mask1, mask2, mask3); FIXME("Missing of cap D3DPMISCCAPS_INDEPENDENTWRITEMASKS wasn't honored?\n"); } @@ -1546,27 +1546,27 @@ static void set_color_mask(const struct wined3d_gl_info *gl_info, UINT index, DW static void state_colorwrite0(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - set_color_mask(context->gl_info, 0, state->render_states[WINED3DRS_COLORWRITEENABLE]); + set_color_mask(context->gl_info, 0, state->render_states[WINED3D_RS_COLORWRITEENABLE]); } static void state_colorwrite1(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - set_color_mask(context->gl_info, 1, state->render_states[WINED3DRS_COLORWRITEENABLE1]); + set_color_mask(context->gl_info, 1, state->render_states[WINED3D_RS_COLORWRITEENABLE1]); } static void state_colorwrite2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - set_color_mask(context->gl_info, 2, state->render_states[WINED3DRS_COLORWRITEENABLE2]); + set_color_mask(context->gl_info, 2, state->render_states[WINED3D_RS_COLORWRITEENABLE2]); } static void state_colorwrite3(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - set_color_mask(context->gl_info, 3, state->render_states[WINED3DRS_COLORWRITEENABLE3]); + set_color_mask(context->gl_info, 3, state->render_states[WINED3D_RS_COLORWRITEENABLE3]); } static void state_localviewer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_LOCALVIEWER]) + if (state->render_states[WINED3D_RS_LOCALVIEWER]) { glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1); checkGLcall("glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1)"); @@ -1578,7 +1578,7 @@ static void state_localviewer(struct wined3d_context *context, const struct wine static void state_lastpixel(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_LASTPIXEL]) + if (state->render_states[WINED3D_RS_LASTPIXEL]) { TRACE("Last Pixel Drawing Enabled\n"); } @@ -1599,7 +1599,7 @@ static void state_pointsprite_w(struct wined3d_context *context, const struct wi static BOOL warned; /* TODO: NV_POINT_SPRITE */ - if (!warned && state->render_states[WINED3DRS_POINTSPRITEENABLE]) + if (!warned && state->render_states[WINED3D_RS_POINTSPRITEENABLE]) { /* A FIXME, not a WARN because point sprites should be software emulated if not supported by HW */ FIXME("Point sprites not supported\n"); @@ -1609,7 +1609,7 @@ static void state_pointsprite_w(struct wined3d_context *context, const struct wi static void state_pointsprite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_POINTSPRITEENABLE]) + if (state->render_states[WINED3D_RS_POINTSPRITEENABLE]) { glEnable(GL_POINT_SPRITE_ARB); checkGLcall("glEnable(GL_POINT_SPRITE_ARB)"); @@ -1621,34 +1621,34 @@ static void state_pointsprite(struct wined3d_context *context, const struct wine static void state_wrap(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_WRAP0] - || state->render_states[WINED3DRS_WRAP1] - || state->render_states[WINED3DRS_WRAP2] - || state->render_states[WINED3DRS_WRAP3] - || state->render_states[WINED3DRS_WRAP4] - || state->render_states[WINED3DRS_WRAP5] - || state->render_states[WINED3DRS_WRAP6] - || state->render_states[WINED3DRS_WRAP7] - || state->render_states[WINED3DRS_WRAP8] - || state->render_states[WINED3DRS_WRAP9] - || state->render_states[WINED3DRS_WRAP10] - || state->render_states[WINED3DRS_WRAP11] - || state->render_states[WINED3DRS_WRAP12] - || state->render_states[WINED3DRS_WRAP13] - || state->render_states[WINED3DRS_WRAP14] - || state->render_states[WINED3DRS_WRAP15]) - FIXME("(WINED3DRS_WRAP0) Texture wrapping not yet supported.\n"); + if (state->render_states[WINED3D_RS_WRAP0] + || state->render_states[WINED3D_RS_WRAP1] + || state->render_states[WINED3D_RS_WRAP2] + || state->render_states[WINED3D_RS_WRAP3] + || state->render_states[WINED3D_RS_WRAP4] + || state->render_states[WINED3D_RS_WRAP5] + || state->render_states[WINED3D_RS_WRAP6] + || state->render_states[WINED3D_RS_WRAP7] + || state->render_states[WINED3D_RS_WRAP8] + || state->render_states[WINED3D_RS_WRAP9] + || state->render_states[WINED3D_RS_WRAP10] + || state->render_states[WINED3D_RS_WRAP11] + || state->render_states[WINED3D_RS_WRAP12] + || state->render_states[WINED3D_RS_WRAP13] + || state->render_states[WINED3D_RS_WRAP14] + || state->render_states[WINED3D_RS_WRAP15]) + FIXME("(WINED3D_RS_WRAP0) Texture wrapping not yet supported.\n"); } static void state_msaa_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_MULTISAMPLEANTIALIAS]) + if (state->render_states[WINED3D_RS_MULTISAMPLEANTIALIAS]) WARN("Multisample antialiasing not supported by GL.\n"); } static void state_msaa(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_MULTISAMPLEANTIALIAS]) + if (state->render_states[WINED3D_RS_MULTISAMPLEANTIALIAS]) { glEnable(GL_MULTISAMPLE_ARB); checkGLcall("glEnable(GL_MULTISAMPLE_ARB)"); @@ -1660,7 +1660,7 @@ static void state_msaa(struct wined3d_context *context, const struct wined3d_sta static void state_scissor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_SCISSORTESTENABLE]) + if (state->render_states[WINED3D_RS_SCISSORTESTENABLE]) { glEnable(GL_SCISSOR_TEST); checkGLcall("glEnable(GL_SCISSOR_TEST)"); @@ -1681,8 +1681,8 @@ static void state_scissor(struct wined3d_context *context, const struct wined3d_ * depth slope, and doesn't need to be scaled. */ static void state_depthbias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_SLOPESCALEDEPTHBIAS] - || state->render_states[WINED3DRS_DEPTHBIAS]) + if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS] + || state->render_states[WINED3D_RS_DEPTHBIAS]) { const struct wined3d_surface *depth = state->fb->depth_stencil; float scale; @@ -1693,8 +1693,8 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 float f; } scale_bias, const_bias; - scale_bias.d = state->render_states[WINED3DRS_SLOPESCALEDEPTHBIAS]; - const_bias.d = state->render_states[WINED3DRS_DEPTHBIAS]; + scale_bias.d = state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS]; + const_bias.d = state->render_states[WINED3D_RS_DEPTHBIAS]; glEnable(GL_POLYGON_OFFSET_FILL); checkGLcall("glEnable(GL_POLYGON_OFFSET_FILL)"); @@ -1734,13 +1734,13 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3 static void state_zvisible(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_ZVISIBLE]) - FIXME("WINED3DRS_ZVISIBLE not implemented.\n"); + if (state->render_states[WINED3D_RS_ZVISIBLE]) + FIXME("WINED3D_RS_ZVISIBLE not implemented.\n"); } static void state_perspective(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_TEXTUREPERSPECTIVE]) + if (state->render_states[WINED3D_RS_TEXTUREPERSPECTIVE]) { glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); checkGLcall("glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)"); @@ -1752,28 +1752,28 @@ static void state_perspective(struct wined3d_context *context, const struct wine static void state_stippledalpha(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_STIPPLEDALPHA]) + if (state->render_states[WINED3D_RS_STIPPLEDALPHA]) FIXME("Stippled Alpha not supported yet.\n"); } static void state_antialias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_ANTIALIAS]) + if (state->render_states[WINED3D_RS_ANTIALIAS]) FIXME("Antialias not supported yet.\n"); } static void state_multisampmask(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_MULTISAMPLEMASK] != 0xffffffff) - FIXME("WINED3DRS_MULTISAMPLEMASK %#x not yet implemented.\n", - state->render_states[WINED3DRS_MULTISAMPLEMASK]); + if (state->render_states[WINED3D_RS_MULTISAMPLEMASK] != 0xffffffff) + FIXME("WINED3D_RS_MULTISAMPLEMASK %#x not yet implemented.\n", + state->render_states[WINED3D_RS_MULTISAMPLEMASK]); } static void state_patchedgestyle(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_PATCHEDGESTYLE] != WINED3DPATCHEDGE_DISCRETE) - FIXME("WINED3DRS_PATCHEDGESTYLE %#x not yet implemented.\n", - state->render_states[WINED3DRS_PATCHEDGESTYLE]); + if (state->render_states[WINED3D_RS_PATCHEDGESTYLE] != WINED3DPATCHEDGE_DISCRETE) + FIXME("WINED3D_RS_PATCHEDGESTYLE %#x not yet implemented.\n", + state->render_states[WINED3D_RS_PATCHEDGESTYLE]); } static void state_patchsegments(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) @@ -1784,13 +1784,13 @@ static void state_patchsegments(struct wined3d_context *context, const struct wi } tmpvalue; tmpvalue.f = 1.0f; - if (state->render_states[WINED3DRS_PATCHSEGMENTS] != tmpvalue.d) + if (state->render_states[WINED3D_RS_PATCHSEGMENTS] != tmpvalue.d) { static BOOL displayed = FALSE; - tmpvalue.d = state->render_states[WINED3DRS_PATCHSEGMENTS]; + tmpvalue.d = state->render_states[WINED3D_RS_PATCHSEGMENTS]; if(!displayed) - FIXME("(WINED3DRS_PATCHSEGMENTS,%f) not yet implemented\n", tmpvalue.f); + FIXME("(WINED3D_RS_PATCHSEGMENTS,%f) not yet implemented\n", tmpvalue.f); displayed = TRUE; } @@ -1798,23 +1798,23 @@ static void state_patchsegments(struct wined3d_context *context, const struct wi static void state_positiondegree(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_POSITIONDEGREE] != WINED3D_DEGREE_CUBIC) - FIXME("WINED3DRS_POSITIONDEGREE %#x not yet implemented.\n", - state->render_states[WINED3DRS_POSITIONDEGREE]); + if (state->render_states[WINED3D_RS_POSITIONDEGREE] != WINED3D_DEGREE_CUBIC) + FIXME("WINED3D_RS_POSITIONDEGREE %#x not yet implemented.\n", + state->render_states[WINED3D_RS_POSITIONDEGREE]); } static void state_normaldegree(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_NORMALDEGREE] != WINED3D_DEGREE_LINEAR) - FIXME("WINED3DRS_NORMALDEGREE %#x not yet implemented.\n", - state->render_states[WINED3DRS_NORMALDEGREE]); + if (state->render_states[WINED3D_RS_NORMALDEGREE] != WINED3D_DEGREE_LINEAR) + FIXME("WINED3D_RS_NORMALDEGREE %#x not yet implemented.\n", + state->render_states[WINED3D_RS_NORMALDEGREE]); } static void state_tessellation(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_ENABLEADAPTIVETESSELLATION]) - FIXME("WINED3DRS_ENABLEADAPTIVETESSELLATION %#x not yet implemented.\n", - state->render_states[WINED3DRS_ENABLEADAPTIVETESSELLATION]); + if (state->render_states[WINED3D_RS_ENABLEADAPTIVETESSELLATION]) + FIXME("WINED3D_RS_ENABLEADAPTIVETESSELLATION %#x not yet implemented.\n", + state->render_states[WINED3D_RS_ENABLEADAPTIVETESSELLATION]); } static void state_nvdb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) @@ -1826,10 +1826,10 @@ static void state_nvdb(struct wined3d_context *context, const struct wined3d_sta const struct wined3d_gl_info *gl_info = context->gl_info; - if (state->render_states[WINED3DRS_ADAPTIVETESS_X] == WINED3DFMT_NVDB) + if (state->render_states[WINED3D_RS_ADAPTIVETESS_X] == WINED3DFMT_NVDB) { - zmin.d = state->render_states[WINED3DRS_ADAPTIVETESS_Z]; - zmax.d = state->render_states[WINED3DRS_ADAPTIVETESS_W]; + zmin.d = state->render_states[WINED3D_RS_ADAPTIVETESS_Z]; + zmax.d = state->render_states[WINED3D_RS_ADAPTIVETESS_W]; /* If zmin is larger than zmax INVALID_VALUE error is generated. * In d3d9 test is not performed in this case*/ @@ -1850,96 +1850,96 @@ static void state_nvdb(struct wined3d_context *context, const struct wined3d_sta checkGLcall("glDisable(GL_DEPTH_BOUNDS_TEST_EXT)"); } - state_tessellation(context, state, STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION)); + state_tessellation(context, state, STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION)); } static void state_wrapu(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_WRAPU]) - FIXME("Render state WINED3DRS_WRAPU not implemented yet.\n"); + if (state->render_states[WINED3D_RS_WRAPU]) + FIXME("Render state WINED3D_RS_WRAPU not implemented yet.\n"); } static void state_wrapv(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_WRAPV]) - FIXME("Render state WINED3DRS_WRAPV not implemented yet.\n"); + if (state->render_states[WINED3D_RS_WRAPV]) + FIXME("Render state WINED3D_RS_WRAPV not implemented yet.\n"); } static void state_monoenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_MONOENABLE]) - FIXME("Render state WINED3DRS_MONOENABLE not implemented yet.\n"); + if (state->render_states[WINED3D_RS_MONOENABLE]) + FIXME("Render state WINED3D_RS_MONOENABLE not implemented yet.\n"); } static void state_rop2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_ROP2]) - FIXME("Render state WINED3DRS_ROP2 not implemented yet.\n"); + if (state->render_states[WINED3D_RS_ROP2]) + FIXME("Render state WINED3D_RS_ROP2 not implemented yet.\n"); } static void state_planemask(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_PLANEMASK]) - FIXME("Render state WINED3DRS_PLANEMASK not implemented yet.\n"); + if (state->render_states[WINED3D_RS_PLANEMASK]) + FIXME("Render state WINED3D_RS_PLANEMASK not implemented yet.\n"); } static void state_subpixel(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_SUBPIXEL]) - FIXME("Render state WINED3DRS_SUBPIXEL not implemented yet.\n"); + if (state->render_states[WINED3D_RS_SUBPIXEL]) + FIXME("Render state WINED3D_RS_SUBPIXEL not implemented yet.\n"); } static void state_subpixelx(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_SUBPIXELX]) - FIXME("Render state WINED3DRS_SUBPIXELX not implemented yet.\n"); + if (state->render_states[WINED3D_RS_SUBPIXELX]) + FIXME("Render state WINED3D_RS_SUBPIXELX not implemented yet.\n"); } static void state_stippleenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_STIPPLEENABLE]) - FIXME("Render state WINED3DRS_STIPPLEENABLE not implemented yet.\n"); + if (state->render_states[WINED3D_RS_STIPPLEENABLE]) + FIXME("Render state WINED3D_RS_STIPPLEENABLE not implemented yet.\n"); } static void state_mipmaplodbias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_MIPMAPLODBIAS]) - FIXME("Render state WINED3DRS_MIPMAPLODBIAS not implemented yet.\n"); + if (state->render_states[WINED3D_RS_MIPMAPLODBIAS]) + FIXME("Render state WINED3D_RS_MIPMAPLODBIAS not implemented yet.\n"); } static void state_anisotropy(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_ANISOTROPY]) - FIXME("Render state WINED3DRS_ANISOTROPY not implemented yet.\n"); + if (state->render_states[WINED3D_RS_ANISOTROPY]) + FIXME("Render state WINED3D_RS_ANISOTROPY not implemented yet.\n"); } static void state_flushbatch(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_FLUSHBATCH]) - FIXME("Render state WINED3DRS_FLUSHBATCH not implemented yet.\n"); + if (state->render_states[WINED3D_RS_FLUSHBATCH]) + FIXME("Render state WINED3D_RS_FLUSHBATCH not implemented yet.\n"); } static void state_translucentsi(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_TRANSLUCENTSORTINDEPENDENT]) - FIXME("Render state WINED3DRS_TRANSLUCENTSORTINDEPENDENT not implemented yet.\n"); + if (state->render_states[WINED3D_RS_TRANSLUCENTSORTINDEPENDENT]) + FIXME("Render state WINED3D_RS_TRANSLUCENTSORTINDEPENDENT not implemented yet.\n"); } static void state_extents(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_EXTENTS]) - FIXME("Render state WINED3DRS_EXTENTS not implemented yet.\n"); + if (state->render_states[WINED3D_RS_EXTENTS]) + FIXME("Render state WINED3D_RS_EXTENTS not implemented yet.\n"); } static void state_ckeyblend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_COLORKEYBLENDENABLE]) - FIXME("Render state WINED3DRS_COLORKEYBLENDENABLE not implemented yet.\n"); + if (state->render_states[WINED3D_RS_COLORKEYBLENDENABLE]) + FIXME("Render state WINED3D_RS_COLORKEYBLENDENABLE not implemented yet.\n"); } static void state_swvp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - if (state->render_states[WINED3DRS_SOFTWAREVERTEXPROCESSING]) + if (state->render_states[WINED3D_RS_SOFTWAREVERTEXPROCESSING]) FIXME("Software vertex processing not implemented.\n"); } @@ -3112,7 +3112,7 @@ void tex_alphaop(struct wined3d_context *context, const struct wined3d_state *st arg2 = state->texture_states[stage][WINED3DTSS_ALPHAARG2]; arg0 = state->texture_states[stage][WINED3DTSS_ALPHAARG0]; - if (state->render_states[WINED3DRS_COLORKEYENABLE] && !stage && state->textures[0]) + if (state->render_states[WINED3D_RS_COLORKEYENABLE] && !stage && state->textures[0]) { struct wined3d_texture *texture = state->textures[0]; GLenum texture_dimensions = texture->target; @@ -3152,7 +3152,7 @@ void tex_alphaop(struct wined3d_context *context, const struct wined3d_state *st } else if(op == WINED3DTOP_SELECTARG1 && arg1 != WINED3DTA_TEXTURE) { - if (state->render_states[WINED3DRS_ALPHABLENDENABLE]) + if (state->render_states[WINED3D_RS_ALPHABLENDENABLE]) { arg2 = WINED3DTA_TEXTURE; op = WINED3DTOP_MODULATE; @@ -3161,7 +3161,7 @@ void tex_alphaop(struct wined3d_context *context, const struct wined3d_state *st } else if(op == WINED3DTOP_SELECTARG2 && arg2 != WINED3DTA_TEXTURE) { - if (state->render_states[WINED3DRS_ALPHABLENDENABLE]) + if (state->render_states[WINED3D_RS_ALPHABLENDENABLE]) { arg1 = WINED3DTA_TEXTURE; op = WINED3DTOP_MODULATE; @@ -3334,7 +3334,7 @@ static void tex_coordindex(struct wined3d_context *context, const struct wined3d * FIXME: When using generated texture coordinates, the index value is used to specify the wrapping mode. * eg. SetTextureStageState( 0, WINED3DTSS_TEXCOORDINDEX, WINED3DTSS_TCI_CAMERASPACEPOSITION | 1 ); * means use the vertex position (camera-space) as the input texture coordinates - * for this texture stage, and the wrap mode set in the WINED3DRS_WRAP1 render + * for this texture stage, and the wrap mode set in the WINED3D_RS_WRAP1 render * state. We do not (yet) support the WINED3DRENDERSTATE_WRAPx values, nor tie them up * to the TEXCOORDINDEX value */ @@ -3576,11 +3576,11 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state if (!use_ps(state) && sampler < state->lowest_disabled_stage) { - if (state->render_states[WINED3DRS_COLORKEYENABLE] && !sampler) + if (state->render_states[WINED3D_RS_COLORKEYENABLE] && !sampler) { /* If color keying is enabled update the alpha test, it * depends on the existence of a color key in stage 0. */ - state_alpha(context, state, WINED3DRS_COLORKEYENABLE); + state_alpha(context, state, WINED3D_RS_COLORKEYENABLE); } } @@ -3593,11 +3593,11 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state if (sampler < state->lowest_disabled_stage) { /* TODO: What should I do with pixel shaders here ??? */ - if (state->render_states[WINED3DRS_COLORKEYENABLE] && !sampler) + if (state->render_states[WINED3D_RS_COLORKEYENABLE] && !sampler) { /* If color keying is enabled update the alpha test, it * depends on the existence of a color key in stage 0. */ - state_alpha(context, state, WINED3DRS_COLORKEYENABLE); + state_alpha(context, state, WINED3D_RS_COLORKEYENABLE); } } /* Otherwise tex_colorop disables the stage */ context_bind_texture(context, GL_NONE, 0); @@ -3780,7 +3780,7 @@ static void transform_worldex(struct wined3d_context *context, const struct wine static void state_vertexblend_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - WINED3DVERTEXBLENDFLAGS f = state->render_states[WINED3DRS_VERTEXBLEND]; + WINED3DVERTEXBLENDFLAGS f = state->render_states[WINED3D_RS_VERTEXBLEND]; static unsigned int once; if (f == WINED3DVBF_DISABLE) return; @@ -3791,7 +3791,7 @@ static void state_vertexblend_w(struct wined3d_context *context, const struct wi static void state_vertexblend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - WINED3DVERTEXBLENDFLAGS val = state->render_states[WINED3DRS_VERTEXBLEND]; + WINED3DVERTEXBLENDFLAGS val = state->render_states[WINED3D_RS_VERTEXBLEND]; struct wined3d_device *device = context->swapchain->device; const struct wined3d_gl_info *gl_info = context->gl_info; static unsigned int once; @@ -3806,7 +3806,7 @@ static void state_vertexblend(struct wined3d_context *context, const struct wine /* D3D adds one more matrix which has weight (1 - sum(weights)). * This is enabled at context creation with enabling * GL_WEIGHT_SUM_UNITY_ARB. */ - GL_EXTCALL(glVertexBlendARB(state->render_states[WINED3DRS_VERTEXBLEND] + 1)); + GL_EXTCALL(glVertexBlendARB(state->render_states[WINED3D_RS_VERTEXBLEND] + 1)); if (!device->vertexBlendUsed) { @@ -4496,25 +4496,25 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine if (transformed != wasrhw && !isStateDirty(context, STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(0))) && !isStateDirty(context, STATE_TRANSFORM(WINED3DTS_VIEW))) transform_world(context, state, STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(0))); - if (!isStateDirty(context, STATE_RENDER(WINED3DRS_COLORVERTEX))) - state_colormat(context, state, STATE_RENDER(WINED3DRS_COLORVERTEX)); - if (!isStateDirty(context, STATE_RENDER(WINED3DRS_LIGHTING))) - state_lighting(context, state, STATE_RENDER(WINED3DRS_LIGHTING)); + if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_COLORVERTEX))) + state_colormat(context, state, STATE_RENDER(WINED3D_RS_COLORVERTEX)); + if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_LIGHTING))) + state_lighting(context, state, STATE_RENDER(WINED3D_RS_LIGHTING)); if (context->last_was_vshader) { updateFog = TRUE; - if (!device->vs_clipping && !isStateDirty(context, STATE_RENDER(WINED3DRS_CLIPPLANEENABLE))) - state_clipping(context, state, STATE_RENDER(WINED3DRS_CLIPPLANEENABLE)); + if (!device->vs_clipping && !isStateDirty(context, STATE_RENDER(WINED3D_RS_CLIPPLANEENABLE))) + state_clipping(context, state, STATE_RENDER(WINED3D_RS_CLIPPLANEENABLE)); for (i = 0; i < gl_info->limits.clipplanes; ++i) { clipplane(context, state, STATE_CLIPPLANE(i)); } } - if (!isStateDirty(context, STATE_RENDER(WINED3DRS_NORMALIZENORMALS))) - state_normalize(context, state, STATE_RENDER(WINED3DRS_NORMALIZENORMALS)); + if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_NORMALIZENORMALS))) + state_normalize(context, state, STATE_RENDER(WINED3D_RS_NORMALIZENORMALS)); } else { @@ -4530,7 +4530,7 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine checkGLcall("glDisable(GL_CLIP_PLANE0 + i)"); } - if (!warned && state->render_states[WINED3DRS_CLIPPLANEENABLE]) + if (!warned && state->render_states[WINED3D_RS_CLIPPLANEENABLE]) { FIXME("Clipping not supported with vertex shaders\n"); warned = TRUE; @@ -4577,7 +4577,7 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine context->last_was_vshader = useVertexShaderFunction; if (updateFog) - context_apply_state(context, state, STATE_RENDER(WINED3DRS_FOGVERTEXMODE)); + context_apply_state(context, state, STATE_RENDER(WINED3D_RS_FOGVERTEXMODE)); if (!useVertexShaderFunction) { @@ -4625,8 +4625,8 @@ static void viewport_vertexpart(struct wined3d_context *context, const struct wi { if (!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION))) transform_projection(context, state, STATE_TRANSFORM(WINED3DTS_PROJECTION)); - if (!isStateDirty(context, STATE_RENDER(WINED3DRS_POINTSCALEENABLE))) - state_pscale(context, state, STATE_RENDER(WINED3DRS_POINTSCALEENABLE)); + if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_POINTSCALEENABLE))) + state_pscale(context, state, STATE_RENDER(WINED3D_RS_POINTSCALEENABLE)); /* Update the position fixup. */ if (!isStateDirty(context, STATE_VERTEXSHADERCONSTANT)) shaderconstant(context, state, STATE_VERTEXSHADERCONSTANT); @@ -4832,16 +4832,16 @@ static void psorigin(struct wined3d_context *context, const struct wined3d_state } const struct StateEntryTemplate misc_state_template[] = { - { STATE_RENDER(WINED3DRS_SRCBLEND), { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_DESTBLEND), { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), state_blend }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_EDGEANTIALIAS), { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ANTIALIASEDLINEENABLE), { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_SEPARATEALPHABLENDENABLE), { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_SRCBLENDALPHA), { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_DESTBLENDALPHA), { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_DESTBLENDALPHA), { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_BLENDOPALPHA), { STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SRCBLEND), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { 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_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ANTIALIASEDLINEENABLE), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, 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 }, + { STATE_RENDER(WINED3D_RS_DESTBLENDALPHA), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_BLENDOPALPHA), { STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_STREAMSRC, { STATE_STREAMSRC, streamsrc }, WINED3D_GL_EXT_NONE }, { STATE_VDECL, { STATE_VDECL, vdecl_miscpart }, WINED3D_GL_EXT_NONE }, { STATE_FRONTFACE, { STATE_FRONTFACE, frontface }, WINED3D_GL_EXT_NONE }, @@ -4906,99 +4906,99 @@ const struct StateEntryTemplate misc_state_template[] = { { STATE_VIEWPORT, { STATE_VIEWPORT, viewport_miscpart }, WINED3D_GL_EXT_NONE }, { STATE_INDEXBUFFER, { STATE_INDEXBUFFER, indexbuffer }, ARB_VERTEX_BUFFER_OBJECT }, { STATE_INDEXBUFFER, { STATE_INDEXBUFFER, state_nop }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ANTIALIAS), { STATE_RENDER(WINED3DRS_ANTIALIAS), state_antialias }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_TEXTUREPERSPECTIVE), { STATE_RENDER(WINED3DRS_TEXTUREPERSPECTIVE), state_perspective }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ZENABLE), { STATE_RENDER(WINED3DRS_ZENABLE), state_zenable }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAPU), { STATE_RENDER(WINED3DRS_WRAPU), state_wrapu }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAPV), { STATE_RENDER(WINED3DRS_WRAPV), state_wrapv }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_FILLMODE), { STATE_RENDER(WINED3DRS_FILLMODE), state_fillmode }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_SHADEMODE), { STATE_RENDER(WINED3DRS_SHADEMODE), state_shademode }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_LINEPATTERN), { STATE_RENDER(WINED3DRS_LINEPATTERN), state_linepattern }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_MONOENABLE), { STATE_RENDER(WINED3DRS_MONOENABLE), state_monoenable }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ROP2), { STATE_RENDER(WINED3DRS_ROP2), state_rop2 }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_PLANEMASK), { STATE_RENDER(WINED3DRS_PLANEMASK), state_planemask }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ZWRITEENABLE), { STATE_RENDER(WINED3DRS_ZWRITEENABLE), state_zwritenable }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ALPHATESTENABLE), { STATE_RENDER(WINED3DRS_ALPHATESTENABLE), state_alpha }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ALPHAREF), { STATE_RENDER(WINED3DRS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ALPHAFUNC), { STATE_RENDER(WINED3DRS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_COLORKEYENABLE), { STATE_RENDER(WINED3DRS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_LASTPIXEL), { STATE_RENDER(WINED3DRS_LASTPIXEL), state_lastpixel }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_CULLMODE), { STATE_RENDER(WINED3DRS_CULLMODE), state_cullmode }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ZFUNC), { STATE_RENDER(WINED3DRS_ZFUNC), state_zfunc }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_DITHERENABLE), { STATE_RENDER(WINED3DRS_DITHERENABLE), state_ditherenable }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_SUBPIXEL), { STATE_RENDER(WINED3DRS_SUBPIXEL), state_subpixel }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_SUBPIXELX), { STATE_RENDER(WINED3DRS_SUBPIXELX), state_subpixelx }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_STIPPLEDALPHA), { STATE_RENDER(WINED3DRS_STIPPLEDALPHA), state_stippledalpha }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_STIPPLEENABLE), { STATE_RENDER(WINED3DRS_STIPPLEENABLE), state_stippleenable }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_MIPMAPLODBIAS), { STATE_RENDER(WINED3DRS_MIPMAPLODBIAS), state_mipmaplodbias }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ANISOTROPY), { STATE_RENDER(WINED3DRS_ANISOTROPY), state_anisotropy }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_FLUSHBATCH), { STATE_RENDER(WINED3DRS_FLUSHBATCH), state_flushbatch }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_TRANSLUCENTSORTINDEPENDENT), { STATE_RENDER(WINED3DRS_TRANSLUCENTSORTINDEPENDENT), state_translucentsi }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_STENCILENABLE), { STATE_RENDER(WINED3DRS_STENCILENABLE), state_stencil }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_STENCILFAIL), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_STENCILZFAIL), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_STENCILPASS), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_STENCILFUNC), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_STENCILREF), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_STENCILMASK), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_STENCILWRITEMASK), { STATE_RENDER(WINED3DRS_STENCILWRITEMASK), state_stencilwrite2s}, EXT_STENCIL_TWO_SIDE }, - { STATE_RENDER(WINED3DRS_STENCILWRITEMASK), { STATE_RENDER(WINED3DRS_STENCILWRITEMASK), state_stencilwrite }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_TWOSIDEDSTENCILMODE), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_CCW_STENCILFAIL), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_CCW_STENCILZFAIL), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_CCW_STENCILPASS), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_CCW_STENCILFUNC), { STATE_RENDER(WINED3DRS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP0), { STATE_RENDER(WINED3DRS_WRAP0), state_wrap }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP1), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP2), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP3), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP4), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP5), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP6), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP7), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP8), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP9), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP10), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP11), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP12), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP13), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP14), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_WRAP15), { STATE_RENDER(WINED3DRS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_EXTENTS), { STATE_RENDER(WINED3DRS_EXTENTS), state_extents }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_COLORKEYBLENDENABLE), { STATE_RENDER(WINED3DRS_COLORKEYBLENDENABLE), state_ckeyblend }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_SOFTWAREVERTEXPROCESSING), { STATE_RENDER(WINED3DRS_SOFTWAREVERTEXPROCESSING), state_swvp }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_PATCHEDGESTYLE), { STATE_RENDER(WINED3DRS_PATCHEDGESTYLE), state_patchedgestyle}, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_PATCHSEGMENTS), { STATE_RENDER(WINED3DRS_PATCHSEGMENTS), state_patchsegments }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_POSITIONDEGREE), { STATE_RENDER(WINED3DRS_POSITIONDEGREE), state_positiondegree}, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_NORMALDEGREE), { STATE_RENDER(WINED3DRS_NORMALDEGREE), state_normaldegree }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_MINTESSELLATIONLEVEL), { STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_MAXTESSELLATIONLEVEL), { STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ADAPTIVETESS_X), { STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ADAPTIVETESS_Y), { STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ADAPTIVETESS_Z), { STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ADAPTIVETESS_W), { STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION), { STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION), state_nvdb }, EXT_DEPTH_BOUNDS_TEST }, - { STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION), { STATE_RENDER(WINED3DRS_ENABLEADAPTIVETESSELLATION), state_tessellation }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3DRS_MULTISAMPLEANTIALIAS), state_msaa }, ARB_MULTISAMPLE }, - { STATE_RENDER(WINED3DRS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3DRS_MULTISAMPLEANTIALIAS), state_msaa_w }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_MULTISAMPLEMASK), { STATE_RENDER(WINED3DRS_MULTISAMPLEMASK), state_multisampmask }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3DRS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_COLORWRITEENABLE), { STATE_RENDER(WINED3DRS_COLORWRITEENABLE), state_colorwrite0 }, EXT_DRAW_BUFFERS2 }, - { STATE_RENDER(WINED3DRS_COLORWRITEENABLE), { STATE_RENDER(WINED3DRS_COLORWRITEENABLE), state_colorwrite }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_BLENDOP), { STATE_RENDER(WINED3DRS_BLENDOP), state_blendop }, EXT_BLEND_MINMAX }, - { STATE_RENDER(WINED3DRS_BLENDOP), { STATE_RENDER(WINED3DRS_BLENDOP), state_blendop_w }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_SCISSORTESTENABLE), { STATE_RENDER(WINED3DRS_SCISSORTESTENABLE), state_scissor }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_SLOPESCALEDEPTHBIAS), { STATE_RENDER(WINED3DRS_DEPTHBIAS), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_COLORWRITEENABLE1), { STATE_RENDER(WINED3DRS_COLORWRITEENABLE1), state_colorwrite1 }, EXT_DRAW_BUFFERS2 }, - { STATE_RENDER(WINED3DRS_COLORWRITEENABLE1), { STATE_RENDER(WINED3DRS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_COLORWRITEENABLE2), { STATE_RENDER(WINED3DRS_COLORWRITEENABLE2), state_colorwrite2 }, EXT_DRAW_BUFFERS2 }, - { STATE_RENDER(WINED3DRS_COLORWRITEENABLE2), { STATE_RENDER(WINED3DRS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_COLORWRITEENABLE3), { STATE_RENDER(WINED3DRS_COLORWRITEENABLE3), state_colorwrite3 }, EXT_DRAW_BUFFERS2 }, - { STATE_RENDER(WINED3DRS_COLORWRITEENABLE3), { STATE_RENDER(WINED3DRS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_BLENDFACTOR), { STATE_RENDER(WINED3DRS_BLENDFACTOR), state_blendfactor }, EXT_BLEND_COLOR }, - { STATE_RENDER(WINED3DRS_BLENDFACTOR), { STATE_RENDER(WINED3DRS_BLENDFACTOR), state_blendfactor_w }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_DEPTHBIAS), { STATE_RENDER(WINED3DRS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_ZVISIBLE), { STATE_RENDER(WINED3DRS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ANTIALIAS), { STATE_RENDER(WINED3D_RS_ANTIALIAS), state_antialias }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_TEXTUREPERSPECTIVE), { STATE_RENDER(WINED3D_RS_TEXTUREPERSPECTIVE), state_perspective }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ZENABLE), { STATE_RENDER(WINED3D_RS_ZENABLE), state_zenable }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAPU), { STATE_RENDER(WINED3D_RS_WRAPU), state_wrapu }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAPV), { STATE_RENDER(WINED3D_RS_WRAPV), state_wrapv }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_FILLMODE), { STATE_RENDER(WINED3D_RS_FILLMODE), state_fillmode }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SHADEMODE), { STATE_RENDER(WINED3D_RS_SHADEMODE), state_shademode }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_LINEPATTERN), { STATE_RENDER(WINED3D_RS_LINEPATTERN), state_linepattern }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_MONOENABLE), { STATE_RENDER(WINED3D_RS_MONOENABLE), state_monoenable }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ROP2), { STATE_RENDER(WINED3D_RS_ROP2), state_rop2 }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_PLANEMASK), { STATE_RENDER(WINED3D_RS_PLANEMASK), state_planemask }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ZWRITEENABLE), { STATE_RENDER(WINED3D_RS_ZWRITEENABLE), state_zwritenable }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), state_alpha }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ALPHAREF), { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ALPHAFUNC), { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_COLORKEYENABLE), { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_LASTPIXEL), { STATE_RENDER(WINED3D_RS_LASTPIXEL), state_lastpixel }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_CULLMODE), { STATE_RENDER(WINED3D_RS_CULLMODE), state_cullmode }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ZFUNC), { STATE_RENDER(WINED3D_RS_ZFUNC), state_zfunc }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_DITHERENABLE), { STATE_RENDER(WINED3D_RS_DITHERENABLE), state_ditherenable }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SUBPIXEL), { STATE_RENDER(WINED3D_RS_SUBPIXEL), state_subpixel }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SUBPIXELX), { STATE_RENDER(WINED3D_RS_SUBPIXELX), state_subpixelx }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_STIPPLEDALPHA), { STATE_RENDER(WINED3D_RS_STIPPLEDALPHA), state_stippledalpha }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_STIPPLEENABLE), { STATE_RENDER(WINED3D_RS_STIPPLEENABLE), state_stippleenable }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_MIPMAPLODBIAS), { STATE_RENDER(WINED3D_RS_MIPMAPLODBIAS), state_mipmaplodbias }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ANISOTROPY), { STATE_RENDER(WINED3D_RS_ANISOTROPY), state_anisotropy }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_FLUSHBATCH), { STATE_RENDER(WINED3D_RS_FLUSHBATCH), state_flushbatch }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_TRANSLUCENTSORTINDEPENDENT),{ STATE_RENDER(WINED3D_RS_TRANSLUCENTSORTINDEPENDENT),state_translucentsi }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_STENCILENABLE), { STATE_RENDER(WINED3D_RS_STENCILENABLE), state_stencil }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_STENCILFAIL), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_STENCILZFAIL), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_STENCILPASS), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_STENCILFUNC), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_STENCILREF), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_STENCILMASK), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_STENCILWRITEMASK), { STATE_RENDER(WINED3D_RS_STENCILWRITEMASK), state_stencilwrite2s}, EXT_STENCIL_TWO_SIDE }, + { STATE_RENDER(WINED3D_RS_STENCILWRITEMASK), { STATE_RENDER(WINED3D_RS_STENCILWRITEMASK), state_stencilwrite }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_TWOSIDEDSTENCILMODE), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_CCW_STENCILFAIL), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_CCW_STENCILZFAIL), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_CCW_STENCILPASS), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_CCW_STENCILFUNC), { STATE_RENDER(WINED3D_RS_STENCILENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP0), { STATE_RENDER(WINED3D_RS_WRAP0), state_wrap }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP1), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP2), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP3), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP4), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP5), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP6), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP7), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP8), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP9), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP10), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP11), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP12), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP13), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP14), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_WRAP15), { STATE_RENDER(WINED3D_RS_WRAP0), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_EXTENTS), { STATE_RENDER(WINED3D_RS_EXTENTS), state_extents }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_COLORKEYBLENDENABLE), { STATE_RENDER(WINED3D_RS_COLORKEYBLENDENABLE), state_ckeyblend }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SOFTWAREVERTEXPROCESSING), { STATE_RENDER(WINED3D_RS_SOFTWAREVERTEXPROCESSING), state_swvp }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_PATCHEDGESTYLE), { STATE_RENDER(WINED3D_RS_PATCHEDGESTYLE), state_patchedgestyle}, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_PATCHSEGMENTS), { STATE_RENDER(WINED3D_RS_PATCHSEGMENTS), state_patchsegments }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_POSITIONDEGREE), { STATE_RENDER(WINED3D_RS_POSITIONDEGREE), state_positiondegree}, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_NORMALDEGREE), { STATE_RENDER(WINED3D_RS_NORMALDEGREE), state_normaldegree }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_MINTESSELLATIONLEVEL), { STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION),NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_MAXTESSELLATIONLEVEL), { STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION),NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ADAPTIVETESS_X), { STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION),NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ADAPTIVETESS_Y), { STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION),NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ADAPTIVETESS_Z), { STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION),NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ADAPTIVETESS_W), { STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION),NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION),{ STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION),state_nvdb }, EXT_DEPTH_BOUNDS_TEST }, + { STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION),{ STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION),state_tessellation }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_msaa }, ARB_MULTISAMPLE }, + { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_msaa_w }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), { STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), state_multisampmask }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite0 }, EXT_DRAW_BUFFERS2 }, + { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), state_colorwrite }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop }, EXT_BLEND_MINMAX }, + { STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop_w }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE), { STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE), state_scissor }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SLOPESCALEDEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), state_colorwrite1 }, EXT_DRAW_BUFFERS2 }, + { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), state_colorwrite2 }, EXT_DRAW_BUFFERS2 }, + { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), state_colorwrite3 }, EXT_DRAW_BUFFERS2 }, + { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor }, EXT_BLEND_COLOR }, + { STATE_RENDER(WINED3D_RS_BLENDFACTOR), { STATE_RENDER(WINED3D_RS_BLENDFACTOR), state_blendfactor_w }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE }, /* Samplers */ { STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(1), { STATE_SAMPLER(1), sampler }, WINED3D_GL_EXT_NONE }, @@ -5030,8 +5030,8 @@ const struct StateEntryTemplate misc_state_template[] = { const struct StateEntryTemplate ffp_vertexstate_template[] = { { STATE_VDECL, { STATE_VDECL, vertexdeclaration }, WINED3D_GL_EXT_NONE }, { STATE_VSHADER, { STATE_VDECL, NULL }, WINED3D_GL_EXT_NONE }, - { STATE_MATERIAL, { STATE_RENDER(WINED3DRS_SPECULARENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_SPECULARENABLE), { STATE_RENDER(WINED3DRS_SPECULARENABLE), state_specularenable}, WINED3D_GL_EXT_NONE }, + { STATE_MATERIAL, { STATE_RENDER(WINED3D_RS_SPECULARENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SPECULARENABLE), { STATE_RENDER(WINED3D_RS_SPECULARENABLE), state_specularenable}, WINED3D_GL_EXT_NONE }, /* Clip planes */ { STATE_CLIPPLANE(0), { STATE_CLIPPLANE(0), clipplane }, WINED3D_GL_EXT_NONE }, { STATE_CLIPPLANE(1), { STATE_CLIPPLANE(1), clipplane }, WINED3D_GL_EXT_NONE }, @@ -5360,38 +5360,38 @@ const struct StateEntryTemplate ffp_vertexstate_template[] = { { STATE_TEXTURESTAGE(6, WINED3DTSS_TEXCOORDINDEX), { STATE_TEXTURESTAGE(6, WINED3DTSS_TEXCOORDINDEX), tex_coordindex }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3DTSS_TEXCOORDINDEX), { STATE_TEXTURESTAGE(7, WINED3DTSS_TEXCOORDINDEX), tex_coordindex }, WINED3D_GL_EXT_NONE }, /* Fog */ - { STATE_RENDER(WINED3DRS_FOGENABLE), { STATE_RENDER(WINED3DRS_FOGENABLE), state_fog_vertexpart}, 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_RANGEFOGENABLE), { STATE_RENDER(WINED3DRS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_CLIPPING), { STATE_RENDER(WINED3DRS_CLIPPING), state_clipping }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_CLIPPLANEENABLE), { STATE_RENDER(WINED3DRS_CLIPPING), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_LIGHTING), { STATE_RENDER(WINED3DRS_LIGHTING), state_lighting }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_AMBIENT), { STATE_RENDER(WINED3DRS_AMBIENT), state_ambient }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_COLORVERTEX), { STATE_RENDER(WINED3DRS_COLORVERTEX), state_colormat }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_LOCALVIEWER), { STATE_RENDER(WINED3DRS_LOCALVIEWER), state_localviewer }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_NORMALIZENORMALS), { STATE_RENDER(WINED3DRS_NORMALIZENORMALS), state_normalize }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_DIFFUSEMATERIALSOURCE), { STATE_RENDER(WINED3DRS_COLORVERTEX), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_SPECULARMATERIALSOURCE), { STATE_RENDER(WINED3DRS_COLORVERTEX), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_AMBIENTMATERIALSOURCE), { STATE_RENDER(WINED3DRS_COLORVERTEX), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_EMISSIVEMATERIALSOURCE), { STATE_RENDER(WINED3DRS_COLORVERTEX), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_VERTEXBLEND), { STATE_RENDER(WINED3DRS_VERTEXBLEND), state_vertexblend }, ARB_VERTEX_BLEND }, - { STATE_RENDER(WINED3DRS_VERTEXBLEND), { STATE_RENDER(WINED3DRS_VERTEXBLEND), state_vertexblend_w }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_POINTSIZE), { STATE_RENDER(WINED3DRS_POINTSCALEENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), state_psizemin_arb }, ARB_POINT_PARAMETERS }, - { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), state_psizemin_ext }, EXT_POINT_PARAMETERS }, - { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), state_psizemin_w }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_POINTSPRITEENABLE), { STATE_RENDER(WINED3DRS_POINTSPRITEENABLE), state_pointsprite }, ARB_POINT_SPRITE }, - { STATE_RENDER(WINED3DRS_POINTSPRITEENABLE), { STATE_RENDER(WINED3DRS_POINTSPRITEENABLE), state_pointsprite_w }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_POINTSCALEENABLE), { STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_POINTSCALE_A), { STATE_RENDER(WINED3DRS_POINTSCALEENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_POINTSCALE_B), { STATE_RENDER(WINED3DRS_POINTSCALEENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_POINTSCALE_C), { STATE_RENDER(WINED3DRS_POINTSCALEENABLE), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), NULL }, ARB_POINT_PARAMETERS }, - { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), NULL }, EXT_POINT_PARAMETERS }, - { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_TWEENFACTOR), { STATE_RENDER(WINED3DRS_VERTEXBLEND), NULL }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3DRS_INDEXEDVERTEXBLENDENABLE), { STATE_RENDER(WINED3DRS_VERTEXBLEND), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_FOGENABLE), { STATE_RENDER(WINED3D_RS_FOGENABLE), state_fog_vertexpart}, 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_RANGEFOGENABLE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_CLIPPING), { STATE_RENDER(WINED3D_RS_CLIPPING), state_clipping }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_CLIPPLANEENABLE), { STATE_RENDER(WINED3D_RS_CLIPPING), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_LIGHTING), { STATE_RENDER(WINED3D_RS_LIGHTING), state_lighting }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_AMBIENT), { STATE_RENDER(WINED3D_RS_AMBIENT), state_ambient }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_COLORVERTEX), { STATE_RENDER(WINED3D_RS_COLORVERTEX), state_colormat }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_LOCALVIEWER), { STATE_RENDER(WINED3D_RS_LOCALVIEWER), state_localviewer }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_NORMALIZENORMALS), { STATE_RENDER(WINED3D_RS_NORMALIZENORMALS), state_normalize }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_DIFFUSEMATERIALSOURCE), { STATE_RENDER(WINED3D_RS_COLORVERTEX), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SPECULARMATERIALSOURCE), { STATE_RENDER(WINED3D_RS_COLORVERTEX), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_AMBIENTMATERIALSOURCE), { STATE_RENDER(WINED3D_RS_COLORVERTEX), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_EMISSIVEMATERIALSOURCE), { STATE_RENDER(WINED3D_RS_COLORVERTEX), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_VERTEXBLEND), { STATE_RENDER(WINED3D_RS_VERTEXBLEND), state_vertexblend }, ARB_VERTEX_BLEND }, + { STATE_RENDER(WINED3D_RS_VERTEXBLEND), { STATE_RENDER(WINED3D_RS_VERTEXBLEND), state_vertexblend_w }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_POINTSIZE), { STATE_RENDER(WINED3D_RS_POINTSCALEENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), { STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), state_psizemin_arb }, ARB_POINT_PARAMETERS }, + { STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), { STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), state_psizemin_ext }, EXT_POINT_PARAMETERS }, + { STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), { STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), state_psizemin_w }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), { STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), state_pointsprite }, ARB_POINT_SPRITE }, + { STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), { STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), state_pointsprite_w }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_POINTSCALEENABLE), { STATE_RENDER(WINED3D_RS_POINTSCALEENABLE), state_pscale }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_POINTSCALE_A), { STATE_RENDER(WINED3D_RS_POINTSCALEENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_POINTSCALE_B), { STATE_RENDER(WINED3D_RS_POINTSCALEENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_POINTSCALE_C), { STATE_RENDER(WINED3D_RS_POINTSCALEENABLE), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_POINTSIZE_MAX), { STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), NULL }, ARB_POINT_PARAMETERS }, + { STATE_RENDER(WINED3D_RS_POINTSIZE_MAX), { STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), NULL }, EXT_POINT_PARAMETERS }, + { STATE_RENDER(WINED3D_RS_POINTSIZE_MAX), { STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_TWEENFACTOR), { STATE_RENDER(WINED3D_RS_VERTEXBLEND), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_INDEXEDVERTEXBLENDENABLE), { STATE_RENDER(WINED3D_RS_VERTEXBLEND), NULL }, WINED3D_GL_EXT_NONE }, /* Samplers for NP2 texture matrix adjustions. They are not needed if GL_ARB_texture_non_power_of_two is supported, * so register a NULL state handler in that case to get the vertex part of sampler() skipped(VTF is handled in the misc states. @@ -5506,15 +5506,15 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = { { STATE_TEXTURESTAGE(7, WINED3DTSS_RESULTARG), { STATE_TEXTURESTAGE(7, WINED3DTSS_COLOROP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(7, WINED3DTSS_CONSTANT), { 0 /* As long as we don't support D3DTA_CONSTANT */, 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), state_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), state_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), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(1), { STATE_SAMPLER(1), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(2), { STATE_SAMPLER(2), sampler_texdim }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index e29bbdce992..adea6bb651a 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -29,66 +29,66 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); static const DWORD pixel_states_render[] = { - WINED3DRS_ALPHABLENDENABLE, - WINED3DRS_ALPHAFUNC, - WINED3DRS_ALPHAREF, - WINED3DRS_ALPHATESTENABLE, - WINED3DRS_ANTIALIASEDLINEENABLE, - WINED3DRS_BLENDFACTOR, - WINED3DRS_BLENDOP, - WINED3DRS_BLENDOPALPHA, - WINED3DRS_CCW_STENCILFAIL, - WINED3DRS_CCW_STENCILPASS, - WINED3DRS_CCW_STENCILZFAIL, - WINED3DRS_COLORWRITEENABLE, - WINED3DRS_COLORWRITEENABLE1, - WINED3DRS_COLORWRITEENABLE2, - WINED3DRS_COLORWRITEENABLE3, - WINED3DRS_DEPTHBIAS, - WINED3DRS_DESTBLEND, - WINED3DRS_DESTBLENDALPHA, - WINED3DRS_DITHERENABLE, - WINED3DRS_FILLMODE, - WINED3DRS_FOGDENSITY, - WINED3DRS_FOGEND, - WINED3DRS_FOGSTART, - WINED3DRS_LASTPIXEL, - WINED3DRS_SCISSORTESTENABLE, - WINED3DRS_SEPARATEALPHABLENDENABLE, - WINED3DRS_SHADEMODE, - WINED3DRS_SLOPESCALEDEPTHBIAS, - WINED3DRS_SRCBLEND, - WINED3DRS_SRCBLENDALPHA, - WINED3DRS_SRGBWRITEENABLE, - WINED3DRS_STENCILENABLE, - WINED3DRS_STENCILFAIL, - WINED3DRS_STENCILFUNC, - WINED3DRS_STENCILMASK, - WINED3DRS_STENCILPASS, - WINED3DRS_STENCILREF, - WINED3DRS_STENCILWRITEMASK, - WINED3DRS_STENCILZFAIL, - WINED3DRS_TEXTUREFACTOR, - WINED3DRS_TWOSIDEDSTENCILMODE, - WINED3DRS_WRAP0, - WINED3DRS_WRAP1, - WINED3DRS_WRAP10, - WINED3DRS_WRAP11, - WINED3DRS_WRAP12, - WINED3DRS_WRAP13, - WINED3DRS_WRAP14, - WINED3DRS_WRAP15, - WINED3DRS_WRAP2, - WINED3DRS_WRAP3, - WINED3DRS_WRAP4, - WINED3DRS_WRAP5, - WINED3DRS_WRAP6, - WINED3DRS_WRAP7, - WINED3DRS_WRAP8, - WINED3DRS_WRAP9, - WINED3DRS_ZENABLE, - WINED3DRS_ZFUNC, - WINED3DRS_ZWRITEENABLE, + WINED3D_RS_ALPHABLENDENABLE, + WINED3D_RS_ALPHAFUNC, + WINED3D_RS_ALPHAREF, + WINED3D_RS_ALPHATESTENABLE, + WINED3D_RS_ANTIALIASEDLINEENABLE, + WINED3D_RS_BLENDFACTOR, + WINED3D_RS_BLENDOP, + WINED3D_RS_BLENDOPALPHA, + WINED3D_RS_CCW_STENCILFAIL, + WINED3D_RS_CCW_STENCILPASS, + WINED3D_RS_CCW_STENCILZFAIL, + WINED3D_RS_COLORWRITEENABLE, + WINED3D_RS_COLORWRITEENABLE1, + WINED3D_RS_COLORWRITEENABLE2, + WINED3D_RS_COLORWRITEENABLE3, + WINED3D_RS_DEPTHBIAS, + WINED3D_RS_DESTBLEND, + WINED3D_RS_DESTBLENDALPHA, + WINED3D_RS_DITHERENABLE, + WINED3D_RS_FILLMODE, + WINED3D_RS_FOGDENSITY, + WINED3D_RS_FOGEND, + WINED3D_RS_FOGSTART, + WINED3D_RS_LASTPIXEL, + WINED3D_RS_SCISSORTESTENABLE, + WINED3D_RS_SEPARATEALPHABLENDENABLE, + WINED3D_RS_SHADEMODE, + WINED3D_RS_SLOPESCALEDEPTHBIAS, + WINED3D_RS_SRCBLEND, + WINED3D_RS_SRCBLENDALPHA, + WINED3D_RS_SRGBWRITEENABLE, + WINED3D_RS_STENCILENABLE, + WINED3D_RS_STENCILFAIL, + WINED3D_RS_STENCILFUNC, + WINED3D_RS_STENCILMASK, + WINED3D_RS_STENCILPASS, + WINED3D_RS_STENCILREF, + WINED3D_RS_STENCILWRITEMASK, + WINED3D_RS_STENCILZFAIL, + WINED3D_RS_TEXTUREFACTOR, + WINED3D_RS_TWOSIDEDSTENCILMODE, + WINED3D_RS_WRAP0, + WINED3D_RS_WRAP1, + WINED3D_RS_WRAP10, + WINED3D_RS_WRAP11, + WINED3D_RS_WRAP12, + WINED3D_RS_WRAP13, + WINED3D_RS_WRAP14, + WINED3D_RS_WRAP15, + WINED3D_RS_WRAP2, + WINED3D_RS_WRAP3, + WINED3D_RS_WRAP4, + WINED3D_RS_WRAP5, + WINED3D_RS_WRAP6, + WINED3D_RS_WRAP7, + WINED3D_RS_WRAP8, + WINED3D_RS_WRAP9, + WINED3D_RS_ZENABLE, + WINED3D_RS_ZFUNC, + WINED3D_RS_ZWRITEENABLE, }; static const DWORD pixel_states_texture[] = @@ -130,51 +130,51 @@ static const DWORD pixel_states_sampler[] = static const DWORD vertex_states_render[] = { - WINED3DRS_ADAPTIVETESS_W, - WINED3DRS_ADAPTIVETESS_X, - WINED3DRS_ADAPTIVETESS_Y, - WINED3DRS_ADAPTIVETESS_Z, - WINED3DRS_AMBIENT, - WINED3DRS_AMBIENTMATERIALSOURCE, - WINED3DRS_CLIPPING, - WINED3DRS_CLIPPLANEENABLE, - WINED3DRS_COLORVERTEX, - WINED3DRS_CULLMODE, - WINED3DRS_DIFFUSEMATERIALSOURCE, - WINED3DRS_EMISSIVEMATERIALSOURCE, - WINED3DRS_ENABLEADAPTIVETESSELLATION, - WINED3DRS_FOGCOLOR, - WINED3DRS_FOGDENSITY, - WINED3DRS_FOGENABLE, - WINED3DRS_FOGEND, - WINED3DRS_FOGSTART, - WINED3DRS_FOGTABLEMODE, - WINED3DRS_FOGVERTEXMODE, - WINED3DRS_INDEXEDVERTEXBLENDENABLE, - WINED3DRS_LIGHTING, - WINED3DRS_LOCALVIEWER, - WINED3DRS_MAXTESSELLATIONLEVEL, - WINED3DRS_MINTESSELLATIONLEVEL, - WINED3DRS_MULTISAMPLEANTIALIAS, - WINED3DRS_MULTISAMPLEMASK, - WINED3DRS_NORMALDEGREE, - WINED3DRS_NORMALIZENORMALS, - WINED3DRS_PATCHEDGESTYLE, - WINED3DRS_POINTSCALE_A, - WINED3DRS_POINTSCALE_B, - WINED3DRS_POINTSCALE_C, - WINED3DRS_POINTSCALEENABLE, - WINED3DRS_POINTSIZE, - WINED3DRS_POINTSIZE_MAX, - WINED3DRS_POINTSIZE_MIN, - WINED3DRS_POINTSPRITEENABLE, - WINED3DRS_POSITIONDEGREE, - WINED3DRS_RANGEFOGENABLE, - WINED3DRS_SHADEMODE, - WINED3DRS_SPECULARENABLE, - WINED3DRS_SPECULARMATERIALSOURCE, - WINED3DRS_TWEENFACTOR, - WINED3DRS_VERTEXBLEND, + WINED3D_RS_ADAPTIVETESS_W, + WINED3D_RS_ADAPTIVETESS_X, + WINED3D_RS_ADAPTIVETESS_Y, + WINED3D_RS_ADAPTIVETESS_Z, + WINED3D_RS_AMBIENT, + WINED3D_RS_AMBIENTMATERIALSOURCE, + WINED3D_RS_CLIPPING, + WINED3D_RS_CLIPPLANEENABLE, + WINED3D_RS_COLORVERTEX, + WINED3D_RS_CULLMODE, + WINED3D_RS_DIFFUSEMATERIALSOURCE, + WINED3D_RS_EMISSIVEMATERIALSOURCE, + WINED3D_RS_ENABLEADAPTIVETESSELLATION, + WINED3D_RS_FOGCOLOR, + WINED3D_RS_FOGDENSITY, + WINED3D_RS_FOGENABLE, + WINED3D_RS_FOGEND, + WINED3D_RS_FOGSTART, + WINED3D_RS_FOGTABLEMODE, + WINED3D_RS_FOGVERTEXMODE, + WINED3D_RS_INDEXEDVERTEXBLENDENABLE, + WINED3D_RS_LIGHTING, + WINED3D_RS_LOCALVIEWER, + WINED3D_RS_MAXTESSELLATIONLEVEL, + WINED3D_RS_MINTESSELLATIONLEVEL, + WINED3D_RS_MULTISAMPLEANTIALIAS, + WINED3D_RS_MULTISAMPLEMASK, + WINED3D_RS_NORMALDEGREE, + WINED3D_RS_NORMALIZENORMALS, + WINED3D_RS_PATCHEDGESTYLE, + WINED3D_RS_POINTSCALE_A, + WINED3D_RS_POINTSCALE_B, + WINED3D_RS_POINTSCALE_C, + WINED3D_RS_POINTSCALEENABLE, + WINED3D_RS_POINTSIZE, + WINED3D_RS_POINTSIZE_MAX, + WINED3D_RS_POINTSIZE_MIN, + WINED3D_RS_POINTSPRITEENABLE, + WINED3D_RS_POSITIONDEGREE, + WINED3D_RS_RANGEFOGENABLE, + WINED3D_RS_SHADEMODE, + WINED3D_RS_SPECULARENABLE, + WINED3D_RS_SPECULARMATERIALSOURCE, + WINED3D_RS_TWEENFACTOR, + WINED3D_RS_VERTEXBLEND, }; static const DWORD vertex_states_texture[] = @@ -838,7 +838,7 @@ HRESULT CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) /* Render */ for (i = 0; i < stateblock->num_contained_render_states; ++i) { - WINED3DRENDERSTATETYPE rs = stateblock->contained_render_states[i]; + enum wined3d_render_state rs = stateblock->contained_render_states[i]; TRACE("Updating render state %#x to %u.\n", rs, src_state->render_states[rs]); @@ -1120,134 +1120,134 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock) TRACE("Render states\n"); /* Render states: */ if (device->auto_depth_stencil) - state->render_states[WINED3DRS_ZENABLE] = WINED3DZB_TRUE; + state->render_states[WINED3D_RS_ZENABLE] = WINED3DZB_TRUE; else - state->render_states[WINED3DRS_ZENABLE] = WINED3DZB_FALSE; - state->render_states[WINED3DRS_FILLMODE] = WINED3DFILL_SOLID; - state->render_states[WINED3DRS_SHADEMODE] = WINED3DSHADE_GOURAUD; + state->render_states[WINED3D_RS_ZENABLE] = WINED3DZB_FALSE; + state->render_states[WINED3D_RS_FILLMODE] = WINED3DFILL_SOLID; + state->render_states[WINED3D_RS_SHADEMODE] = WINED3DSHADE_GOURAUD; lp.lp.repeat_factor = 0; lp.lp.line_pattern = 0; - state->render_states[WINED3DRS_LINEPATTERN] = lp.d; - state->render_states[WINED3DRS_ZWRITEENABLE] = TRUE; - state->render_states[WINED3DRS_ALPHATESTENABLE] = FALSE; - state->render_states[WINED3DRS_LASTPIXEL] = TRUE; - state->render_states[WINED3DRS_SRCBLEND] = WINED3D_BLEND_ONE; - state->render_states[WINED3DRS_DESTBLEND] = WINED3D_BLEND_ZERO; - state->render_states[WINED3DRS_CULLMODE] = WINED3DCULL_CCW; - state->render_states[WINED3DRS_ZFUNC] = WINED3DCMP_LESSEQUAL; - state->render_states[WINED3DRS_ALPHAFUNC] = WINED3DCMP_ALWAYS; - state->render_states[WINED3DRS_ALPHAREF] = 0; - state->render_states[WINED3DRS_DITHERENABLE] = FALSE; - state->render_states[WINED3DRS_ALPHABLENDENABLE] = FALSE; - state->render_states[WINED3DRS_FOGENABLE] = FALSE; - state->render_states[WINED3DRS_SPECULARENABLE] = FALSE; - state->render_states[WINED3DRS_ZVISIBLE] = 0; - state->render_states[WINED3DRS_FOGCOLOR] = 0; - state->render_states[WINED3DRS_FOGTABLEMODE] = WINED3DFOG_NONE; + state->render_states[WINED3D_RS_LINEPATTERN] = lp.d; + state->render_states[WINED3D_RS_ZWRITEENABLE] = TRUE; + state->render_states[WINED3D_RS_ALPHATESTENABLE] = FALSE; + state->render_states[WINED3D_RS_LASTPIXEL] = TRUE; + state->render_states[WINED3D_RS_SRCBLEND] = WINED3D_BLEND_ONE; + state->render_states[WINED3D_RS_DESTBLEND] = WINED3D_BLEND_ZERO; + state->render_states[WINED3D_RS_CULLMODE] = WINED3DCULL_CCW; + state->render_states[WINED3D_RS_ZFUNC] = WINED3DCMP_LESSEQUAL; + state->render_states[WINED3D_RS_ALPHAFUNC] = WINED3DCMP_ALWAYS; + state->render_states[WINED3D_RS_ALPHAREF] = 0; + state->render_states[WINED3D_RS_DITHERENABLE] = FALSE; + state->render_states[WINED3D_RS_ALPHABLENDENABLE] = FALSE; + state->render_states[WINED3D_RS_FOGENABLE] = FALSE; + state->render_states[WINED3D_RS_SPECULARENABLE] = FALSE; + state->render_states[WINED3D_RS_ZVISIBLE] = 0; + state->render_states[WINED3D_RS_FOGCOLOR] = 0; + state->render_states[WINED3D_RS_FOGTABLEMODE] = WINED3DFOG_NONE; tmpfloat.f = 0.0f; - state->render_states[WINED3DRS_FOGSTART] = tmpfloat.d; + state->render_states[WINED3D_RS_FOGSTART] = tmpfloat.d; tmpfloat.f = 1.0f; - state->render_states[WINED3DRS_FOGEND] = tmpfloat.d; + state->render_states[WINED3D_RS_FOGEND] = tmpfloat.d; tmpfloat.f = 1.0f; - state->render_states[WINED3DRS_FOGDENSITY] = tmpfloat.d; - state->render_states[WINED3DRS_EDGEANTIALIAS] = FALSE; - state->render_states[WINED3DRS_RANGEFOGENABLE] = FALSE; - state->render_states[WINED3DRS_STENCILENABLE] = FALSE; - state->render_states[WINED3DRS_STENCILFAIL] = WINED3DSTENCILOP_KEEP; - state->render_states[WINED3DRS_STENCILZFAIL] = WINED3DSTENCILOP_KEEP; - state->render_states[WINED3DRS_STENCILPASS] = WINED3DSTENCILOP_KEEP; - state->render_states[WINED3DRS_STENCILREF] = 0; - state->render_states[WINED3DRS_STENCILMASK] = 0xffffffff; - state->render_states[WINED3DRS_STENCILFUNC] = WINED3DCMP_ALWAYS; - state->render_states[WINED3DRS_STENCILWRITEMASK] = 0xffffffff; - state->render_states[WINED3DRS_TEXTUREFACTOR] = 0xffffffff; - state->render_states[WINED3DRS_WRAP0] = 0; - state->render_states[WINED3DRS_WRAP1] = 0; - state->render_states[WINED3DRS_WRAP2] = 0; - state->render_states[WINED3DRS_WRAP3] = 0; - state->render_states[WINED3DRS_WRAP4] = 0; - state->render_states[WINED3DRS_WRAP5] = 0; - state->render_states[WINED3DRS_WRAP6] = 0; - state->render_states[WINED3DRS_WRAP7] = 0; - state->render_states[WINED3DRS_CLIPPING] = TRUE; - state->render_states[WINED3DRS_LIGHTING] = TRUE; - state->render_states[WINED3DRS_AMBIENT] = 0; - state->render_states[WINED3DRS_FOGVERTEXMODE] = WINED3DFOG_NONE; - state->render_states[WINED3DRS_COLORVERTEX] = TRUE; - state->render_states[WINED3DRS_LOCALVIEWER] = TRUE; - state->render_states[WINED3DRS_NORMALIZENORMALS] = FALSE; - state->render_states[WINED3DRS_DIFFUSEMATERIALSOURCE] = WINED3DMCS_COLOR1; - state->render_states[WINED3DRS_SPECULARMATERIALSOURCE] = WINED3DMCS_COLOR2; - state->render_states[WINED3DRS_AMBIENTMATERIALSOURCE] = WINED3DMCS_MATERIAL; - state->render_states[WINED3DRS_EMISSIVEMATERIALSOURCE] = WINED3DMCS_MATERIAL; - state->render_states[WINED3DRS_VERTEXBLEND] = WINED3DVBF_DISABLE; - state->render_states[WINED3DRS_CLIPPLANEENABLE] = 0; - state->render_states[WINED3DRS_SOFTWAREVERTEXPROCESSING] = FALSE; + state->render_states[WINED3D_RS_FOGDENSITY] = tmpfloat.d; + state->render_states[WINED3D_RS_EDGEANTIALIAS] = FALSE; + state->render_states[WINED3D_RS_RANGEFOGENABLE] = FALSE; + state->render_states[WINED3D_RS_STENCILENABLE] = FALSE; + state->render_states[WINED3D_RS_STENCILFAIL] = WINED3DSTENCILOP_KEEP; + state->render_states[WINED3D_RS_STENCILZFAIL] = WINED3DSTENCILOP_KEEP; + state->render_states[WINED3D_RS_STENCILPASS] = WINED3DSTENCILOP_KEEP; + state->render_states[WINED3D_RS_STENCILREF] = 0; + state->render_states[WINED3D_RS_STENCILMASK] = 0xffffffff; + state->render_states[WINED3D_RS_STENCILFUNC] = WINED3DCMP_ALWAYS; + state->render_states[WINED3D_RS_STENCILWRITEMASK] = 0xffffffff; + state->render_states[WINED3D_RS_TEXTUREFACTOR] = 0xffffffff; + state->render_states[WINED3D_RS_WRAP0] = 0; + state->render_states[WINED3D_RS_WRAP1] = 0; + state->render_states[WINED3D_RS_WRAP2] = 0; + state->render_states[WINED3D_RS_WRAP3] = 0; + state->render_states[WINED3D_RS_WRAP4] = 0; + state->render_states[WINED3D_RS_WRAP5] = 0; + state->render_states[WINED3D_RS_WRAP6] = 0; + state->render_states[WINED3D_RS_WRAP7] = 0; + state->render_states[WINED3D_RS_CLIPPING] = TRUE; + state->render_states[WINED3D_RS_LIGHTING] = TRUE; + state->render_states[WINED3D_RS_AMBIENT] = 0; + state->render_states[WINED3D_RS_FOGVERTEXMODE] = WINED3DFOG_NONE; + state->render_states[WINED3D_RS_COLORVERTEX] = TRUE; + state->render_states[WINED3D_RS_LOCALVIEWER] = TRUE; + state->render_states[WINED3D_RS_NORMALIZENORMALS] = FALSE; + state->render_states[WINED3D_RS_DIFFUSEMATERIALSOURCE] = WINED3DMCS_COLOR1; + state->render_states[WINED3D_RS_SPECULARMATERIALSOURCE] = WINED3DMCS_COLOR2; + state->render_states[WINED3D_RS_AMBIENTMATERIALSOURCE] = WINED3DMCS_MATERIAL; + state->render_states[WINED3D_RS_EMISSIVEMATERIALSOURCE] = WINED3DMCS_MATERIAL; + state->render_states[WINED3D_RS_VERTEXBLEND] = WINED3DVBF_DISABLE; + state->render_states[WINED3D_RS_CLIPPLANEENABLE] = 0; + state->render_states[WINED3D_RS_SOFTWAREVERTEXPROCESSING] = FALSE; tmpfloat.f = 1.0f; - state->render_states[WINED3DRS_POINTSIZE] = tmpfloat.d; + state->render_states[WINED3D_RS_POINTSIZE] = tmpfloat.d; tmpfloat.f = 1.0f; - state->render_states[WINED3DRS_POINTSIZE_MIN] = tmpfloat.d; - state->render_states[WINED3DRS_POINTSPRITEENABLE] = FALSE; - state->render_states[WINED3DRS_POINTSCALEENABLE] = FALSE; + state->render_states[WINED3D_RS_POINTSIZE_MIN] = tmpfloat.d; + state->render_states[WINED3D_RS_POINTSPRITEENABLE] = FALSE; + state->render_states[WINED3D_RS_POINTSCALEENABLE] = FALSE; tmpfloat.f = 1.0f; - state->render_states[WINED3DRS_POINTSCALE_A] = tmpfloat.d; + state->render_states[WINED3D_RS_POINTSCALE_A] = tmpfloat.d; tmpfloat.f = 0.0f; - state->render_states[WINED3DRS_POINTSCALE_B] = tmpfloat.d; + state->render_states[WINED3D_RS_POINTSCALE_B] = tmpfloat.d; tmpfloat.f = 0.0f; - state->render_states[WINED3DRS_POINTSCALE_C] = tmpfloat.d; - state->render_states[WINED3DRS_MULTISAMPLEANTIALIAS] = TRUE; - state->render_states[WINED3DRS_MULTISAMPLEMASK] = 0xffffffff; - state->render_states[WINED3DRS_PATCHEDGESTYLE] = WINED3DPATCHEDGE_DISCRETE; + state->render_states[WINED3D_RS_POINTSCALE_C] = tmpfloat.d; + state->render_states[WINED3D_RS_MULTISAMPLEANTIALIAS] = TRUE; + state->render_states[WINED3D_RS_MULTISAMPLEMASK] = 0xffffffff; + state->render_states[WINED3D_RS_PATCHEDGESTYLE] = WINED3DPATCHEDGE_DISCRETE; tmpfloat.f = 1.0f; - state->render_states[WINED3DRS_PATCHSEGMENTS] = tmpfloat.d; - state->render_states[WINED3DRS_DEBUGMONITORTOKEN] = 0xbaadcafe; + state->render_states[WINED3D_RS_PATCHSEGMENTS] = tmpfloat.d; + state->render_states[WINED3D_RS_DEBUGMONITORTOKEN] = 0xbaadcafe; tmpfloat.f = gl_info->limits.pointsize_max; - state->render_states[WINED3DRS_POINTSIZE_MAX] = tmpfloat.d; - state->render_states[WINED3DRS_INDEXEDVERTEXBLENDENABLE] = FALSE; - state->render_states[WINED3DRS_COLORWRITEENABLE] = 0x0000000f; + state->render_states[WINED3D_RS_POINTSIZE_MAX] = tmpfloat.d; + state->render_states[WINED3D_RS_INDEXEDVERTEXBLENDENABLE] = FALSE; + state->render_states[WINED3D_RS_COLORWRITEENABLE] = 0x0000000f; tmpfloat.f = 0.0f; - state->render_states[WINED3DRS_TWEENFACTOR] = tmpfloat.d; - state->render_states[WINED3DRS_BLENDOP] = WINED3D_BLEND_OP_ADD; - state->render_states[WINED3DRS_POSITIONDEGREE] = WINED3D_DEGREE_CUBIC; - state->render_states[WINED3DRS_NORMALDEGREE] = WINED3D_DEGREE_LINEAR; + state->render_states[WINED3D_RS_TWEENFACTOR] = tmpfloat.d; + state->render_states[WINED3D_RS_BLENDOP] = WINED3D_BLEND_OP_ADD; + state->render_states[WINED3D_RS_POSITIONDEGREE] = WINED3D_DEGREE_CUBIC; + state->render_states[WINED3D_RS_NORMALDEGREE] = WINED3D_DEGREE_LINEAR; /* states new in d3d9 */ - state->render_states[WINED3DRS_SCISSORTESTENABLE] = FALSE; - state->render_states[WINED3DRS_SLOPESCALEDEPTHBIAS] = 0; + state->render_states[WINED3D_RS_SCISSORTESTENABLE] = FALSE; + state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS] = 0; tmpfloat.f = 1.0f; - state->render_states[WINED3DRS_MINTESSELLATIONLEVEL] = tmpfloat.d; - state->render_states[WINED3DRS_MAXTESSELLATIONLEVEL] = tmpfloat.d; - state->render_states[WINED3DRS_ANTIALIASEDLINEENABLE] = FALSE; + state->render_states[WINED3D_RS_MINTESSELLATIONLEVEL] = tmpfloat.d; + state->render_states[WINED3D_RS_MAXTESSELLATIONLEVEL] = tmpfloat.d; + state->render_states[WINED3D_RS_ANTIALIASEDLINEENABLE] = FALSE; tmpfloat.f = 0.0f; - state->render_states[WINED3DRS_ADAPTIVETESS_X] = tmpfloat.d; - state->render_states[WINED3DRS_ADAPTIVETESS_Y] = tmpfloat.d; + state->render_states[WINED3D_RS_ADAPTIVETESS_X] = tmpfloat.d; + state->render_states[WINED3D_RS_ADAPTIVETESS_Y] = tmpfloat.d; tmpfloat.f = 1.0f; - state->render_states[WINED3DRS_ADAPTIVETESS_Z] = tmpfloat.d; + state->render_states[WINED3D_RS_ADAPTIVETESS_Z] = tmpfloat.d; tmpfloat.f = 0.0f; - state->render_states[WINED3DRS_ADAPTIVETESS_W] = tmpfloat.d; - state->render_states[WINED3DRS_ENABLEADAPTIVETESSELLATION] = FALSE; - state->render_states[WINED3DRS_TWOSIDEDSTENCILMODE] = FALSE; - state->render_states[WINED3DRS_CCW_STENCILFAIL] = WINED3DSTENCILOP_KEEP; - state->render_states[WINED3DRS_CCW_STENCILZFAIL] = WINED3DSTENCILOP_KEEP; - state->render_states[WINED3DRS_CCW_STENCILPASS] = WINED3DSTENCILOP_KEEP; - state->render_states[WINED3DRS_CCW_STENCILFUNC] = WINED3DCMP_ALWAYS; - state->render_states[WINED3DRS_COLORWRITEENABLE1] = 0x0000000f; - state->render_states[WINED3DRS_COLORWRITEENABLE2] = 0x0000000f; - state->render_states[WINED3DRS_COLORWRITEENABLE3] = 0x0000000f; - state->render_states[WINED3DRS_BLENDFACTOR] = 0xFFFFFFFF; - state->render_states[WINED3DRS_SRGBWRITEENABLE] = 0; - state->render_states[WINED3DRS_DEPTHBIAS] = 0; - state->render_states[WINED3DRS_WRAP8] = 0; - state->render_states[WINED3DRS_WRAP9] = 0; - state->render_states[WINED3DRS_WRAP10] = 0; - state->render_states[WINED3DRS_WRAP11] = 0; - state->render_states[WINED3DRS_WRAP12] = 0; - state->render_states[WINED3DRS_WRAP13] = 0; - state->render_states[WINED3DRS_WRAP14] = 0; - state->render_states[WINED3DRS_WRAP15] = 0; - state->render_states[WINED3DRS_SEPARATEALPHABLENDENABLE] = FALSE; - state->render_states[WINED3DRS_SRCBLENDALPHA] = WINED3D_BLEND_ONE; - state->render_states[WINED3DRS_DESTBLENDALPHA] = WINED3D_BLEND_ZERO; - state->render_states[WINED3DRS_BLENDOPALPHA] = WINED3D_BLEND_OP_ADD; + state->render_states[WINED3D_RS_ADAPTIVETESS_W] = tmpfloat.d; + state->render_states[WINED3D_RS_ENABLEADAPTIVETESSELLATION] = FALSE; + state->render_states[WINED3D_RS_TWOSIDEDSTENCILMODE] = FALSE; + state->render_states[WINED3D_RS_CCW_STENCILFAIL] = WINED3DSTENCILOP_KEEP; + state->render_states[WINED3D_RS_CCW_STENCILZFAIL] = WINED3DSTENCILOP_KEEP; + state->render_states[WINED3D_RS_CCW_STENCILPASS] = WINED3DSTENCILOP_KEEP; + state->render_states[WINED3D_RS_CCW_STENCILFUNC] = WINED3DCMP_ALWAYS; + state->render_states[WINED3D_RS_COLORWRITEENABLE1] = 0x0000000f; + state->render_states[WINED3D_RS_COLORWRITEENABLE2] = 0x0000000f; + state->render_states[WINED3D_RS_COLORWRITEENABLE3] = 0x0000000f; + state->render_states[WINED3D_RS_BLENDFACTOR] = 0xFFFFFFFF; + state->render_states[WINED3D_RS_SRGBWRITEENABLE] = 0; + state->render_states[WINED3D_RS_DEPTHBIAS] = 0; + state->render_states[WINED3D_RS_WRAP8] = 0; + state->render_states[WINED3D_RS_WRAP9] = 0; + state->render_states[WINED3D_RS_WRAP10] = 0; + state->render_states[WINED3D_RS_WRAP11] = 0; + state->render_states[WINED3D_RS_WRAP12] = 0; + state->render_states[WINED3D_RS_WRAP13] = 0; + state->render_states[WINED3D_RS_WRAP14] = 0; + state->render_states[WINED3D_RS_WRAP15] = 0; + state->render_states[WINED3D_RS_SEPARATEALPHABLENDENABLE] = FALSE; + state->render_states[WINED3D_RS_SRCBLENDALPHA] = WINED3D_BLEND_ONE; + state->render_states[WINED3D_RS_DESTBLENDALPHA] = WINED3D_BLEND_ZERO; + state->render_states[WINED3D_RS_BLENDOPALPHA] = WINED3D_BLEND_OP_ADD; /* Texture Stage States - Put directly into state block, we will call function below */ for (i = 0; i < MAX_TEXTURES; ++i) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index bd45ae3e000..64dd24d119f 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -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); diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 398861909dc..c64c5ef9344 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -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, diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index b4f4ff87557..206370186c2 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -2016,137 +2016,137 @@ const char *debug_d3dprimitivetype(enum wined3d_primitive_type primitive_type) } } -const char *debug_d3drenderstate(WINED3DRENDERSTATETYPE state) +const char *debug_d3drenderstate(enum wined3d_render_state state) { switch (state) { #define D3DSTATE_TO_STR(u) case u: return #u - D3DSTATE_TO_STR(WINED3DRS_ANTIALIAS); - D3DSTATE_TO_STR(WINED3DRS_TEXTUREPERSPECTIVE); - D3DSTATE_TO_STR(WINED3DRS_WRAPU); - D3DSTATE_TO_STR(WINED3DRS_WRAPV); - D3DSTATE_TO_STR(WINED3DRS_ZENABLE); - D3DSTATE_TO_STR(WINED3DRS_FILLMODE); - D3DSTATE_TO_STR(WINED3DRS_SHADEMODE); - D3DSTATE_TO_STR(WINED3DRS_LINEPATTERN); - D3DSTATE_TO_STR(WINED3DRS_MONOENABLE); - D3DSTATE_TO_STR(WINED3DRS_ROP2); - D3DSTATE_TO_STR(WINED3DRS_PLANEMASK); - D3DSTATE_TO_STR(WINED3DRS_ZWRITEENABLE); - D3DSTATE_TO_STR(WINED3DRS_ALPHATESTENABLE); - D3DSTATE_TO_STR(WINED3DRS_LASTPIXEL); - D3DSTATE_TO_STR(WINED3DRS_SRCBLEND); - D3DSTATE_TO_STR(WINED3DRS_DESTBLEND); - D3DSTATE_TO_STR(WINED3DRS_CULLMODE); - D3DSTATE_TO_STR(WINED3DRS_ZFUNC); - D3DSTATE_TO_STR(WINED3DRS_ALPHAREF); - D3DSTATE_TO_STR(WINED3DRS_ALPHAFUNC); - D3DSTATE_TO_STR(WINED3DRS_DITHERENABLE); - D3DSTATE_TO_STR(WINED3DRS_ALPHABLENDENABLE); - D3DSTATE_TO_STR(WINED3DRS_FOGENABLE); - D3DSTATE_TO_STR(WINED3DRS_SPECULARENABLE); - D3DSTATE_TO_STR(WINED3DRS_ZVISIBLE); - D3DSTATE_TO_STR(WINED3DRS_SUBPIXEL); - D3DSTATE_TO_STR(WINED3DRS_SUBPIXELX); - D3DSTATE_TO_STR(WINED3DRS_STIPPLEDALPHA); - D3DSTATE_TO_STR(WINED3DRS_FOGCOLOR); - D3DSTATE_TO_STR(WINED3DRS_FOGTABLEMODE); - D3DSTATE_TO_STR(WINED3DRS_FOGSTART); - D3DSTATE_TO_STR(WINED3DRS_FOGEND); - D3DSTATE_TO_STR(WINED3DRS_FOGDENSITY); - D3DSTATE_TO_STR(WINED3DRS_STIPPLEENABLE); - D3DSTATE_TO_STR(WINED3DRS_EDGEANTIALIAS); - D3DSTATE_TO_STR(WINED3DRS_COLORKEYENABLE); - D3DSTATE_TO_STR(WINED3DRS_MIPMAPLODBIAS); - D3DSTATE_TO_STR(WINED3DRS_RANGEFOGENABLE); - D3DSTATE_TO_STR(WINED3DRS_ANISOTROPY); - D3DSTATE_TO_STR(WINED3DRS_FLUSHBATCH); - D3DSTATE_TO_STR(WINED3DRS_TRANSLUCENTSORTINDEPENDENT); - D3DSTATE_TO_STR(WINED3DRS_STENCILENABLE); - D3DSTATE_TO_STR(WINED3DRS_STENCILFAIL); - D3DSTATE_TO_STR(WINED3DRS_STENCILZFAIL); - D3DSTATE_TO_STR(WINED3DRS_STENCILPASS); - D3DSTATE_TO_STR(WINED3DRS_STENCILFUNC); - D3DSTATE_TO_STR(WINED3DRS_STENCILREF); - D3DSTATE_TO_STR(WINED3DRS_STENCILMASK); - D3DSTATE_TO_STR(WINED3DRS_STENCILWRITEMASK); - D3DSTATE_TO_STR(WINED3DRS_TEXTUREFACTOR); - D3DSTATE_TO_STR(WINED3DRS_WRAP0); - D3DSTATE_TO_STR(WINED3DRS_WRAP1); - D3DSTATE_TO_STR(WINED3DRS_WRAP2); - D3DSTATE_TO_STR(WINED3DRS_WRAP3); - D3DSTATE_TO_STR(WINED3DRS_WRAP4); - D3DSTATE_TO_STR(WINED3DRS_WRAP5); - D3DSTATE_TO_STR(WINED3DRS_WRAP6); - D3DSTATE_TO_STR(WINED3DRS_WRAP7); - D3DSTATE_TO_STR(WINED3DRS_CLIPPING); - D3DSTATE_TO_STR(WINED3DRS_LIGHTING); - D3DSTATE_TO_STR(WINED3DRS_EXTENTS); - D3DSTATE_TO_STR(WINED3DRS_AMBIENT); - D3DSTATE_TO_STR(WINED3DRS_FOGVERTEXMODE); - D3DSTATE_TO_STR(WINED3DRS_COLORVERTEX); - D3DSTATE_TO_STR(WINED3DRS_LOCALVIEWER); - D3DSTATE_TO_STR(WINED3DRS_NORMALIZENORMALS); - D3DSTATE_TO_STR(WINED3DRS_COLORKEYBLENDENABLE); - D3DSTATE_TO_STR(WINED3DRS_DIFFUSEMATERIALSOURCE); - D3DSTATE_TO_STR(WINED3DRS_SPECULARMATERIALSOURCE); - D3DSTATE_TO_STR(WINED3DRS_AMBIENTMATERIALSOURCE); - D3DSTATE_TO_STR(WINED3DRS_EMISSIVEMATERIALSOURCE); - D3DSTATE_TO_STR(WINED3DRS_VERTEXBLEND); - D3DSTATE_TO_STR(WINED3DRS_CLIPPLANEENABLE); - D3DSTATE_TO_STR(WINED3DRS_SOFTWAREVERTEXPROCESSING); - D3DSTATE_TO_STR(WINED3DRS_POINTSIZE); - D3DSTATE_TO_STR(WINED3DRS_POINTSIZE_MIN); - D3DSTATE_TO_STR(WINED3DRS_POINTSPRITEENABLE); - D3DSTATE_TO_STR(WINED3DRS_POINTSCALEENABLE); - D3DSTATE_TO_STR(WINED3DRS_POINTSCALE_A); - D3DSTATE_TO_STR(WINED3DRS_POINTSCALE_B); - D3DSTATE_TO_STR(WINED3DRS_POINTSCALE_C); - D3DSTATE_TO_STR(WINED3DRS_MULTISAMPLEANTIALIAS); - D3DSTATE_TO_STR(WINED3DRS_MULTISAMPLEMASK); - D3DSTATE_TO_STR(WINED3DRS_PATCHEDGESTYLE); - D3DSTATE_TO_STR(WINED3DRS_PATCHSEGMENTS); - D3DSTATE_TO_STR(WINED3DRS_DEBUGMONITORTOKEN); - D3DSTATE_TO_STR(WINED3DRS_POINTSIZE_MAX); - D3DSTATE_TO_STR(WINED3DRS_INDEXEDVERTEXBLENDENABLE); - D3DSTATE_TO_STR(WINED3DRS_COLORWRITEENABLE); - D3DSTATE_TO_STR(WINED3DRS_TWEENFACTOR); - D3DSTATE_TO_STR(WINED3DRS_BLENDOP); - D3DSTATE_TO_STR(WINED3DRS_POSITIONDEGREE); - D3DSTATE_TO_STR(WINED3DRS_NORMALDEGREE); - D3DSTATE_TO_STR(WINED3DRS_SCISSORTESTENABLE); - D3DSTATE_TO_STR(WINED3DRS_SLOPESCALEDEPTHBIAS); - D3DSTATE_TO_STR(WINED3DRS_ANTIALIASEDLINEENABLE); - D3DSTATE_TO_STR(WINED3DRS_MINTESSELLATIONLEVEL); - D3DSTATE_TO_STR(WINED3DRS_MAXTESSELLATIONLEVEL); - D3DSTATE_TO_STR(WINED3DRS_ADAPTIVETESS_X); - D3DSTATE_TO_STR(WINED3DRS_ADAPTIVETESS_Y); - D3DSTATE_TO_STR(WINED3DRS_ADAPTIVETESS_Z); - D3DSTATE_TO_STR(WINED3DRS_ADAPTIVETESS_W); - D3DSTATE_TO_STR(WINED3DRS_ENABLEADAPTIVETESSELLATION); - D3DSTATE_TO_STR(WINED3DRS_TWOSIDEDSTENCILMODE); - D3DSTATE_TO_STR(WINED3DRS_CCW_STENCILFAIL); - D3DSTATE_TO_STR(WINED3DRS_CCW_STENCILZFAIL); - D3DSTATE_TO_STR(WINED3DRS_CCW_STENCILPASS); - D3DSTATE_TO_STR(WINED3DRS_CCW_STENCILFUNC); - D3DSTATE_TO_STR(WINED3DRS_COLORWRITEENABLE1); - D3DSTATE_TO_STR(WINED3DRS_COLORWRITEENABLE2); - D3DSTATE_TO_STR(WINED3DRS_COLORWRITEENABLE3); - D3DSTATE_TO_STR(WINED3DRS_BLENDFACTOR); - D3DSTATE_TO_STR(WINED3DRS_SRGBWRITEENABLE); - D3DSTATE_TO_STR(WINED3DRS_DEPTHBIAS); - D3DSTATE_TO_STR(WINED3DRS_WRAP8); - D3DSTATE_TO_STR(WINED3DRS_WRAP9); - D3DSTATE_TO_STR(WINED3DRS_WRAP10); - D3DSTATE_TO_STR(WINED3DRS_WRAP11); - D3DSTATE_TO_STR(WINED3DRS_WRAP12); - D3DSTATE_TO_STR(WINED3DRS_WRAP13); - D3DSTATE_TO_STR(WINED3DRS_WRAP14); - D3DSTATE_TO_STR(WINED3DRS_WRAP15); - D3DSTATE_TO_STR(WINED3DRS_SEPARATEALPHABLENDENABLE); - D3DSTATE_TO_STR(WINED3DRS_SRCBLENDALPHA); - D3DSTATE_TO_STR(WINED3DRS_DESTBLENDALPHA); - D3DSTATE_TO_STR(WINED3DRS_BLENDOPALPHA); + D3DSTATE_TO_STR(WINED3D_RS_ANTIALIAS); + D3DSTATE_TO_STR(WINED3D_RS_TEXTUREPERSPECTIVE); + D3DSTATE_TO_STR(WINED3D_RS_WRAPU); + D3DSTATE_TO_STR(WINED3D_RS_WRAPV); + D3DSTATE_TO_STR(WINED3D_RS_ZENABLE); + D3DSTATE_TO_STR(WINED3D_RS_FILLMODE); + D3DSTATE_TO_STR(WINED3D_RS_SHADEMODE); + D3DSTATE_TO_STR(WINED3D_RS_LINEPATTERN); + D3DSTATE_TO_STR(WINED3D_RS_MONOENABLE); + D3DSTATE_TO_STR(WINED3D_RS_ROP2); + D3DSTATE_TO_STR(WINED3D_RS_PLANEMASK); + D3DSTATE_TO_STR(WINED3D_RS_ZWRITEENABLE); + D3DSTATE_TO_STR(WINED3D_RS_ALPHATESTENABLE); + D3DSTATE_TO_STR(WINED3D_RS_LASTPIXEL); + D3DSTATE_TO_STR(WINED3D_RS_SRCBLEND); + D3DSTATE_TO_STR(WINED3D_RS_DESTBLEND); + D3DSTATE_TO_STR(WINED3D_RS_CULLMODE); + D3DSTATE_TO_STR(WINED3D_RS_ZFUNC); + D3DSTATE_TO_STR(WINED3D_RS_ALPHAREF); + D3DSTATE_TO_STR(WINED3D_RS_ALPHAFUNC); + D3DSTATE_TO_STR(WINED3D_RS_DITHERENABLE); + D3DSTATE_TO_STR(WINED3D_RS_ALPHABLENDENABLE); + D3DSTATE_TO_STR(WINED3D_RS_FOGENABLE); + D3DSTATE_TO_STR(WINED3D_RS_SPECULARENABLE); + D3DSTATE_TO_STR(WINED3D_RS_ZVISIBLE); + D3DSTATE_TO_STR(WINED3D_RS_SUBPIXEL); + D3DSTATE_TO_STR(WINED3D_RS_SUBPIXELX); + D3DSTATE_TO_STR(WINED3D_RS_STIPPLEDALPHA); + D3DSTATE_TO_STR(WINED3D_RS_FOGCOLOR); + D3DSTATE_TO_STR(WINED3D_RS_FOGTABLEMODE); + D3DSTATE_TO_STR(WINED3D_RS_FOGSTART); + D3DSTATE_TO_STR(WINED3D_RS_FOGEND); + D3DSTATE_TO_STR(WINED3D_RS_FOGDENSITY); + D3DSTATE_TO_STR(WINED3D_RS_STIPPLEENABLE); + D3DSTATE_TO_STR(WINED3D_RS_EDGEANTIALIAS); + D3DSTATE_TO_STR(WINED3D_RS_COLORKEYENABLE); + D3DSTATE_TO_STR(WINED3D_RS_MIPMAPLODBIAS); + D3DSTATE_TO_STR(WINED3D_RS_RANGEFOGENABLE); + D3DSTATE_TO_STR(WINED3D_RS_ANISOTROPY); + D3DSTATE_TO_STR(WINED3D_RS_FLUSHBATCH); + D3DSTATE_TO_STR(WINED3D_RS_TRANSLUCENTSORTINDEPENDENT); + D3DSTATE_TO_STR(WINED3D_RS_STENCILENABLE); + D3DSTATE_TO_STR(WINED3D_RS_STENCILFAIL); + D3DSTATE_TO_STR(WINED3D_RS_STENCILZFAIL); + D3DSTATE_TO_STR(WINED3D_RS_STENCILPASS); + D3DSTATE_TO_STR(WINED3D_RS_STENCILFUNC); + D3DSTATE_TO_STR(WINED3D_RS_STENCILREF); + D3DSTATE_TO_STR(WINED3D_RS_STENCILMASK); + D3DSTATE_TO_STR(WINED3D_RS_STENCILWRITEMASK); + D3DSTATE_TO_STR(WINED3D_RS_TEXTUREFACTOR); + D3DSTATE_TO_STR(WINED3D_RS_WRAP0); + D3DSTATE_TO_STR(WINED3D_RS_WRAP1); + D3DSTATE_TO_STR(WINED3D_RS_WRAP2); + D3DSTATE_TO_STR(WINED3D_RS_WRAP3); + D3DSTATE_TO_STR(WINED3D_RS_WRAP4); + D3DSTATE_TO_STR(WINED3D_RS_WRAP5); + D3DSTATE_TO_STR(WINED3D_RS_WRAP6); + D3DSTATE_TO_STR(WINED3D_RS_WRAP7); + D3DSTATE_TO_STR(WINED3D_RS_CLIPPING); + D3DSTATE_TO_STR(WINED3D_RS_LIGHTING); + D3DSTATE_TO_STR(WINED3D_RS_EXTENTS); + D3DSTATE_TO_STR(WINED3D_RS_AMBIENT); + D3DSTATE_TO_STR(WINED3D_RS_FOGVERTEXMODE); + D3DSTATE_TO_STR(WINED3D_RS_COLORVERTEX); + D3DSTATE_TO_STR(WINED3D_RS_LOCALVIEWER); + D3DSTATE_TO_STR(WINED3D_RS_NORMALIZENORMALS); + D3DSTATE_TO_STR(WINED3D_RS_COLORKEYBLENDENABLE); + D3DSTATE_TO_STR(WINED3D_RS_DIFFUSEMATERIALSOURCE); + D3DSTATE_TO_STR(WINED3D_RS_SPECULARMATERIALSOURCE); + D3DSTATE_TO_STR(WINED3D_RS_AMBIENTMATERIALSOURCE); + D3DSTATE_TO_STR(WINED3D_RS_EMISSIVEMATERIALSOURCE); + D3DSTATE_TO_STR(WINED3D_RS_VERTEXBLEND); + D3DSTATE_TO_STR(WINED3D_RS_CLIPPLANEENABLE); + D3DSTATE_TO_STR(WINED3D_RS_SOFTWAREVERTEXPROCESSING); + D3DSTATE_TO_STR(WINED3D_RS_POINTSIZE); + D3DSTATE_TO_STR(WINED3D_RS_POINTSIZE_MIN); + D3DSTATE_TO_STR(WINED3D_RS_POINTSPRITEENABLE); + D3DSTATE_TO_STR(WINED3D_RS_POINTSCALEENABLE); + D3DSTATE_TO_STR(WINED3D_RS_POINTSCALE_A); + D3DSTATE_TO_STR(WINED3D_RS_POINTSCALE_B); + D3DSTATE_TO_STR(WINED3D_RS_POINTSCALE_C); + D3DSTATE_TO_STR(WINED3D_RS_MULTISAMPLEANTIALIAS); + D3DSTATE_TO_STR(WINED3D_RS_MULTISAMPLEMASK); + D3DSTATE_TO_STR(WINED3D_RS_PATCHEDGESTYLE); + D3DSTATE_TO_STR(WINED3D_RS_PATCHSEGMENTS); + D3DSTATE_TO_STR(WINED3D_RS_DEBUGMONITORTOKEN); + D3DSTATE_TO_STR(WINED3D_RS_POINTSIZE_MAX); + D3DSTATE_TO_STR(WINED3D_RS_INDEXEDVERTEXBLENDENABLE); + D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE); + D3DSTATE_TO_STR(WINED3D_RS_TWEENFACTOR); + D3DSTATE_TO_STR(WINED3D_RS_BLENDOP); + D3DSTATE_TO_STR(WINED3D_RS_POSITIONDEGREE); + D3DSTATE_TO_STR(WINED3D_RS_NORMALDEGREE); + D3DSTATE_TO_STR(WINED3D_RS_SCISSORTESTENABLE); + D3DSTATE_TO_STR(WINED3D_RS_SLOPESCALEDEPTHBIAS); + D3DSTATE_TO_STR(WINED3D_RS_ANTIALIASEDLINEENABLE); + D3DSTATE_TO_STR(WINED3D_RS_MINTESSELLATIONLEVEL); + D3DSTATE_TO_STR(WINED3D_RS_MAXTESSELLATIONLEVEL); + D3DSTATE_TO_STR(WINED3D_RS_ADAPTIVETESS_X); + D3DSTATE_TO_STR(WINED3D_RS_ADAPTIVETESS_Y); + D3DSTATE_TO_STR(WINED3D_RS_ADAPTIVETESS_Z); + D3DSTATE_TO_STR(WINED3D_RS_ADAPTIVETESS_W); + D3DSTATE_TO_STR(WINED3D_RS_ENABLEADAPTIVETESSELLATION); + D3DSTATE_TO_STR(WINED3D_RS_TWOSIDEDSTENCILMODE); + D3DSTATE_TO_STR(WINED3D_RS_CCW_STENCILFAIL); + D3DSTATE_TO_STR(WINED3D_RS_CCW_STENCILZFAIL); + D3DSTATE_TO_STR(WINED3D_RS_CCW_STENCILPASS); + D3DSTATE_TO_STR(WINED3D_RS_CCW_STENCILFUNC); + D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE1); + D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE2); + D3DSTATE_TO_STR(WINED3D_RS_COLORWRITEENABLE3); + D3DSTATE_TO_STR(WINED3D_RS_BLENDFACTOR); + D3DSTATE_TO_STR(WINED3D_RS_SRGBWRITEENABLE); + D3DSTATE_TO_STR(WINED3D_RS_DEPTHBIAS); + D3DSTATE_TO_STR(WINED3D_RS_WRAP8); + D3DSTATE_TO_STR(WINED3D_RS_WRAP9); + D3DSTATE_TO_STR(WINED3D_RS_WRAP10); + D3DSTATE_TO_STR(WINED3D_RS_WRAP11); + D3DSTATE_TO_STR(WINED3D_RS_WRAP12); + D3DSTATE_TO_STR(WINED3D_RS_WRAP13); + D3DSTATE_TO_STR(WINED3D_RS_WRAP14); + D3DSTATE_TO_STR(WINED3D_RS_WRAP15); + D3DSTATE_TO_STR(WINED3D_RS_SEPARATEALPHABLENDENABLE); + D3DSTATE_TO_STR(WINED3D_RS_SRCBLENDALPHA); + D3DSTATE_TO_STR(WINED3D_RS_DESTBLENDALPHA); + D3DSTATE_TO_STR(WINED3D_RS_BLENDOPALPHA); #undef D3DSTATE_TO_STR default: FIXME("Unrecognized %u render state!\n", state); @@ -2998,7 +2998,7 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s aarg0 = (args[aop] & ARG0) ? state->texture_states[i][WINED3DTSS_ALPHAARG0] : ARG_UNUSED; } - if (!i && state->textures[0] && state->render_states[WINED3DRS_COLORKEYENABLE]) + if (!i && state->textures[0] && state->render_states[WINED3D_RS_COLORKEYENABLE]) { GLenum texture_dimensions; @@ -3018,7 +3018,7 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s } else if (aop == WINED3DTOP_SELECTARG1 && aarg1 != WINED3DTA_TEXTURE) { - if (state->render_states[WINED3DRS_ALPHABLENDENABLE]) + if (state->render_states[WINED3D_RS_ALPHABLENDENABLE]) { aarg2 = WINED3DTA_TEXTURE; aop = WINED3DTOP_MODULATE; @@ -3027,7 +3027,7 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s } else if (aop == WINED3DTOP_SELECTARG2 && aarg2 != WINED3DTA_TEXTURE) { - if (state->render_states[WINED3DRS_ALPHABLENDENABLE]) + if (state->render_states[WINED3D_RS_ALPHABLENDENABLE]) { aarg1 = WINED3DTA_TEXTURE; aop = WINED3DTOP_MODULATE; @@ -3082,11 +3082,11 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s memset(&settings->op[i], 0xff, sizeof(settings->op[i])); } - if (!state->render_states[WINED3DRS_FOGENABLE]) + if (!state->render_states[WINED3D_RS_FOGENABLE]) { settings->fog = FOG_OFF; } - else if (state->render_states[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE) + else if (state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3DFOG_NONE) { if (use_vs(state) || state->vertex_declaration->position_transformed) { @@ -3094,7 +3094,7 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s } else { - switch (state->render_states[WINED3DRS_FOGVERTEXMODE]) + switch (state->render_states[WINED3D_RS_FOGVERTEXMODE]) { case WINED3DFOG_NONE: case WINED3DFOG_LINEAR: @@ -3111,7 +3111,7 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s } else { - switch (state->render_states[WINED3DRS_FOGTABLEMODE]) + switch (state->render_states[WINED3D_RS_FOGTABLEMODE]) { case WINED3DFOG_LINEAR: settings->fog = FOG_LINEAR; @@ -3124,15 +3124,15 @@ void gen_ffp_frag_op(const struct wined3d_device *device, const struct wined3d_s break; } } - if (state->render_states[WINED3DRS_SRGBWRITEENABLE] + if (state->render_states[WINED3D_RS_SRGBWRITEENABLE] && rt->resource.format->flags & WINED3DFMT_FLAG_SRGB_WRITE) { settings->sRGB_write = 1; } else { settings->sRGB_write = 0; } - if (device->vs_clipping || !use_vs(state) || !state->render_states[WINED3DRS_CLIPPING] - || !state->render_states[WINED3DRS_CLIPPLANEENABLE]) + if (device->vs_clipping || !use_vs(state) || !state->render_states[WINED3D_RS_CLIPPING] + || !state->render_states[WINED3D_RS_CLIPPLANEENABLE]) { /* No need to emulate clipplanes if GL supports native vertex shader clipping or if * the fixed function vertex pipeline is used(which always supports clipplanes), or @@ -3380,6 +3380,6 @@ void wined3d_get_draw_rect(const struct wined3d_state *state, RECT *rect) SetRect(rect, vp->x, vp->y, vp->x + vp->width, vp->y + vp->height); - if (state->render_states[WINED3DRS_SCISSORTESTENABLE]) + if (state->render_states[WINED3D_RS_SCISSORTESTENABLE]) IntersectRect(rect, rect, &state->scissor_rect); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c8c7070d94c..82060268443 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -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; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index ecb63a02aa7..0bcbe082705 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -252,137 +252,136 @@ enum wined3d_format_id WINED3DFMT_FORCE_DWORD = 0xffffffff }; -typedef enum _WINED3DRENDERSTATETYPE +enum wined3d_render_state { - WINED3DRS_ANTIALIAS = 2, /* d3d7 */ - WINED3DRS_TEXTUREPERSPECTIVE = 4, /* d3d7 */ - WINED3DRS_WRAPU = 5, /* d3d7 */ - WINED3DRS_WRAPV = 6, /* d3d7 */ - WINED3DRS_ZENABLE = 7, - WINED3DRS_FILLMODE = 8, - WINED3DRS_SHADEMODE = 9, - WINED3DRS_LINEPATTERN = 10, /* d3d7, d3d8 */ - WINED3DRS_MONOENABLE = 11, /* d3d7 */ - WINED3DRS_ROP2 = 12, /* d3d7 */ - WINED3DRS_PLANEMASK = 13, /* d3d7 */ - WINED3DRS_ZWRITEENABLE = 14, - WINED3DRS_ALPHATESTENABLE = 15, - WINED3DRS_LASTPIXEL = 16, - WINED3DRS_SRCBLEND = 19, - WINED3DRS_DESTBLEND = 20, - WINED3DRS_CULLMODE = 22, - WINED3DRS_ZFUNC = 23, - WINED3DRS_ALPHAREF = 24, - WINED3DRS_ALPHAFUNC = 25, - WINED3DRS_DITHERENABLE = 26, - WINED3DRS_ALPHABLENDENABLE = 27, - WINED3DRS_FOGENABLE = 28, - WINED3DRS_SPECULARENABLE = 29, - WINED3DRS_ZVISIBLE = 30, /* d3d7, d3d8 */ - WINED3DRS_SUBPIXEL = 31, /* d3d7 */ - WINED3DRS_SUBPIXELX = 32, /* d3d7 */ - WINED3DRS_STIPPLEDALPHA = 33, /* d3d7 */ - WINED3DRS_FOGCOLOR = 34, - WINED3DRS_FOGTABLEMODE = 35, - WINED3DRS_FOGSTART = 36, - WINED3DRS_FOGEND = 37, - WINED3DRS_FOGDENSITY = 38, - WINED3DRS_STIPPLEENABLE = 39, /* d3d7 */ - WINED3DRS_EDGEANTIALIAS = 40, /* d3d7, d3d8 */ - WINED3DRS_COLORKEYENABLE = 41, /* d3d7 */ - WINED3DRS_MIPMAPLODBIAS = 46, /* d3d7 */ - WINED3DRS_RANGEFOGENABLE = 48, - WINED3DRS_ANISOTROPY = 49, /* d3d7 */ - WINED3DRS_FLUSHBATCH = 50, /* d3d7 */ - WINED3DRS_TRANSLUCENTSORTINDEPENDENT = 51, /* d3d7 */ - WINED3DRS_STENCILENABLE = 52, - WINED3DRS_STENCILFAIL = 53, - WINED3DRS_STENCILZFAIL = 54, - WINED3DRS_STENCILPASS = 55, - WINED3DRS_STENCILFUNC = 56, - WINED3DRS_STENCILREF = 57, - WINED3DRS_STENCILMASK = 58, - WINED3DRS_STENCILWRITEMASK = 59, - WINED3DRS_TEXTUREFACTOR = 60, - WINED3DRS_WRAP0 = 128, - WINED3DRS_WRAP1 = 129, - WINED3DRS_WRAP2 = 130, - WINED3DRS_WRAP3 = 131, - WINED3DRS_WRAP4 = 132, - WINED3DRS_WRAP5 = 133, - WINED3DRS_WRAP6 = 134, - WINED3DRS_WRAP7 = 135, - WINED3DRS_CLIPPING = 136, - WINED3DRS_LIGHTING = 137, - WINED3DRS_EXTENTS = 138, /* d3d7 */ - WINED3DRS_AMBIENT = 139, - WINED3DRS_FOGVERTEXMODE = 140, - WINED3DRS_COLORVERTEX = 141, - WINED3DRS_LOCALVIEWER = 142, - WINED3DRS_NORMALIZENORMALS = 143, - WINED3DRS_COLORKEYBLENDENABLE = 144, /* d3d7 */ - WINED3DRS_DIFFUSEMATERIALSOURCE = 145, - WINED3DRS_SPECULARMATERIALSOURCE = 146, - WINED3DRS_AMBIENTMATERIALSOURCE = 147, - WINED3DRS_EMISSIVEMATERIALSOURCE = 148, - WINED3DRS_VERTEXBLEND = 151, - WINED3DRS_CLIPPLANEENABLE = 152, - WINED3DRS_SOFTWAREVERTEXPROCESSING = 153, /* d3d8 */ - WINED3DRS_POINTSIZE = 154, - WINED3DRS_POINTSIZE_MIN = 155, - WINED3DRS_POINTSPRITEENABLE = 156, - WINED3DRS_POINTSCALEENABLE = 157, - WINED3DRS_POINTSCALE_A = 158, - WINED3DRS_POINTSCALE_B = 159, - WINED3DRS_POINTSCALE_C = 160, - WINED3DRS_MULTISAMPLEANTIALIAS = 161, - WINED3DRS_MULTISAMPLEMASK = 162, - WINED3DRS_PATCHEDGESTYLE = 163, - WINED3DRS_PATCHSEGMENTS = 164, /* d3d8 */ - WINED3DRS_DEBUGMONITORTOKEN = 165, - WINED3DRS_POINTSIZE_MAX = 166, - WINED3DRS_INDEXEDVERTEXBLENDENABLE = 167, - WINED3DRS_COLORWRITEENABLE = 168, - WINED3DRS_TWEENFACTOR = 170, - WINED3DRS_BLENDOP = 171, - WINED3DRS_POSITIONDEGREE = 172, - WINED3DRS_NORMALDEGREE = 173, - WINED3DRS_SCISSORTESTENABLE = 174, - WINED3DRS_SLOPESCALEDEPTHBIAS = 175, - WINED3DRS_ANTIALIASEDLINEENABLE = 176, - WINED3DRS_MINTESSELLATIONLEVEL = 178, - WINED3DRS_MAXTESSELLATIONLEVEL = 179, - WINED3DRS_ADAPTIVETESS_X = 180, - WINED3DRS_ADAPTIVETESS_Y = 181, - WINED3DRS_ADAPTIVETESS_Z = 182, - WINED3DRS_ADAPTIVETESS_W = 183, - WINED3DRS_ENABLEADAPTIVETESSELLATION = 184, - WINED3DRS_TWOSIDEDSTENCILMODE = 185, - WINED3DRS_CCW_STENCILFAIL = 186, - WINED3DRS_CCW_STENCILZFAIL = 187, - WINED3DRS_CCW_STENCILPASS = 188, - WINED3DRS_CCW_STENCILFUNC = 189, - WINED3DRS_COLORWRITEENABLE1 = 190, - WINED3DRS_COLORWRITEENABLE2 = 191, - WINED3DRS_COLORWRITEENABLE3 = 192, - WINED3DRS_BLENDFACTOR = 193, - WINED3DRS_SRGBWRITEENABLE = 194, - WINED3DRS_DEPTHBIAS = 195, - WINED3DRS_WRAP8 = 198, - WINED3DRS_WRAP9 = 199, - WINED3DRS_WRAP10 = 200, - WINED3DRS_WRAP11 = 201, - WINED3DRS_WRAP12 = 202, - WINED3DRS_WRAP13 = 203, - WINED3DRS_WRAP14 = 204, - WINED3DRS_WRAP15 = 205, - WINED3DRS_SEPARATEALPHABLENDENABLE = 206, - WINED3DRS_SRCBLENDALPHA = 207, - WINED3DRS_DESTBLENDALPHA = 208, - WINED3DRS_BLENDOPALPHA = 209, - WINED3DRS_FORCE_DWORD = 0x7fffffff -} WINED3DRENDERSTATETYPE; -#define WINEHIGHEST_RENDER_STATE WINED3DRS_BLENDOPALPHA + WINED3D_RS_ANTIALIAS = 2, /* d3d7 */ + WINED3D_RS_TEXTUREPERSPECTIVE = 4, /* d3d7 */ + WINED3D_RS_WRAPU = 5, /* d3d7 */ + WINED3D_RS_WRAPV = 6, /* d3d7 */ + WINED3D_RS_ZENABLE = 7, + WINED3D_RS_FILLMODE = 8, + WINED3D_RS_SHADEMODE = 9, + WINED3D_RS_LINEPATTERN = 10, /* d3d7, d3d8 */ + WINED3D_RS_MONOENABLE = 11, /* d3d7 */ + WINED3D_RS_ROP2 = 12, /* d3d7 */ + WINED3D_RS_PLANEMASK = 13, /* d3d7 */ + WINED3D_RS_ZWRITEENABLE = 14, + WINED3D_RS_ALPHATESTENABLE = 15, + WINED3D_RS_LASTPIXEL = 16, + WINED3D_RS_SRCBLEND = 19, + WINED3D_RS_DESTBLEND = 20, + WINED3D_RS_CULLMODE = 22, + WINED3D_RS_ZFUNC = 23, + WINED3D_RS_ALPHAREF = 24, + WINED3D_RS_ALPHAFUNC = 25, + WINED3D_RS_DITHERENABLE = 26, + WINED3D_RS_ALPHABLENDENABLE = 27, + WINED3D_RS_FOGENABLE = 28, + WINED3D_RS_SPECULARENABLE = 29, + WINED3D_RS_ZVISIBLE = 30, /* d3d7, d3d8 */ + WINED3D_RS_SUBPIXEL = 31, /* d3d7 */ + WINED3D_RS_SUBPIXELX = 32, /* d3d7 */ + WINED3D_RS_STIPPLEDALPHA = 33, /* d3d7 */ + WINED3D_RS_FOGCOLOR = 34, + WINED3D_RS_FOGTABLEMODE = 35, + WINED3D_RS_FOGSTART = 36, + WINED3D_RS_FOGEND = 37, + WINED3D_RS_FOGDENSITY = 38, + WINED3D_RS_STIPPLEENABLE = 39, /* d3d7 */ + WINED3D_RS_EDGEANTIALIAS = 40, /* d3d7, d3d8 */ + WINED3D_RS_COLORKEYENABLE = 41, /* d3d7 */ + WINED3D_RS_MIPMAPLODBIAS = 46, /* d3d7 */ + WINED3D_RS_RANGEFOGENABLE = 48, + WINED3D_RS_ANISOTROPY = 49, /* d3d7 */ + WINED3D_RS_FLUSHBATCH = 50, /* d3d7 */ + WINED3D_RS_TRANSLUCENTSORTINDEPENDENT = 51, /* d3d7 */ + WINED3D_RS_STENCILENABLE = 52, + WINED3D_RS_STENCILFAIL = 53, + WINED3D_RS_STENCILZFAIL = 54, + WINED3D_RS_STENCILPASS = 55, + WINED3D_RS_STENCILFUNC = 56, + WINED3D_RS_STENCILREF = 57, + WINED3D_RS_STENCILMASK = 58, + WINED3D_RS_STENCILWRITEMASK = 59, + WINED3D_RS_TEXTUREFACTOR = 60, + WINED3D_RS_WRAP0 = 128, + WINED3D_RS_WRAP1 = 129, + WINED3D_RS_WRAP2 = 130, + WINED3D_RS_WRAP3 = 131, + WINED3D_RS_WRAP4 = 132, + WINED3D_RS_WRAP5 = 133, + WINED3D_RS_WRAP6 = 134, + WINED3D_RS_WRAP7 = 135, + WINED3D_RS_CLIPPING = 136, + WINED3D_RS_LIGHTING = 137, + WINED3D_RS_EXTENTS = 138, /* d3d7 */ + WINED3D_RS_AMBIENT = 139, + WINED3D_RS_FOGVERTEXMODE = 140, + WINED3D_RS_COLORVERTEX = 141, + WINED3D_RS_LOCALVIEWER = 142, + WINED3D_RS_NORMALIZENORMALS = 143, + WINED3D_RS_COLORKEYBLENDENABLE = 144, /* d3d7 */ + WINED3D_RS_DIFFUSEMATERIALSOURCE = 145, + WINED3D_RS_SPECULARMATERIALSOURCE = 146, + WINED3D_RS_AMBIENTMATERIALSOURCE = 147, + WINED3D_RS_EMISSIVEMATERIALSOURCE = 148, + WINED3D_RS_VERTEXBLEND = 151, + WINED3D_RS_CLIPPLANEENABLE = 152, + WINED3D_RS_SOFTWAREVERTEXPROCESSING = 153, /* d3d8 */ + WINED3D_RS_POINTSIZE = 154, + WINED3D_RS_POINTSIZE_MIN = 155, + WINED3D_RS_POINTSPRITEENABLE = 156, + WINED3D_RS_POINTSCALEENABLE = 157, + WINED3D_RS_POINTSCALE_A = 158, + WINED3D_RS_POINTSCALE_B = 159, + WINED3D_RS_POINTSCALE_C = 160, + WINED3D_RS_MULTISAMPLEANTIALIAS = 161, + WINED3D_RS_MULTISAMPLEMASK = 162, + WINED3D_RS_PATCHEDGESTYLE = 163, + WINED3D_RS_PATCHSEGMENTS = 164, /* d3d8 */ + WINED3D_RS_DEBUGMONITORTOKEN = 165, + WINED3D_RS_POINTSIZE_MAX = 166, + WINED3D_RS_INDEXEDVERTEXBLENDENABLE = 167, + WINED3D_RS_COLORWRITEENABLE = 168, + WINED3D_RS_TWEENFACTOR = 170, + WINED3D_RS_BLENDOP = 171, + WINED3D_RS_POSITIONDEGREE = 172, + WINED3D_RS_NORMALDEGREE = 173, + WINED3D_RS_SCISSORTESTENABLE = 174, + WINED3D_RS_SLOPESCALEDEPTHBIAS = 175, + WINED3D_RS_ANTIALIASEDLINEENABLE = 176, + WINED3D_RS_MINTESSELLATIONLEVEL = 178, + WINED3D_RS_MAXTESSELLATIONLEVEL = 179, + WINED3D_RS_ADAPTIVETESS_X = 180, + WINED3D_RS_ADAPTIVETESS_Y = 181, + WINED3D_RS_ADAPTIVETESS_Z = 182, + WINED3D_RS_ADAPTIVETESS_W = 183, + WINED3D_RS_ENABLEADAPTIVETESSELLATION = 184, + WINED3D_RS_TWOSIDEDSTENCILMODE = 185, + WINED3D_RS_CCW_STENCILFAIL = 186, + WINED3D_RS_CCW_STENCILZFAIL = 187, + WINED3D_RS_CCW_STENCILPASS = 188, + WINED3D_RS_CCW_STENCILFUNC = 189, + WINED3D_RS_COLORWRITEENABLE1 = 190, + WINED3D_RS_COLORWRITEENABLE2 = 191, + WINED3D_RS_COLORWRITEENABLE3 = 192, + WINED3D_RS_BLENDFACTOR = 193, + WINED3D_RS_SRGBWRITEENABLE = 194, + WINED3D_RS_DEPTHBIAS = 195, + WINED3D_RS_WRAP8 = 198, + WINED3D_RS_WRAP9 = 199, + WINED3D_RS_WRAP10 = 200, + WINED3D_RS_WRAP11 = 201, + WINED3D_RS_WRAP12 = 202, + WINED3D_RS_WRAP13 = 203, + WINED3D_RS_WRAP14 = 204, + WINED3D_RS_WRAP15 = 205, + WINED3D_RS_SEPARATEALPHABLENDENABLE = 206, + WINED3D_RS_SRCBLENDALPHA = 207, + WINED3D_RS_DESTBLENDALPHA = 208, + WINED3D_RS_BLENDOPALPHA = 209, +}; +#define WINEHIGHEST_RENDER_STATE WINED3D_RS_BLENDOPALPHA enum wined3d_blend { @@ -2144,7 +2143,7 @@ HRESULT __cdecl wined3d_device_get_ps_consts_i(const struct wined3d_device *devi HRESULT __cdecl wined3d_device_get_raster_status(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_raster_status *raster_status); HRESULT __cdecl wined3d_device_get_render_state(const struct wined3d_device *device, - WINED3DRENDERSTATETYPE state, DWORD *value); + enum wined3d_render_state state, DWORD *value); HRESULT __cdecl wined3d_device_get_render_target(const struct wined3d_device *device, UINT render_target_idx, struct wined3d_surface **render_target); HRESULT __cdecl wined3d_device_get_sampler_state(const struct wined3d_device *device, @@ -2223,7 +2222,7 @@ HRESULT __cdecl wined3d_device_set_ps_consts_f(struct wined3d_device *device, HRESULT __cdecl wined3d_device_set_ps_consts_i(struct wined3d_device *device, UINT start_register, const int *constants, UINT vector4i_count); HRESULT __cdecl wined3d_device_set_render_state(struct wined3d_device *device, - WINED3DRENDERSTATETYPE state, DWORD value); + enum wined3d_render_state state, DWORD value); HRESULT __cdecl wined3d_device_set_render_target(struct wined3d_device *device, UINT render_target_idx, struct wined3d_surface *render_target, BOOL set_viewport); HRESULT __cdecl wined3d_device_set_sampler_state(struct wined3d_device *device,