[PATCH 7/7] wined3d: Don't use the builtin FFP uniform for the modelview matrix.

Matteo Bruni mbruni at codeweavers.com
Tue Mar 17 09:52:15 CDT 2015


I guess this is the really interesting patch. An obvious alternative,
which only occurred to me now, is to actually use two separate matrices
for the world and the view matrix, D3D-style. Not sure how much it would
make a difference, in theory that might even be a followup patch.
---
 dlls/wined3d/glsl_shader.c     | 153 +++++++++++++++++++++++++++++++++++++++--
 dlls/wined3d/state.c           |  27 +++-----
 dlls/wined3d/stateblock.c      |   9 +--
 dlls/wined3d/utils.c           |  21 ++++++
 dlls/wined3d/wined3d_private.h |  29 ++++----
 5 files changed, 195 insertions(+), 44 deletions(-)

diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index b6d3156..3d48da1 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -116,6 +116,8 @@ struct glsl_vs_program
     GLint uniform_i_locations[MAX_CONST_I];
     GLint uniform_b_locations[MAX_CONST_B];
     GLint pos_fixup_location;
+
+    GLint modelview_matrix_location;
 };
 
 struct glsl_gs_program
@@ -775,6 +777,15 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
         checkGLcall("glUniform4fv");
     }
 
+    if (update_mask & WINED3D_SHADER_CONST_FFP_MODELVIEW)
+    {
+        struct wined3d_matrix mat;
+
+        get_modelview_matrix(context, state, &mat);
+        GL_EXTCALL(glUniformMatrix4fv(prog->vs.modelview_matrix_location, 1, FALSE, (GLfloat *)&mat));
+        checkGLcall("glUniformMatrix4fv");
+    }
+
     if (update_mask & WINED3D_SHADER_CONST_PS_F)
         shader_glsl_load_constantsF(pshader, gl_info, state->ps_consts_f,
                 prog->ps.uniform_f_locations, &priv->pconst_heap, priv->stack, constant_version);
@@ -4976,7 +4987,10 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct wined3d_shader_buffe
 
     shader_addline(buffer, "#version 120\n");
     shader_addline(buffer, "\n");
-    shader_addline(buffer, "void main()\n{\n");
+
+    shader_addline(buffer, "uniform mat4 ffp_modelview_matrix;\n");
+
+    shader_addline(buffer, "\nvoid main()\n{\n");
     shader_addline(buffer, "float m;\n");
     shader_addline(buffer, "vec3 r;\n");
 
@@ -4988,7 +5002,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct wined3d_shader_buffe
     }
     else
     {
-        shader_addline(buffer, "vec4 ec_pos = gl_ModelViewMatrix * gl_Vertex;\n");
+        shader_addline(buffer, "vec4 ec_pos = ffp_modelview_matrix * gl_Vertex;\n");
         shader_addline(buffer, "gl_Position = gl_ProjectionMatrix * ec_pos;\n");
         if (settings->clipping)
             shader_addline(buffer, "gl_ClipVertex = ec_pos;\n");
@@ -5755,6 +5769,8 @@ static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *
     }
 
     vs->pos_fixup_location = GL_EXTCALL(glGetUniformLocation(program_id, "posFixup"));
+
+    vs->modelview_matrix_location = GL_EXTCALL(glGetUniformLocation(program_id, "ffp_modelview_matrix"));
 }
 
 static void shader_glsl_init_ps_uniform_locations(const struct wined3d_gl_info *gl_info,
@@ -6055,6 +6071,10 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
         shader_glsl_init_uniform_block_bindings(gl_info, program_id, &vshader->reg_maps,
                 0, gl_info->limits.vertex_uniform_blocks);
     }
+    else
+    {
+        entry->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW;
+    }
 
     if (gshader)
         shader_glsl_init_uniform_block_bindings(gl_info, program_id, &gshader->reg_maps,
@@ -6951,6 +6971,117 @@ static void glsl_vertex_pipe_shader(struct wined3d_context *context,
     context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX;
 }
 
+static void glsl_vertex_pipe_vdecl(struct wined3d_context *context,
+        const struct wined3d_state *state, DWORD state_id)
+{
+    const struct wined3d_gl_info *gl_info = context->gl_info;
+    BOOL transformed = context->stream_info.position_transformed;
+    BOOL wasrhw = context->last_was_rhw;
+    unsigned int i;
+
+    context->last_was_rhw = transformed;
+
+    if (!use_vs(state))
+    {
+        if (context->last_was_vshader)
+        {
+            for (i = 0; i < gl_info->limits.clipplanes; ++i)
+                clipplane(context, state, STATE_CLIPPLANE(i));
+        }
+
+        if (transformed != wasrhw)
+        {
+            if (!isStateDirty(context, STATE_TRANSFORM(WINED3D_TS_PROJECTION))
+                    && !isStateDirty(context, STATE_VIEWPORT))
+                transform_projection(context, state, STATE_TRANSFORM(WINED3D_TS_PROJECTION));
+        }
+
+        for (i = 0; i < MAX_TEXTURES; ++i)
+        {
+            if (!isStateDirty(context, STATE_TRANSFORM(WINED3D_TS_TEXTURE0 + i)))
+                transform_texture(context, state, STATE_TEXTURESTAGE(i, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS));
+        }
+
+        if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_LIGHTING)))
+            state_lighting(context, state, STATE_RENDER(WINED3D_RS_LIGHTING));
+        if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_NORMALIZENORMALS)))
+            state_normalize(context, state, STATE_RENDER(WINED3D_RS_NORMALIZENORMALS));
+
+        /* Because of settings->texcoords, we have to always regenerate the
+         * vertex shader on a vdecl change.
+         * TODO: Just always output all the texcoords when there are enough
+         * varyings available to drop the dependency. */
+        context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX;
+
+        if (use_ps(state)
+                && state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.shader_version.major == 1
+                && state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.shader_version.minor <= 3)
+            context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_PIXEL;
+    }
+    else
+    {
+        if (!context->last_was_vshader)
+        {
+            /* Vertex shader clipping ignores the view matrix. Update all clipplanes. */
+            for (i = 0; i < gl_info->limits.clipplanes; ++i)
+                clipplane(context, state, STATE_CLIPPLANE(i));
+        }
+    }
+
+    if (transformed != wasrhw && !isStateDirty(context, STATE_RENDER(WINED3D_RS_ZENABLE)))
+        context_apply_state(context, state, STATE_RENDER(WINED3D_RS_ZENABLE));
+
+    context->last_was_vshader = use_vs(state);
+}
+
+static void glsl_vertex_pipe_vs(struct wined3d_context *context,
+        const struct wined3d_state *state, DWORD state_id)
+{
+    context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX;
+    /* Different vertex shaders potentially require a different vertex attributes setup. */
+    if (!isStateDirty(context, STATE_VDECL))
+        context_apply_state(context, state, STATE_VDECL);
+}
+
+static void glsl_vertex_pipe_world(struct wined3d_context *context,
+        const struct wined3d_state *state, DWORD state_id)
+{
+    context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW;
+}
+
+void glsl_vertex_pipe_view(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
+{
+    const struct wined3d_gl_info *gl_info = context->gl_info;
+    const struct wined3d_light_info *light = NULL;
+    unsigned int k;
+
+    context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW;
+
+    for (k = 0; k < gl_info->limits.lights; ++k)
+    {
+        if (!(light = state->lights[k]))
+            continue;
+        gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + light->glIndex, GL_POSITION, light->lightPosn);
+        checkGLcall("glLightfv posn");
+        gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + light->glIndex, GL_SPOT_DIRECTION, light->lightDirn);
+        checkGLcall("glLightfv dirn");
+    }
+
+    for (k = 0; k < gl_info->limits.clipplanes; ++k)
+    {
+        if (!isStateDirty(context, STATE_CLIPPLANE(k)))
+            clipplane(context, state, STATE_CLIPPLANE(k));
+    }
+
+    if (context->swapchain->device->vertexBlendUsed)
+    {
+        static int warned;
+
+        if (!warned++)
+            FIXME("Vertex blending emulation.\n");
+    }
+}
+
 static void glsl_vertex_pipe_projection(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id)
 {
@@ -6963,8 +7094,8 @@ static void glsl_vertex_pipe_projection(struct wined3d_context *context,
 
 static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] =
 {
-    {STATE_VDECL,                                                {STATE_VDECL,                                                vertexdeclaration      }, WINED3D_GL_EXT_NONE          },
-    {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX),                   {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX),                   vertexdeclaration      }, WINED3D_GL_EXT_NONE          },
+    {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          },
     {STATE_MATERIAL,                                             {STATE_RENDER(WINED3D_RS_SPECULARENABLE),                    NULL                   }, WINED3D_GL_EXT_NONE          },
     {STATE_RENDER(WINED3D_RS_SPECULARENABLE),                    {STATE_RENDER(WINED3D_RS_SPECULARENABLE),                    state_specularenable   }, WINED3D_GL_EXT_NONE          },
     /* Clip planes */
@@ -7013,7 +7144,7 @@ static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] =
     /* Viewport */
     {STATE_VIEWPORT,                                             {STATE_VIEWPORT,                                             viewport_vertexpart    }, WINED3D_GL_EXT_NONE          },
     /* Transform states */
-    {STATE_TRANSFORM(WINED3D_TS_VIEW),                           {STATE_TRANSFORM(WINED3D_TS_VIEW),                           transform_view         }, WINED3D_GL_EXT_NONE          },
+    {STATE_TRANSFORM(WINED3D_TS_VIEW),                           {STATE_TRANSFORM(WINED3D_TS_VIEW),                           glsl_vertex_pipe_view  }, WINED3D_GL_EXT_NONE          },
     {STATE_TRANSFORM(WINED3D_TS_PROJECTION),                     {STATE_TRANSFORM(WINED3D_TS_PROJECTION),                     glsl_vertex_pipe_projection}, WINED3D_GL_EXT_NONE      },
     {STATE_TRANSFORM(WINED3D_TS_TEXTURE0),                       {STATE_TEXTURESTAGE(0, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), NULL                   }, WINED3D_GL_EXT_NONE          },
     {STATE_TRANSFORM(WINED3D_TS_TEXTURE1),                       {STATE_TEXTURESTAGE(1, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), NULL                   }, WINED3D_GL_EXT_NONE          },
@@ -7023,7 +7154,7 @@ static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] =
     {STATE_TRANSFORM(WINED3D_TS_TEXTURE5),                       {STATE_TEXTURESTAGE(5, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), NULL                   }, WINED3D_GL_EXT_NONE          },
     {STATE_TRANSFORM(WINED3D_TS_TEXTURE6),                       {STATE_TEXTURESTAGE(6, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), NULL                   }, WINED3D_GL_EXT_NONE          },
     {STATE_TRANSFORM(WINED3D_TS_TEXTURE7),                       {STATE_TEXTURESTAGE(7, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), NULL                   }, WINED3D_GL_EXT_NONE          },
-    {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(0)),                {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(0)),                transform_world        }, WINED3D_GL_EXT_NONE          },
+    {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(0)),                {STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(0)),                glsl_vertex_pipe_world }, WINED3D_GL_EXT_NONE          },
     {STATE_TEXTURESTAGE(0, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(0, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), transform_texture      }, WINED3D_GL_EXT_NONE          },
     {STATE_TEXTURESTAGE(1, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(1, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), transform_texture      }, WINED3D_GL_EXT_NONE          },
     {STATE_TEXTURESTAGE(2, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(2, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), transform_texture      }, WINED3D_GL_EXT_NONE          },
@@ -7242,7 +7373,7 @@ static void glsl_fragment_pipe_fog(struct wined3d_context *context,
     {
         if (use_vshader)
             new_source = FOGSOURCE_VS;
-        else if (state->render_states[WINED3D_RS_FOGVERTEXMODE] == WINED3D_FOG_NONE || context->last_was_rhw)
+        else if (state->render_states[WINED3D_RS_FOGVERTEXMODE] == WINED3D_FOG_NONE || context->stream_info.position_transformed)
             new_source = FOGSOURCE_COORD;
         else
             new_source = FOGSOURCE_FFP;
@@ -7259,6 +7390,13 @@ static void glsl_fragment_pipe_fog(struct wined3d_context *context,
     }
 }
 
+static void glsl_fragment_pipe_vdecl(struct wined3d_context *context,
+        const struct wined3d_state *state, DWORD state_id)
+{
+    if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_FOGENABLE)))
+        glsl_fragment_pipe_fog(context, state, state_id);
+}
+
 static void glsl_fragment_pipe_tex_transform(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id)
 {
@@ -7273,6 +7411,7 @@ static void glsl_fragment_pipe_invalidate_constants(struct wined3d_context *cont
 
 static const struct StateEntryTemplate glsl_fragment_pipe_state_template[] =
 {
+    {STATE_VDECL,                                               {STATE_VDECL,                                                glsl_fragment_pipe_vdecl               }, WINED3D_GL_EXT_NONE },
     {STATE_RENDER(WINED3D_RS_TEXTUREFACTOR),                    {STATE_RENDER(WINED3D_RS_TEXTUREFACTOR),                     glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE },
     {STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP),               {STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL),                    NULL                                   }, WINED3D_GL_EXT_NONE },
     {STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG1),             {STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL),                    NULL                                   }, WINED3D_GL_EXT_NONE },
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 67570d5..65f43a2 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -74,7 +74,7 @@ static void state_fillmode(struct wined3d_context *context, const struct wined3d
     }
 }
 
-static void state_lighting(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
+void state_lighting(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
 
@@ -1392,7 +1392,7 @@ static void state_linepattern(struct wined3d_context *context, const struct wine
     }
 }
 
-static void state_normalize(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
+void state_normalize(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
 
@@ -3841,9 +3841,10 @@ static void shader_bumpenv(struct wined3d_context *context, const struct wined3d
     context->constant_update_mask |= WINED3D_SHADER_CONST_PS_BUMP_ENV;
 }
 
-void transform_world(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
+static void transform_world(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
+    struct wined3d_matrix mat;
 
     /* This function is called by transform_view below if the view matrix was changed too
      *
@@ -3855,18 +3856,10 @@ void transform_world(struct wined3d_context *context, const struct wined3d_state
     gl_info->gl_ops.gl.p_glMatrixMode(GL_MODELVIEW);
     checkGLcall("glMatrixMode");
 
-    if (context->last_was_rhw)
-    {
-        gl_info->gl_ops.gl.p_glLoadIdentity();
-        checkGLcall("glLoadIdentity()");
-    }
-    else
-    {
-        gl_info->gl_ops.gl.p_glLoadMatrixf(&state->transforms[WINED3D_TS_VIEW].u.m[0][0]);
-        checkGLcall("glLoadMatrixf");
-        gl_info->gl_ops.gl.p_glMultMatrixf(&state->transforms[WINED3D_TS_WORLD_MATRIX(0)].u.m[0][0]);
-        checkGLcall("glMultMatrixf");
-    }
+    get_modelview_matrix(context, state, &mat);
+
+    gl_info->gl_ops.gl.p_glLoadMatrixf((GLfloat *)&mat);
+    checkGLcall("glLoadMatrixf");
 }
 
 void clipplane(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
@@ -3997,7 +3990,7 @@ static void state_vertexblend(struct wined3d_context *context, const struct wine
     }
 }
 
-void transform_view(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
+static void transform_view(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
     const struct wined3d_light_info *light = NULL;
@@ -4634,7 +4627,7 @@ static void vdecl_miscpart(struct wined3d_context *context, const struct wined3d
     streamsrc(context, state, STATE_STREAMSRC);
 }
 
-void vertexdeclaration(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
+static void vertexdeclaration(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
     BOOL useVertexShaderFunction = use_vs(state);
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index dc146fc..62b1841 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1121,16 +1121,11 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d
         DWORD d;
     } tmpfloat;
     unsigned int i;
-    static const struct wined3d_matrix identity =
-    {{{
-        1.0f, 0.0f, 0.0f, 0.0f,
-        0.0f, 1.0f, 0.0f, 0.0f,
-        0.0f, 0.0f, 1.0f, 0.0f,
-        0.0f, 0.0f, 0.0f, 1.0f,
-    }}};
+    struct wined3d_matrix identity;
 
     TRACE("state %p, gl_info %p.\n", state, gl_info);
 
+    get_identity_matrix(&identity);
     state->gl_primitive_type = ~0u;
 
     /* Set some of the defaults for lights, transforms etc */
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 725318f..1dd0674 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -3117,6 +3117,27 @@ BOOL is_invalid_op(const struct wined3d_state *state, int stage,
     return FALSE;
 }
 
+void get_identity_matrix(struct wined3d_matrix *mat)
+{
+    static const struct wined3d_matrix identity =
+    {{{
+        1.0f, 0.0f, 0.0f, 0.0f,
+        0.0f, 1.0f, 0.0f, 0.0f,
+        0.0f, 0.0f, 1.0f, 0.0f,
+        0.0f, 0.0f, 0.0f, 1.0f,
+    }}};
+
+    memcpy(mat, &identity, sizeof(identity));
+}
+
+void get_modelview_matrix(const struct wined3d_context *context, const struct wined3d_state *state, struct wined3d_matrix *mat)
+{
+    if (context->last_was_rhw)
+        get_identity_matrix(mat);
+    else
+        multiply_matrix(mat, &state->transforms[WINED3D_TS_VIEW], &state->transforms[WINED3D_TS_WORLD_MATRIX(0)]);
+}
+
 /* Setup this textures matrix according to the texture flags. */
 /* Context activation is done by the caller (state handler). */
 void set_texture_matrix(const struct wined3d_gl_info *gl_info, const float *smat, DWORD flags,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b0c7a53..9290c74 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -300,13 +300,14 @@ enum wined3d_shader_resource_type
 #define WINED3D_SHADER_CONST_VS_I           0x00000002
 #define WINED3D_SHADER_CONST_VS_B           0x00000004
 #define WINED3D_SHADER_CONST_VS_POS_FIXUP   0x00000008
-#define WINED3D_SHADER_CONST_PS_F           0x00000010
-#define WINED3D_SHADER_CONST_PS_I           0x00000020
-#define WINED3D_SHADER_CONST_PS_B           0x00000040
-#define WINED3D_SHADER_CONST_PS_BUMP_ENV    0x00000080
-#define WINED3D_SHADER_CONST_PS_Y_CORR      0x00000100
-#define WINED3D_SHADER_CONST_PS_NP2_FIXUP   0x00000200
-#define WINED3D_SHADER_CONST_FFP_PS         0x00000400
+#define WINED3D_SHADER_CONST_FFP_MODELVIEW  0x00000010
+#define WINED3D_SHADER_CONST_PS_F           0x00000020
+#define WINED3D_SHADER_CONST_PS_I           0x00000040
+#define WINED3D_SHADER_CONST_PS_B           0x00000080
+#define WINED3D_SHADER_CONST_PS_BUMP_ENV    0x00000100
+#define WINED3D_SHADER_CONST_PS_Y_CORR      0x00000200
+#define WINED3D_SHADER_CONST_PS_NP2_FIXUP   0x00000400
+#define WINED3D_SHADER_CONST_FFP_PS         0x00000800
 
 enum wined3d_shader_register_type
 {
@@ -2807,10 +2808,6 @@ void sampler_texmatrix(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
 void state_specularenable(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
-void transform_world(struct wined3d_context *context,
-        const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
-void transform_view(struct wined3d_context *context,
-        const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
 void transform_projection(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
 void transform_texture(struct wined3d_context *context,
@@ -2823,8 +2820,6 @@ void state_clipping(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
 void light(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
-void vertexdeclaration(struct wined3d_context *context,
-        const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
 void clipplane(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
 void state_psizemin_w(struct wined3d_context *context,
@@ -2839,6 +2834,10 @@ void state_pointsprite(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
 void state_pscale(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
+void state_lighting(struct wined3d_context *context,
+        const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
+void state_normalize(struct wined3d_context *context,
+        const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
 
 BOOL getColorBits(const struct wined3d_format *format,
         BYTE *redSize, BYTE *greenSize, BYTE *blueSize, BYTE *alphaSize, BYTE *totalSize) DECLSPEC_HIDDEN;
@@ -3037,6 +3036,10 @@ static inline BOOL shader_constant_is_local(const struct wined3d_shader *shader,
     return FALSE;
 }
 
+void get_identity_matrix(struct wined3d_matrix *mat) DECLSPEC_HIDDEN;
+void get_modelview_matrix(const struct wined3d_context *context, const struct wined3d_state *state,
+        struct wined3d_matrix *mat) DECLSPEC_HIDDEN;
+
 /* Using additional shader constants (uniforms in GLSL / program environment
  * or local parameters in ARB) is costly:
  * ARB only knows float4 parameters and GLSL compiler are not really smart
-- 
2.0.5




More information about the wine-patches mailing list