Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a27adc47
Commit
a27adc47
authored
Jun 28, 2011
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Update the vertex shader when the clipplanes are changed.
parent
67320c44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
28 deletions
+43
-28
state.c
dlls/wined3d/state.c
+43
-28
No files found.
dlls/wined3d/state.c
View file @
a27adc47
...
...
@@ -484,28 +484,59 @@ static void state_alpha(DWORD state, struct wined3d_stateblock *stateblock, stru
}
}
static
void
shaderconstant
(
DWORD
state_id
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
{
const
struct
wined3d_state
*
state
=
&
stateblock
->
state
;
struct
wined3d_device
*
device
=
stateblock
->
device
;
/* Vertex and pixel shader states will call a shader upload, don't do anything as long one of them
* has an update pending
*/
if
(
isStateDirty
(
context
,
STATE_VDECL
)
||
isStateDirty
(
context
,
STATE_PIXELSHADER
))
{
return
;
}
device
->
shader_backend
->
shader_load_constants
(
context
,
use_ps
(
state
),
use_vs
(
state
));
}
static
void
state_clipping
(
DWORD
state_id
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
{
const
struct
wined3d_state
*
state
=
&
stateblock
->
state
;
DWORD
enable
=
0xFFFFFFFF
;
DWORD
disable
=
0x00000000
;
if
(
!
stateblock
->
device
->
vs_clipping
&&
use_vs
(
state
))
if
(
use_vs
(
state
))
{
/* 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
[
WINED3DRS_CLIPPLANEENABLE
])
const
struct
wined3d_device
*
device
=
stateblock
->
device
;
if
(
!
device
->
vs_clipping
)
{
static
BOOL
warned
=
FALSE
;
if
(
!
warned
)
{
FIXME
(
"Clipping not supported with vertex shaders
\n
"
);
warned
=
TRUE
;
/* 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
[
WINED3DRS_CLIPPLANEENABLE
])
{
static
BOOL
warned
=
FALSE
;
if
(
!
warned
)
{
FIXME
(
"Clipping not supported with vertex shaders
\n
"
);
warned
=
TRUE
;
}
}
return
;
}
/* 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 */
if
(
!
isStateDirty
(
context
,
device
->
StateTable
[
STATE_VSHADER
].
representative
))
{
device
->
shader_backend
->
shader_select
(
context
,
use_ps
(
state
),
TRUE
);
if
(
!
isStateDirty
(
context
,
STATE_VERTEXSHADERCONSTANT
))
{
shaderconstant
(
STATE_VERTEXSHADERCONSTANT
,
stateblock
,
context
);
}
}
return
;
}
/* TODO: Keep track of previously enabled clipplanes to avoid unnecessary resetting
...
...
@@ -3460,22 +3491,6 @@ static void tex_coordindex(DWORD state, struct wined3d_stateblock *stateblock, s
}
}
static
void
shaderconstant
(
DWORD
state_id
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
{
const
struct
wined3d_state
*
state
=
&
stateblock
->
state
;
struct
wined3d_device
*
device
=
stateblock
->
device
;
/* Vertex and pixel shader states will call a shader upload, don't do anything as long one of them
* has an update pending
*/
if
(
isStateDirty
(
context
,
STATE_VDECL
)
||
isStateDirty
(
context
,
STATE_PIXELSHADER
))
{
return
;
}
device
->
shader_backend
->
shader_load_constants
(
context
,
use_ps
(
state
),
use_vs
(
state
));
}
static
void
tex_bumpenvlscale
(
DWORD
state
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
{
DWORD
stage
=
(
state
-
STATE_TEXTURESTAGE
(
0
,
0
))
/
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
);
...
...
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