From 3a2743f25d30ec9fe05c0b3e66954ba30573bb7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 2 Jul 2008 14:56:38 -0500 Subject: [PATCH] wined3d: Remove the state table from the shader backend. --- dlls/wined3d/arb_program_shader.c | 1 - dlls/wined3d/ati_fragment_shader.c | 4 ---- dlls/wined3d/baseshader.c | 1 - dlls/wined3d/directx.c | 3 +-- dlls/wined3d/glsl_shader.c | 1 - dlls/wined3d/state.c | 7 +++---- dlls/wined3d/wined3d_private.h | 5 +---- 7 files changed, 5 insertions(+), 17 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 4c70331e28b..12d6a5bbc97 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -2109,5 +2109,4 @@ const shader_backend_t arb_program_shader_backend = { shader_arb_generate_vshader, shader_arb_get_caps, shader_arb_fragment_enable, - FFPStateTable }; diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index e5962019e5c..ebbb0c6044d 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -853,9 +853,6 @@ static void set_bumpmat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D } #undef GLINFO_LOCATION -/* our state table. Borrows lots of stuff from the base implementation */ -struct StateEntry ATIFSStateTable[STATE_HIGHEST + 1]; - const struct StateEntryTemplate atifs_fragmentstate_template[] = { {STATE_RENDER(WINED3DRS_TEXTUREFACTOR), { STATE_RENDER(WINED3DRS_TEXTUREFACTOR), state_texfactor_atifs }}, {STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), { STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), set_tex_op_atifs }}, @@ -1126,5 +1123,4 @@ const shader_backend_t atifs_shader_backend = { shader_atifs_generate_vshader, shader_atifs_get_caps, shader_atifs_fragment_enable, - ATIFSStateTable }; diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index 6f24c915418..11d807f5842 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -1214,7 +1214,6 @@ const shader_backend_t none_shader_backend = { shader_none_generate_vshader, shader_none_get_caps, shader_none_fragment_enable, - FFPStateTable }; /* ******************************************* diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index b4215196f4a..10cd52e3c48 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -3464,8 +3464,7 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter, frag_pipeline = select_fragment_implementation(Adapter, DeviceType); compile_state_table(object->StateTable, object->multistate_funcs, - ffp_vertexstate_template, frag_pipeline, misc_state_template, - object->shader_backend->StateTable_remove); + ffp_vertexstate_template, frag_pipeline, misc_state_template); /* Prefer the vtable with functions optimized for single dirtifyable objects if the shader * model can deal with that. It is essentially the same, just with adjusted diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 9bbe4181f6a..6e21f178871 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -3708,5 +3708,4 @@ const shader_backend_t glsl_shader_backend = { shader_glsl_generate_vshader, shader_glsl_get_caps, shader_glsl_fragment_enable, - FFPStateTable }; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 60089cedb70..fdb57adb927 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -2494,7 +2494,7 @@ static void pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D update_fog = TRUE; } - if(!isStateDirty(context, FFPStateTable[STATE_VSHADER].representative)) { + if(!isStateDirty(context, device->StateTable[STATE_VSHADER].representative)) { device->shader_backend->shader_select((IWineD3DDevice *)stateblock->wineD3DDevice, use_pshader, use_vshader); if (!isStateDirty(context, STATE_VERTEXSHADERCONSTANT) && (use_vshader || use_pshader)) { @@ -5271,8 +5271,7 @@ void compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs, const struct StateEntryTemplate *vertex, const struct StateEntryTemplate *fragment, - const struct StateEntryTemplate *misc, - const struct StateEntry *temptable /* TODO: Remove this */) { + const struct StateEntryTemplate *misc) { unsigned int i, type, handlers; APPLYSTATEFUNC multistate_funcs[STATE_HIGHEST + 1][3]; const struct StateEntryTemplate *cur; @@ -5336,6 +5335,6 @@ void compile_state_table(struct StateEntry *StateTable, /* TODO Remove this after the state move is done */ for(i = 0; i < STATE_HIGHEST + 1; i++) { if(set[i]) continue; - StateTable[i] = temptable[i]; + StateTable[i] = FFPStateTable[i]; } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 168b9406959..b6377d3c307 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -301,7 +301,6 @@ typedef struct { void (*shader_generate_vshader)(IWineD3DVertexShader *iface, SHADER_BUFFER *buffer); void (*shader_get_caps)(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, struct shader_caps *caps); void (*shader_fragment_enable)(IWineD3DDevice *iface, BOOL enable); - const struct StateEntry *StateTable_remove; /* TODO: This has to go away */ } shader_backend_t; extern const shader_backend_t atifs_shader_backend; @@ -598,13 +597,11 @@ extern const struct StateEntryTemplate ffp_fragmentstate_template[]; extern const struct StateEntryTemplate atifs_fragmentstate_template[]; /* "Base" state table */ -extern const struct StateEntry FFPStateTable[]; void compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs, const struct StateEntryTemplate *vertex, const struct StateEntryTemplate *fragment, - const struct StateEntryTemplate *misc, - const struct StateEntry *temptable /* TODO: Remove this */); + const struct StateEntryTemplate *misc); /* The new context manager that should deal with onscreen and offscreen rendering */ struct WineD3DContext {