Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/ati_fragment_shader.c | 3 ++- dlls/wined3d/context.c | 4 ++-- dlls/wined3d/glsl_shader.c | 4 ++-- dlls/wined3d/nvidia_texture_shader.c | 2 +- dlls/wined3d/state.c | 16 ++++++++-------- dlls/wined3d/wined3d_private.h | 26 +++++++++++++------------- 7 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 49d06455f74e..aab047cc023f 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -6673,7 +6673,7 @@ static void textransform(struct wined3d_context *context, const struct wined3d_s fragment_prog_arbfp(context, state, state_id); }
-static const struct StateEntryTemplate arbfp_fragmentstate_template[] = +static const struct wined3d_state_entry_template arbfp_fragmentstate_template[] = { {STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), { STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), state_texfactor_arbfp }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), { STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), NULL }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index ff2f711f4e8f..05ec44a0cf3b 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -1099,7 +1099,8 @@ static void atifs_srgbwriteenable(struct wined3d_context *context, const struct WARN("sRGB writes are not supported by this fragment pipe.\n"); }
-static const struct StateEntryTemplate atifs_fragmentstate_template[] = { +static const struct wined3d_state_entry_template atifs_fragmentstate_template[] = +{ {STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), { STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), atifs_tfactor }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_ALPHAFUNC), { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_ALPHAREF), { STATE_RENDER(WINED3D_RS_ALPHATESTENABLE), NULL }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 37264a08ef06..267238dafa42 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -3945,7 +3945,7 @@ static void context_load_stream_output_buffers(struct wined3d_context *context, static BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state) { - const struct StateEntry *state_table = context->state_table; + const struct wined3d_state_entry *state_table = context->state_table; const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_fb_state *fb = state->fb; unsigned int i; @@ -4059,7 +4059,7 @@ static BOOL context_apply_draw_state(struct wined3d_context *context, static void context_apply_compute_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state) { - const struct StateEntry *state_table = context->state_table; + const struct wined3d_state_entry *state_table = context->state_table; const struct wined3d_gl_info *gl_info = context->gl_info; unsigned int state_id, i;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 4613d78f94c2..fa6e302a4b9d 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -12001,7 +12001,7 @@ static void glsl_vertex_pipe_clip_plane(struct wined3d_context *context, context->constant_update_mask |= WINED3D_SHADER_CONST_VS_CLIP_PLANES; }
-static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] = +static const struct wined3d_state_entry_template glsl_vertex_pipe_vp_states[] = { {STATE_VDECL, {STATE_VDECL, glsl_vertex_pipe_vdecl }, WINED3D_GL_EXT_NONE }, {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX), {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX), glsl_vertex_pipe_vs }, WINED3D_GL_EXT_NONE }, @@ -12370,7 +12370,7 @@ static void glsl_fragment_pipe_shademode(struct wined3d_context *context, context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; }
-static const struct StateEntryTemplate glsl_fragment_pipe_state_template[] = +static const struct wined3d_state_entry_template glsl_fragment_pipe_state_template[] = { {STATE_VDECL, {STATE_VDECL, glsl_fragment_pipe_vdecl }, WINED3D_GL_EXT_NONE }, {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX), {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX), glsl_fragment_pipe_vs }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index 14cb73f2c3b4..323484ab43b4 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -768,7 +768,7 @@ static BOOL nvts_color_fixup_supported(struct color_fixup_desc fixup) return is_identity_fixup(fixup); }
-static const struct StateEntryTemplate nvrc_fragmentstate_template[] = +static const struct wined3d_state_entry_template nvrc_fragmentstate_template[] = { { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 9dc98047cfde..f071f30b5759 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4488,7 +4488,7 @@ static void state_so_warn(struct wined3d_context *context, const struct wined3d_ WARN("Transform feedback not supported.\n"); }
-const struct StateEntryTemplate misc_state_template[] = +const struct wined3d_state_entry_template misc_state_template[] = { { STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_VERTEX), { STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_VERTEX), state_cb, }, ARB_UNIFORM_BUFFER_OBJECT }, { STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_VERTEX), { STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_VERTEX), state_cb_warn, }, WINED3D_GL_EXT_NONE }, @@ -4707,7 +4707,7 @@ const struct StateEntryTemplate misc_state_template[] = {0 /* Terminate */, { 0, 0 }, WINED3D_GL_EXT_NONE }, };
-static const struct StateEntryTemplate vp_ffp_states[] = +static const struct wined3d_state_entry_template vp_ffp_states[] = { { STATE_VDECL, { STATE_VDECL, vertexdeclaration }, WINED3D_GL_EXT_NONE }, { STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX), { STATE_VDECL, NULL }, WINED3D_GL_EXT_NONE }, @@ -5082,7 +5082,7 @@ static const struct StateEntryTemplate vp_ffp_states[] = {0 /* Terminate */, { 0, 0 }, WINED3D_GL_EXT_NONE }, };
-static const struct StateEntryTemplate ffp_fragmentstate_template[] = { +static const struct wined3d_state_entry_template ffp_fragmentstate_template[] = { { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), tex_colorop }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE }, @@ -5386,7 +5386,7 @@ static void multistate_apply_3(struct wined3d_context *context, const struct win context->device->multistate_funcs[state_id][2](context, state, state_id); }
-static void prune_invalid_states(struct StateEntry *state_table, const struct wined3d_d3d_info *d3d_info) +static void prune_invalid_states(struct wined3d_state_entry *state_table, const struct wined3d_d3d_info *d3d_info) { unsigned int start, last, i;
@@ -5415,7 +5415,7 @@ static void prune_invalid_states(struct StateEntry *state_table, const struct wi } }
-static void validate_state_table(struct StateEntry *state_table) +static void validate_state_table(struct wined3d_state_entry *state_table) { static const struct { @@ -5519,13 +5519,13 @@ static void validate_state_table(struct StateEntry *state_table) } }
-HRESULT compile_state_table(struct StateEntry *state_table, APPLYSTATEFUNC **dev_multistate_funcs, +HRESULT compile_state_table(struct wined3d_state_entry *state_table, APPLYSTATEFUNC **dev_multistate_funcs, const struct wined3d_d3d_info *d3d_info, const BOOL *supported_extensions, const struct wined3d_vertex_pipe_ops *vertex, const struct fragment_pipeline *fragment, - const struct StateEntryTemplate *misc) + const struct wined3d_state_entry_template *misc) { APPLYSTATEFUNC multistate_funcs[STATE_HIGHEST + 1][3]; - const struct StateEntryTemplate *cur; + const struct wined3d_state_entry_template *cur; unsigned int i, type, handlers; BOOL set[STATE_HIGHEST + 1];
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 8fe331065768..6907c7b2e926 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1873,7 +1873,7 @@ struct wined3d_context { const struct wined3d_gl_info *gl_info; const struct wined3d_d3d_info *d3d_info; - const struct StateEntry *state_table; + const struct wined3d_state_entry *state_table; /* State dirtification * dirtyArray is an array that contains markers for dirty states. numDirtyEntries states are dirty, their numbers are in indices * 0...numDirtyEntries - 1. isStateDirty is a redundant copy of the dirtyArray. Technically only one of them would be needed, @@ -2027,16 +2027,16 @@ struct wined3d_fb_state
typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
-struct StateEntry +struct wined3d_state_entry { - DWORD representative; + unsigned int representative; APPLYSTATEFUNC apply; };
-struct StateEntryTemplate +struct wined3d_state_entry_template { DWORD state; - struct StateEntry content; + struct wined3d_state_entry content; unsigned int extension; };
@@ -2066,7 +2066,7 @@ struct fragment_pipeline BOOL (*allocate_context_data)(struct wined3d_context *context); void (*free_context_data)(struct wined3d_context *context); BOOL (*color_fixup_supported)(struct color_fixup_desc fixup); - const struct StateEntryTemplate *states; + const struct wined3d_state_entry_template *states; };
struct wined3d_vertex_caps @@ -2090,10 +2090,10 @@ struct wined3d_vertex_pipe_ops DWORD (*vp_get_emul_mask)(const struct wined3d_gl_info *gl_info); void *(*vp_alloc)(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv); void (*vp_free)(struct wined3d_device *device); - const struct StateEntryTemplate *vp_states; + const struct wined3d_state_entry_template *vp_states; };
-extern const struct StateEntryTemplate misc_state_template[] DECLSPEC_HIDDEN; +extern const struct wined3d_state_entry_template misc_state_template[] DECLSPEC_HIDDEN; extern const struct fragment_pipeline none_fragment_pipe DECLSPEC_HIDDEN; extern const struct fragment_pipeline ffp_fragment_pipeline DECLSPEC_HIDDEN; extern const struct fragment_pipeline atifs_fragment_pipeline DECLSPEC_HIDDEN; @@ -2107,10 +2107,10 @@ extern const struct wined3d_vertex_pipe_ops ffp_vertex_pipe DECLSPEC_HIDDEN; extern const struct wined3d_vertex_pipe_ops glsl_vertex_pipe DECLSPEC_HIDDEN;
/* "Base" state table */ -HRESULT compile_state_table(struct StateEntry *state_table, APPLYSTATEFUNC **dev_multistate_funcs, +HRESULT compile_state_table(struct wined3d_state_entry *state_table, APPLYSTATEFUNC **dev_multistate_funcs, const struct wined3d_d3d_info *d3d_info, const BOOL *supported_extensions, const struct wined3d_vertex_pipe_ops *vertex, const struct fragment_pipeline *fragment, - const struct StateEntryTemplate *misc) DECLSPEC_HIDDEN; + const struct wined3d_state_entry_template *misc) DECLSPEC_HIDDEN;
enum wined3d_blit_op { @@ -3038,7 +3038,7 @@ struct wined3d_device void *shader_priv; void *fragment_priv; void *vertex_priv; - struct StateEntry state_table[STATE_HIGHEST + 1]; + struct wined3d_state_entry state_table[STATE_HIGHEST + 1]; /* Array of functions for states which are handled by more than one pipeline part */ APPLYSTATEFUNC *multistate_funcs[STATE_HIGHEST + 1]; struct wined3d_blitter *blitter; @@ -4597,8 +4597,8 @@ static inline BOOL use_ps(const struct wined3d_state *state) static inline void context_apply_state(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - const struct StateEntry *state_table = context->state_table; - DWORD rep = state_table[state_id].representative; + const struct wined3d_state_entry *state_table = context->state_table; + unsigned int rep = state_table[state_id].representative; state_table[rep].apply(context, state, rep); }