Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
wine
wine-winehq
Commits
bdd97858
Commit
bdd97858
authored
May 29, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
May 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Only write gl_ClipVertex if clipping is enabled in…
wined3d: Only write gl_ClipVertex if clipping is enabled in shader_glsl_generate_ffp_vertex_shader().
parent
1c2392dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
24 deletions
+26
-24
glsl_shader.c
dlls/wined3d/glsl_shader.c
+2
-1
state.c
dlls/wined3d/state.c
+18
-22
utils.c
dlls/wined3d/utils.c
+4
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-1
No files found.
dlls/wined3d/glsl_shader.c
View file @
bdd97858
...
...
@@ -4937,7 +4937,8 @@ static GLhandleARB shader_glsl_generate_ffp_vertex_shader(struct wined3d_shader_
shader_addline
(
buffer
,
"vec4 ec_pos = gl_ModelViewMatrix * gl_Vertex;
\n
"
);
shader_addline
(
buffer
,
"gl_Position = gl_ProjectionMatrix * ec_pos;
\n
"
);
shader_addline
(
buffer
,
"gl_ClipVertex = ec_pos;
\n
"
);
if
(
settings
->
clipping
)
shader_addline
(
buffer
,
"gl_ClipVertex = ec_pos;
\n
"
);
shader_addline
(
buffer
,
"ec_pos /= ec_pos.w;
\n
"
);
if
(
!
settings
->
normal
)
...
...
dlls/wined3d/state.c
View file @
bdd97858
...
...
@@ -593,32 +593,28 @@ void state_clipping(struct wined3d_context *context, const struct wined3d_state
DWORD
enable
=
0xffffffff
;
DWORD
disable
=
0x00000000
;
if
(
use_vs
(
state
))
if
(
use_vs
(
state
)
&&
!
context
->
d3d_info
->
vs_clipping
)
{
if
(
!
context
->
d3d_info
->
vs_clipping
)
{
/* The spec says that opengl clipping planes are disabled when using shaders. Direct3D planes aren't,
* so that is an issue. The MacOS ATI driver keeps clipping planes activated with shaders in some
* conditions I got sick of tracking down. The shader state handler disables all clip planes because
* of that - don't do anything here and keep them disabled
*/
if
(
state
->
render_states
[
WINED3D_RS_CLIPPLANEENABLE
])
{
static
BOOL
warned
=
FALSE
;
if
(
!
warned
)
{
FIXME
(
"Clipping not supported with vertex shaders
\n
"
);
warned
=
TRUE
;
}
}
return
;
}
static
BOOL
warned
;
/* glEnable(GL_CLIP_PLANEx) doesn't apply to vertex shaders. The enabled / disabled planes are
* hardcoded into the shader. Update the shader to update the enabled clipplanes */
context
->
select_shader
=
1
;
context
->
load_constants
=
1
;
/* The OpenGL spec says that clipping planes are disabled when using
* shaders. Direct3D planes aren't, so that is an issue. The MacOS ATI
* driver keeps clipping planes activated with shaders in some
* conditions I got sick of tracking down. The shader state handler
* disables all clip planes because of that - don't do anything here
* and keep them disabled. */
if
(
state
->
render_states
[
WINED3D_RS_CLIPPLANEENABLE
]
&&
!
warned
++
)
FIXME
(
"Clipping not supported with vertex shaders
\n
"
);
return
;
}
/* glEnable(GL_CLIP_PLANEx) doesn't apply to (ARB backend) vertex shaders.
* The enabled / disabled planes are hardcoded into the shader. Update the
* shader to update the enabled clipplanes. In case of fixed function, we
* need to update the clipping field from ffp_vertex_settings. */
context
->
select_shader
=
1
;
context
->
load_constants
=
1
;
/* TODO: Keep track of previously enabled clipplanes to avoid unnecessary resetting
* of already set values
*/
...
...
dlls/wined3d/utils.c
View file @
bdd97858
...
...
@@ -3532,6 +3532,8 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct
{
memset
(
settings
,
0
,
sizeof
(
*
settings
));
settings
->
clipping
=
state
->
render_states
[
WINED3D_RS_CLIPPING
]
&&
state
->
render_states
[
WINED3D_RS_CLIPPLANEENABLE
];
settings
->
point_size
=
state
->
gl_primitive_type
==
GL_POINTS
;
if
(
!
state
->
render_states
[
WINED3D_RS_FOGENABLE
])
settings
->
fog_mode
=
WINED3D_FFP_VS_FOG_OFF
;
...
...
@@ -3551,6 +3553,8 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct
return
;
}
settings
->
clipping
=
state
->
render_states
[
WINED3D_RS_CLIPPING
]
&&
state
->
render_states
[
WINED3D_RS_CLIPPLANEENABLE
];
settings
->
normal
=
!!
(
si
->
use_map
&
(
1
<<
WINED3D_FFP_NORMAL
));
settings
->
normalize
=
settings
->
normal
&&
state
->
render_states
[
WINED3D_RS_NORMALIZENORMALS
];
settings
->
lighting
=
!!
state
->
render_states
[
WINED3D_RS_LIGHTING
];
...
...
dlls/wined3d/wined3d_private.h
View file @
bdd97858
...
...
@@ -1716,6 +1716,7 @@ struct wined3d_ffp_vs_settings
DWORD
ambient_source
:
2
;
DWORD
specular_source
:
2
;
DWORD
clipping
:
1
;
DWORD
normal
:
1
;
DWORD
normalize
:
1
;
DWORD
lighting
:
1
;
...
...
@@ -1723,7 +1724,7 @@ struct wined3d_ffp_vs_settings
DWORD
point_size
:
1
;
DWORD
fog_mode
:
2
;
DWORD
texcoords
:
8
;
/* MAX_TEXTURES */
DWORD
padding
:
1
7
;
DWORD
padding
:
1
6
;
BYTE
texgen
[
MAX_TEXTURES
];
};
...
...
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