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
1881bad4
Commit
1881bad4
authored
Feb 19, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Send light enable updates through the command stream.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2fd3aadd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
15 deletions
+53
-15
cs.c
dlls/wined3d/cs.c
+50
-0
device.c
dlls/wined3d/device.c
+2
-15
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/cs.c
View file @
1881bad4
...
...
@@ -55,6 +55,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_SET_COLOR_KEY
,
WINED3D_CS_OP_SET_MATERIAL
,
WINED3D_CS_OP_SET_LIGHT
,
WINED3D_CS_OP_SET_LIGHT_ENABLE
,
WINED3D_CS_OP_RESET_STATE
,
WINED3D_CS_OP_CALLBACK
,
WINED3D_CS_OP_QUERY_ISSUE
,
...
...
@@ -285,6 +286,13 @@ struct wined3d_cs_set_light
struct
wined3d_light_info
light
;
};
struct
wined3d_cs_set_light_enable
{
enum
wined3d_cs_op
opcode
;
unsigned
int
idx
;
BOOL
enable
;
};
struct
wined3d_cs_reset_state
{
enum
wined3d_cs_op
opcode
;
...
...
@@ -1399,6 +1407,13 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
light_info
->
OriginalIndex
=
light_idx
;
}
if
(
light_info
->
glIndex
!=
-
1
)
{
if
(
light_info
->
OriginalParms
.
type
!=
op
->
light
.
OriginalParms
.
type
)
device_invalidate_state
(
cs
->
device
,
STATE_LIGHT_TYPE
);
device_invalidate_state
(
cs
->
device
,
STATE_ACTIVELIGHT
(
light_info
->
glIndex
));
}
light_info
->
OriginalParms
=
op
->
light
.
OriginalParms
;
light_info
->
position
=
op
->
light
.
position
;
light_info
->
direction
=
op
->
light
.
direction
;
...
...
@@ -1417,6 +1432,40 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
cs
->
ops
->
submit
(
cs
);
}
static
void
wined3d_cs_exec_set_light_enable
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_cs_set_light_enable
*
op
=
data
;
struct
wined3d_device
*
device
=
cs
->
device
;
struct
wined3d_light_info
*
light_info
;
int
prev_idx
;
if
(
!
(
light_info
=
wined3d_state_get_light
(
&
cs
->
state
,
op
->
idx
)))
{
ERR
(
"Light doesn't exist.
\n
"
);
return
;
}
prev_idx
=
light_info
->
glIndex
;
wined3d_state_enable_light
(
&
cs
->
state
,
&
device
->
adapter
->
d3d_info
,
light_info
,
op
->
enable
);
if
(
light_info
->
glIndex
!=
prev_idx
)
{
device_invalidate_state
(
device
,
STATE_LIGHT_TYPE
);
device_invalidate_state
(
device
,
STATE_ACTIVELIGHT
(
op
->
enable
?
light_info
->
glIndex
:
prev_idx
));
}
}
void
wined3d_cs_emit_set_light_enable
(
struct
wined3d_cs
*
cs
,
unsigned
int
idx
,
BOOL
enable
)
{
struct
wined3d_cs_set_light_enable
*
op
;
op
=
cs
->
ops
->
require_space
(
cs
,
sizeof
(
*
op
));
op
->
opcode
=
WINED3D_CS_OP_SET_LIGHT_ENABLE
;
op
->
idx
=
idx
;
op
->
enable
=
enable
;
cs
->
ops
->
submit
(
cs
);
}
static
void
wined3d_cs_exec_reset_state
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
struct
wined3d_adapter
*
adapter
=
cs
->
device
->
adapter
;
...
...
@@ -1614,6 +1663,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_COLOR_KEY */
wined3d_cs_exec_set_color_key
,
/* WINED3D_CS_OP_SET_MATERIAL */
wined3d_cs_exec_set_material
,
/* WINED3D_CS_OP_SET_LIGHT */
wined3d_cs_exec_set_light
,
/* WINED3D_CS_OP_SET_LIGHT_ENABLE */
wined3d_cs_exec_set_light_enable
,
/* WINED3D_CS_OP_RESET_STATE */
wined3d_cs_exec_reset_state
,
/* WINED3D_CS_OP_CALLBACK */
wined3d_cs_exec_callback
,
/* WINED3D_CS_OP_QUERY_ISSUE */
wined3d_cs_exec_query_issue
,
...
...
dlls/wined3d/device.c
View file @
1881bad4
...
...
@@ -1568,14 +1568,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
light
->
direction
.
x
,
light
->
direction
.
y
,
light
->
direction
.
z
,
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
->
recording
)
{
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
;
...
...
@@ -1681,7 +1673,6 @@ HRESULT CDECL wined3d_device_get_light(const struct wined3d_device *device,
HRESULT
CDECL
wined3d_device_set_light_enable
(
struct
wined3d_device
*
device
,
UINT
light_idx
,
BOOL
enable
)
{
struct
wined3d_light_info
*
light_info
;
int
prev_idx
;
TRACE
(
"device %p, light_idx %u, enable %#x.
\n
"
,
device
,
light_idx
,
enable
);
...
...
@@ -1698,13 +1689,9 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
}
}
prev_idx
=
light_info
->
glIndex
;
wined3d_state_enable_light
(
device
->
update_state
,
&
device
->
adapter
->
d3d_info
,
light_info
,
enable
);
if
(
!
device
->
recording
&&
light_info
->
glIndex
!=
prev_idx
)
{
device_invalidate_state
(
device
,
STATE_LIGHT_TYPE
);
device_invalidate_state
(
device
,
STATE_ACTIVELIGHT
(
enable
?
light_info
->
glIndex
:
prev_idx
));
}
if
(
!
device
->
recording
)
wined3d_cs_emit_set_light_enable
(
device
->
cs
,
light_idx
,
enable
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
1881bad4
...
...
@@ -3204,6 +3204,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs,
void
wined3d_cs_emit_set_index_buffer
(
struct
wined3d_cs
*
cs
,
struct
wined3d_buffer
*
buffer
,
enum
wined3d_format_id
format_id
,
unsigned
int
offset
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_light
(
struct
wined3d_cs
*
cs
,
const
struct
wined3d_light_info
*
light
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_light_enable
(
struct
wined3d_cs
*
cs
,
unsigned
int
idx
,
BOOL
enable
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_material
(
struct
wined3d_cs
*
cs
,
const
struct
wined3d_material
*
material
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_emit_set_predication
(
struct
wined3d_cs
*
cs
,
struct
wined3d_query
*
predicate
,
BOOL
value
)
DECLSPEC_HIDDEN
;
...
...
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