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