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

wined3d: Implement the state merger and start to use it.

parent 98faed8f
......@@ -3446,7 +3446,9 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
select_shader_mode(&GLINFO_LOCATION, DeviceType, &object->ps_selected_mode, &object->vs_selected_mode);
object->shader_backend = select_shader_backend(Adapter, DeviceType);
compile_state_table(object->StateTable, object->shader_backend->StateTable_remove);
compile_state_table(object->StateTable, object->multistate_funcs,
NULL, NULL, misc_state_template,
object->shader_backend->StateTable_remove);
/* 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
......
......@@ -582,13 +582,26 @@ typedef void (*APPLYSTATEFUNC)(DWORD state, IWineD3DStateBlockImpl *stateblock,
struct StateEntry
{
DWORD representative;
APPLYSTATEFUNC apply;
DWORD representative;
APPLYSTATEFUNC apply;
};
struct StateEntryTemplate
{
DWORD state;
struct StateEntry content;
};
extern const struct StateEntryTemplate misc_state_template[];
/* "Base" state table */
extern const struct StateEntry FFPStateTable[];
void compile_state_table(struct StateEntry *StateTable, const struct StateEntry *temptable);
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 */);
/* The new context manager that should deal with onscreen and offscreen rendering */
struct WineD3DContext {
......@@ -814,6 +827,8 @@ struct IWineD3DDeviceImpl
hash_table_t *glsl_program_lookup;
void *shader_priv;
struct StateEntry StateTable[STATE_HIGHEST + 1];
/* Array of functions for states which are handled by more than one pipeline part */
APPLYSTATEFUNC *multistate_funcs[STATE_HIGHEST + 1];
/* To store */
BOOL view_ident; /* true iff view matrix is identity */
......
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