Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
05757794
Commit
05757794
authored
Mar 26, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
Mar 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't use the builtin FFP uniform for the projection matrix.
parent
848991fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
17 deletions
+22
-17
glsl_shader.c
dlls/wined3d/glsl_shader.c
+18
-12
state.c
dlls/wined3d/state.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-3
No files found.
dlls/wined3d/glsl_shader.c
View file @
05757794
...
...
@@ -118,6 +118,7 @@ struct glsl_vs_program
GLint
pos_fixup_location
;
GLint
modelview_matrix_location
;
GLint
projection_matrix_location
;
GLint
normal_matrix_location
;
};
...
...
@@ -876,6 +877,15 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
shader_glsl_ffp_vertex_normalmatrix_uniform
(
context
,
state
,
prog
);
}
if
(
update_mask
&
WINED3D_SHADER_CONST_FFP_PROJ
)
{
struct
wined3d_matrix
projection
;
get_projection_matrix
(
context
,
state
,
&
projection
);
GL_EXTCALL
(
glUniformMatrix4fv
(
prog
->
vs
.
projection_matrix_location
,
1
,
FALSE
,
&
projection
.
_11
));
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
);
...
...
@@ -5092,6 +5102,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct wined3d_shader_buffe
shader_addline
(
buffer
,
"
\n
"
);
shader_addline
(
buffer
,
"uniform mat4 ffp_modelview_matrix;
\n
"
);
shader_addline
(
buffer
,
"uniform mat4 ffp_projection_matrix;
\n
"
);
shader_addline
(
buffer
,
"uniform mat3 ffp_normal_matrix;
\n
"
);
shader_addline
(
buffer
,
"
\n
void main()
\n
{
\n
"
);
...
...
@@ -5101,13 +5112,13 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct wined3d_shader_buffe
if
(
settings
->
transformed
)
{
shader_addline
(
buffer
,
"vec4 ec_pos = vec4(gl_Vertex.xyz, 1.0);
\n
"
);
shader_addline
(
buffer
,
"gl_Position =
gl_ProjectionM
atrix * ec_pos;
\n
"
);
shader_addline
(
buffer
,
"gl_Position =
ffp_projection_m
atrix * ec_pos;
\n
"
);
shader_addline
(
buffer
,
"if (gl_Vertex.w != 0.0) gl_Position /= gl_Vertex.w;
\n
"
);
}
else
{
shader_addline
(
buffer
,
"vec4 ec_pos = ffp_modelview_matrix * gl_Vertex;
\n
"
);
shader_addline
(
buffer
,
"gl_Position =
gl_ProjectionM
atrix * ec_pos;
\n
"
);
shader_addline
(
buffer
,
"gl_Position =
ffp_projection_m
atrix * ec_pos;
\n
"
);
if
(
settings
->
clipping
)
shader_addline
(
buffer
,
"gl_ClipVertex = ec_pos;
\n
"
);
shader_addline
(
buffer
,
"ec_pos /= ec_pos.w;
\n
"
);
...
...
@@ -5875,6 +5886,7 @@ 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"
));
vs
->
projection_matrix_location
=
GL_EXTCALL
(
glGetUniformLocation
(
program_id
,
"ffp_projection_matrix"
));
vs
->
normal_matrix_location
=
GL_EXTCALL
(
glGetUniformLocation
(
program_id
,
"ffp_normal_matrix"
));
}
...
...
@@ -6178,7 +6190,8 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
}
else
{
entry
->
constant_update_mask
|=
WINED3D_SHADER_CONST_FFP_MODELVIEW
;
entry
->
constant_update_mask
|=
WINED3D_SHADER_CONST_FFP_MODELVIEW
|
WINED3D_SHADER_CONST_FFP_PROJ
;
}
if
(
gshader
)
...
...
@@ -7095,11 +7108,7 @@ static void glsl_vertex_pipe_vdecl(struct wined3d_context *context,
}
if
(
transformed
!=
wasrhw
)
{
if
(
!
isStateDirty
(
context
,
STATE_TRANSFORM
(
WINED3D_TS_PROJECTION
))
&&
!
isStateDirty
(
context
,
STATE_VIEWPORT
))
transform_projection
(
context
,
state
,
STATE_TRANSFORM
(
WINED3D_TS_PROJECTION
));
}
context
->
constant_update_mask
|=
WINED3D_SHADER_CONST_FFP_PROJ
;
for
(
i
=
0
;
i
<
MAX_TEXTURES
;
++
i
)
{
...
...
@@ -7133,9 +7142,6 @@ static void glsl_vertex_pipe_vdecl(struct wined3d_context *context,
}
}
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
);
}
...
...
@@ -7194,7 +7200,7 @@ static void glsl_vertex_pipe_projection(struct wined3d_context *context,
if
(
state
->
render_states
[
WINED3D_RS_FOGENABLE
]
&&
state
->
render_states
[
WINED3D_RS_FOGTABLEMODE
]
!=
WINED3D_FOG_NONE
)
context
->
shader_update_mask
|=
1
<<
WINED3D_SHADER_TYPE_VERTEX
;
transform_projection
(
context
,
state
,
state_id
)
;
context
->
constant_update_mask
|=
WINED3D_SHADER_CONST_FFP_PROJ
;
}
static
void
glsl_vertex_pipe_viewport
(
struct
wined3d_context
*
context
,
...
...
dlls/wined3d/state.c
View file @
05757794
...
...
@@ -132,7 +132,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_
}
if
(
context
->
last_was_rhw
&&
!
isStateDirty
(
context
,
STATE_TRANSFORM
(
WINED3D_TS_PROJECTION
)))
transform_projection
(
context
,
state
,
STATE_TRANSFORM
(
WINED3D_TS_PROJECTION
));
context_apply_state
(
context
,
state
,
STATE_TRANSFORM
(
WINED3D_TS_PROJECTION
));
}
static
void
state_cullmode
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
...
...
@@ -4029,7 +4029,7 @@ static void transform_view(struct wined3d_context *context, const struct wined3d
}
}
void
transform_projection
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
static
void
transform_projection
(
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
projection
;
...
...
dlls/wined3d/wined3d_private.h
View file @
05757794
...
...
@@ -307,7 +307,8 @@ enum wined3d_shader_resource_type
#define WINED3D_SHADER_CONST_PS_Y_CORR 0x00000100
#define WINED3D_SHADER_CONST_PS_NP2_FIXUP 0x00000200
#define WINED3D_SHADER_CONST_FFP_MODELVIEW 0x00000400
#define WINED3D_SHADER_CONST_FFP_PS 0x00000800
#define WINED3D_SHADER_CONST_FFP_PROJ 0x00000800
#define WINED3D_SHADER_CONST_FFP_PS 0x00001000
enum
wined3d_shader_register_type
{
...
...
@@ -2812,8 +2813,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_projection
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
void
transform_texture
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
void
state_ambient
(
struct
wined3d_context
*
context
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment