Commit 84258723 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Make the state table a property of the shader backend.

parent 1e9acad3
......@@ -1883,6 +1883,6 @@ const shader_backend_t arb_program_shader_backend = {
&shader_arb_destroy,
&shader_arb_alloc,
&shader_arb_free,
&shader_arb_dirty_const
&shader_arb_dirty_const,
FFPStateTable
};
......@@ -1109,7 +1109,8 @@ const shader_backend_t none_shader_backend = {
&shader_none_destroy,
&shader_none_alloc,
&shader_none_free,
&shader_none_dirty_const
&shader_none_dirty_const,
FFPStateTable
};
/* *******************************************
......
......@@ -4411,7 +4411,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTextureStageState(IWineD3DDevice *if
}
if(Stage > This->stateBlock->lowest_disabled_stage &&
StateTable[STATE_TEXTURESTAGE(0, Type)].representative == STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP)) {
This->shader_backend->StateTable[STATE_TEXTURESTAGE(0, Type)].representative == STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP)) {
/* Colorop change above lowest disabled stage? That won't change anything in the gl setup
* Changes in other states are important on disabled stages too
*/
......@@ -7778,7 +7778,7 @@ const DWORD SavedVertexStates_S[NUM_SAVEDVERTEXSTATES_S] = {
};
void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
DWORD rep = StateTable[state].representative;
DWORD rep = This->shader_backend->StateTable[state].representative;
DWORD idx;
BYTE shift;
UINT i;
......
......@@ -3372,5 +3372,6 @@ const shader_backend_t glsl_shader_backend = {
&shader_glsl_destroy,
&shader_glsl_alloc,
&shader_glsl_free,
&shader_glsl_dirty_const
&shader_glsl_dirty_const,
FFPStateTable
};
......@@ -435,7 +435,7 @@ static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
/* colorkey fixup for stage 0 alphaop depends on WINED3DRS_ALPHABLENDENABLE state,
so it may need updating */
if (stateblock->renderState[WINED3DRS_COLORKEYENABLE]) {
StateTable[STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP)].apply(STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP), stateblock, context);
FFPStateTable[STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP)].apply(STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP), stateblock, context);
}
}
......@@ -484,7 +484,7 @@ static void state_alpha(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
}
if(enable_ckey || context->last_was_ckey) {
StateTable[STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP)].apply(STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP), stateblock, context);
FFPStateTable[STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP)].apply(STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP), stateblock, context);
}
context->last_was_ckey = enable_ckey;
......@@ -2605,7 +2605,7 @@ static void pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
update_fog = TRUE;
}
if(!isStateDirty(context, StateTable[STATE_VSHADER].representative)) {
if(!isStateDirty(context, FFPStateTable[STATE_VSHADER].representative)) {
device->shader_backend->shader_select((IWineD3DDevice *)stateblock->wineD3DDevice, use_pshader, use_vshader);
if (!isStateDirty(context, STATE_VERTEXSHADERCONSTANT) && (use_vshader || use_pshader)) {
......@@ -3915,7 +3915,7 @@ static void frontface(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
}
}
const struct StateEntry StateTable[] =
const struct StateEntry FFPStateTable[] =
{
/* State name representative, apply function */
{ /* 0, Undefined */ 0, state_undefined },
......
......@@ -260,6 +260,7 @@ typedef struct {
HRESULT (*shader_alloc_private)(IWineD3DDevice *iface);
void (*shader_free_private)(IWineD3DDevice *iface);
BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface);
const struct StateEntry *StateTable;
} shader_backend_t;
extern const shader_backend_t glsl_shader_backend;
......@@ -543,8 +544,8 @@ struct StateEntry
APPLYSTATEFUNC apply;
};
/* Global state table */
extern const struct StateEntry StateTable[];
/* "Base" state table */
extern const struct StateEntry FFPStateTable[];
/* The new context manager that should deal with onscreen and offscreen rendering */
struct WineD3DContext {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment