Stefan Dösinger : wined3d: Remove the state table from the shader backend.
Alexandre Julliard
julliard at winehq.org
Tue Jul 8 14:35:35 CDT 2008
Module: wine
Branch: master
Commit: 3a2743f25d30ec9fe05c0b3e66954ba30573bb7a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3a2743f25d30ec9fe05c0b3e66954ba30573bb7a
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Wed Jul 2 14:56:38 2008 -0500
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 4c70331..12d6a5b 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 e596201..ebbb0c6 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 6f24c91..11d807f 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 b421519..10cd52e 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 9bbe418..6e21f17 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 60089ce..fdb57ad 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 168b940..b6377d3 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 {
More information about the wine-cvs
mailing list