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
74c5a22d
Commit
74c5a22d
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 invalidate the current ffp vertex shader if the light type changed.
As opposed to any time a light parameter changed.
parent
bdd97858
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
20 deletions
+30
-20
device.c
dlls/wined3d/device.c
+14
-4
glsl_shader.c
dlls/wined3d/glsl_shader.c
+9
-15
state.c
dlls/wined3d/state.c
+2
-0
utils.c
dlls/wined3d/utils.c
+2
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-1
No files found.
dlls/wined3d/device.c
View file @
74c5a22d
...
...
@@ -1783,6 +1783,14 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
TRACE
(
"... Range(%f), Falloff(%f), Theta(%f), Phi(%f)
\n
"
,
light
->
range
,
light
->
falloff
,
light
->
theta
,
light
->
phi
);
/* Update the live definitions if the light is currently assigned a glIndex. */
if
(
object
->
glIndex
!=
-
1
&&
!
device
->
isRecordingState
)
{
if
(
object
->
OriginalParms
.
type
!=
light
->
type
)
device_invalidate_state
(
device
,
STATE_LIGHT_TYPE
);
device_invalidate_state
(
device
,
STATE_ACTIVELIGHT
(
object
->
glIndex
));
}
/* Save away the information. */
object
->
OriginalParms
=
*
light
;
...
...
@@ -1855,10 +1863,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
FIXME
(
"Unrecognized light type %#x.
\n
"
,
light
->
type
);
}
/* Update the live definitions if the light is currently assigned a glIndex. */
if
(
object
->
glIndex
!=
-
1
&&
!
device
->
isRecordingState
)
device_invalidate_state
(
device
,
STATE_ACTIVELIGHT
(
object
->
glIndex
));
return
WINED3D_OK
;
}
...
...
@@ -1932,7 +1936,10 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
if
(
light_info
->
glIndex
!=
-
1
)
{
if
(
!
device
->
isRecordingState
)
{
device_invalidate_state
(
device
,
STATE_LIGHT_TYPE
);
device_invalidate_state
(
device
,
STATE_ACTIVELIGHT
(
light_info
->
glIndex
));
}
device
->
updateStateBlock
->
state
.
lights
[
light_info
->
glIndex
]
=
NULL
;
light_info
->
glIndex
=
-
1
;
...
...
@@ -1978,9 +1985,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
/* i == light_info->glIndex */
if
(
!
device
->
isRecordingState
)
{
device_invalidate_state
(
device
,
STATE_LIGHT_TYPE
);
device_invalidate_state
(
device
,
STATE_ACTIVELIGHT
(
i
));
}
}
}
return
WINED3D_OK
;
}
...
...
dlls/wined3d/glsl_shader.c
View file @
74c5a22d
...
...
@@ -6729,13 +6729,6 @@ static void glsl_vertex_pipe_shader(struct wined3d_context *context,
context
->
select_shader
=
1
;
}
static
void
glsl_vertex_pipe_light
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
light
(
context
,
state
,
state_id
);
context
->
select_shader
=
1
;
}
static
const
struct
StateEntryTemplate
glsl_vertex_pipe_vp_states
[]
=
{
{
STATE_VDECL
,
{
STATE_VDECL
,
vertexdeclaration
},
WINED3D_GL_EXT_NONE
},
...
...
@@ -6776,14 +6769,15 @@ static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] =
{
STATE_CLIPPLANE
(
30
),
{
STATE_CLIPPLANE
(
30
),
clipplane
},
WINED3D_GL_EXT_NONE
},
{
STATE_CLIPPLANE
(
31
),
{
STATE_CLIPPLANE
(
31
),
clipplane
},
WINED3D_GL_EXT_NONE
},
/* Lights */
{
STATE_ACTIVELIGHT
(
0
),
{
STATE_ACTIVELIGHT
(
0
),
glsl_vertex_pipe_light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
1
),
{
STATE_ACTIVELIGHT
(
1
),
glsl_vertex_pipe_light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
2
),
{
STATE_ACTIVELIGHT
(
2
),
glsl_vertex_pipe_light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
3
),
{
STATE_ACTIVELIGHT
(
3
),
glsl_vertex_pipe_light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
4
),
{
STATE_ACTIVELIGHT
(
4
),
glsl_vertex_pipe_light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
5
),
{
STATE_ACTIVELIGHT
(
5
),
glsl_vertex_pipe_light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
6
),
{
STATE_ACTIVELIGHT
(
6
),
glsl_vertex_pipe_light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
7
),
{
STATE_ACTIVELIGHT
(
7
),
glsl_vertex_pipe_light
},
WINED3D_GL_EXT_NONE
},
{
STATE_LIGHT_TYPE
,
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
0
),
{
STATE_ACTIVELIGHT
(
0
),
light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
1
),
{
STATE_ACTIVELIGHT
(
1
),
light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
2
),
{
STATE_ACTIVELIGHT
(
2
),
light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
3
),
{
STATE_ACTIVELIGHT
(
3
),
light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
4
),
{
STATE_ACTIVELIGHT
(
4
),
light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
5
),
{
STATE_ACTIVELIGHT
(
5
),
light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
6
),
{
STATE_ACTIVELIGHT
(
6
),
light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
7
),
{
STATE_ACTIVELIGHT
(
7
),
light
},
WINED3D_GL_EXT_NONE
},
/* Viewport */
{
STATE_VIEWPORT
,
{
STATE_VIEWPORT
,
viewport_vertexpart
},
WINED3D_GL_EXT_NONE
},
/* Transform states */
...
...
dlls/wined3d/state.c
View file @
74c5a22d
...
...
@@ -5167,6 +5167,7 @@ const struct StateEntryTemplate vp_ffp_states[] =
{
STATE_CLIPPLANE
(
30
),
{
STATE_CLIPPLANE
(
30
),
clipplane
},
WINED3D_GL_EXT_NONE
},
{
STATE_CLIPPLANE
(
31
),
{
STATE_CLIPPLANE
(
31
),
clipplane
},
WINED3D_GL_EXT_NONE
},
/* Lights */
{
STATE_LIGHT_TYPE
,
{
STATE_LIGHT_TYPE
,
state_nop
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
0
),
{
STATE_ACTIVELIGHT
(
0
),
light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
1
),
{
STATE_ACTIVELIGHT
(
1
),
light
},
WINED3D_GL_EXT_NONE
},
{
STATE_ACTIVELIGHT
(
2
),
{
STATE_ACTIVELIGHT
(
2
),
light
},
WINED3D_GL_EXT_NONE
},
...
...
@@ -5862,6 +5863,7 @@ static void validate_state_table(struct StateEntry *state_table)
STATE_GEOMETRY_SHADER
,
STATE_PIXELSHADER
,
STATE_VIEWPORT
,
STATE_LIGHT_TYPE
,
STATE_SCISSORRECT
,
STATE_FRONTFACE
,
STATE_POINTSPRITECOORDORIGIN
,
...
...
dlls/wined3d/utils.c
View file @
74c5a22d
...
...
@@ -2572,6 +2572,8 @@ const char *debug_d3dstate(DWORD state)
return
"STATE_VERTEXSHADERCONSTANT"
;
if
(
STATE_IS_PIXELSHADERCONSTANT
(
state
))
return
"STATE_PIXELSHADERCONSTANT"
;
if
(
STATE_IS_LIGHT_TYPE
(
state
))
return
"STATE_LIGHT_TYPE"
;
if
(
STATE_IS_ACTIVELIGHT
(
state
))
return
wine_dbg_sprintf
(
"STATE_ACTIVELIGHT(%#x)"
,
state
-
STATE_ACTIVELIGHT
(
0
));
if
(
STATE_IS_SCISSORRECT
(
state
))
...
...
dlls/wined3d/wined3d_private.h
View file @
74c5a22d
...
...
@@ -983,7 +983,9 @@ extern glMultiTexCoordFunc multi_texcoord_funcs[WINED3D_FFP_EMIT_COUNT] DECLSPEC
#define STATE_IS_VERTEXSHADERCONSTANT(a) ((a) == STATE_VERTEXSHADERCONSTANT)
#define STATE_IS_PIXELSHADERCONSTANT(a) ((a) == STATE_PIXELSHADERCONSTANT)
#define STATE_ACTIVELIGHT(a) (STATE_PIXELSHADERCONSTANT + (a) + 1)
#define STATE_LIGHT_TYPE (STATE_PIXELSHADERCONSTANT + 1)
#define STATE_IS_LIGHT_TYPE(a) ((a) == STATE_LIGHT_TYPE)
#define STATE_ACTIVELIGHT(a) (STATE_LIGHT_TYPE + 1 + (a))
#define STATE_IS_ACTIVELIGHT(a) ((a) >= STATE_ACTIVELIGHT(0) && (a) < STATE_ACTIVELIGHT(MAX_ACTIVE_LIGHTS))
#define STATE_SCISSORRECT (STATE_ACTIVELIGHT(MAX_ACTIVE_LIGHTS - 1) + 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