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
a3401dfa
Commit
a3401dfa
authored
Apr 13, 2016
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Explicitly pass a wined3d_state structure to draw_primitive().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c9d82ffa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
14 deletions
+16
-14
cs.c
dlls/wined3d/cs.c
+1
-1
drawprim.c
dlls/wined3d/drawprim.c
+12
-11
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-2
No files found.
dlls/wined3d/cs.c
View file @
a3401dfa
...
...
@@ -311,7 +311,7 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
{
const
struct
wined3d_cs_draw
*
op
=
data
;
draw_primitive
(
cs
->
device
,
op
->
start_idx
,
op
->
index_count
,
draw_primitive
(
cs
->
device
,
&
cs
->
device
->
state
,
op
->
start_idx
,
op
->
index_count
,
op
->
start_instance
,
op
->
instance_count
,
op
->
indexed
);
}
...
...
dlls/wined3d/drawprim.c
View file @
a3401dfa
...
...
@@ -407,10 +407,11 @@ static void remove_vbos(struct wined3d_context *context,
}
/* Routine common to the draw primitive and draw indexed primitive routines */
void
draw_primitive
(
struct
wined3d_device
*
device
,
UINT
start_idx
,
UINT
index_count
,
UINT
start_instance
,
UINT
instance_count
,
BOOL
indexed
)
void
draw_primitive
(
struct
wined3d_device
*
device
,
const
struct
wined3d_state
*
state
,
unsigned
int
start_idx
,
unsigned
int
index_count
,
unsigned
int
start_instance
,
unsigned
int
instance_count
,
BOOL
indexed
)
{
const
struct
wined3d_
state
*
state
=
&
device
->
state
;
const
struct
wined3d_
fb_state
*
fb
=
state
->
fb
;
const
struct
wined3d_stream_info
*
stream_info
;
struct
wined3d_event_query
*
ib_query
=
NULL
;
struct
wined3d_stream_info
si_emulated
;
...
...
@@ -423,7 +424,7 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
if
(
!
index_count
)
return
;
context
=
context_acquire
(
device
,
wined3d_rendertarget_view_get_surface
(
device
->
fb
.
render_targets
[
0
]));
context
=
context_acquire
(
device
,
wined3d_rendertarget_view_get_surface
(
fb
->
render_targets
[
0
]));
if
(
!
context
->
valid
)
{
context_release
(
context
);
...
...
@@ -432,9 +433,9 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
}
gl_info
=
context
->
gl_info
;
for
(
i
=
0
;
i
<
device
->
adapter
->
gl_info
.
limits
.
buffers
;
++
i
)
for
(
i
=
0
;
i
<
gl_info
->
limits
.
buffers
;
++
i
)
{
struct
wined3d_rendertarget_view
*
rtv
=
device
->
fb
.
render_targets
[
i
];
struct
wined3d_rendertarget_view
*
rtv
=
fb
->
render_targets
[
i
];
struct
wined3d_surface
*
target
=
wined3d_rendertarget_view_get_surface
(
rtv
);
if
(
target
&&
rtv
->
format
->
id
!=
WINED3DFMT_NULL
)
...
...
@@ -452,16 +453,16 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
}
}
if
(
device
->
fb
.
depth_stencil
)
if
(
fb
->
depth_stencil
)
{
/* Note that this depends on the context_acquire() call above to set
* context->render_offscreen properly. We don't currently take the
* Z-compare function into account, but we could skip loading the
* depthstencil for D3DCMP_NEVER and D3DCMP_ALWAYS as well. Also note
* that we never copy the stencil data.*/
DWORD
location
=
context
->
render_offscreen
?
device
->
fb
.
depth_stencil
->
resource
->
draw_binding
DWORD
location
=
context
->
render_offscreen
?
fb
->
depth_stencil
->
resource
->
draw_binding
:
WINED3D_LOCATION_DRAWABLE
;
struct
wined3d_surface
*
ds
=
wined3d_rendertarget_view_get_surface
(
device
->
fb
.
depth_stencil
);
struct
wined3d_surface
*
ds
=
wined3d_rendertarget_view_get_surface
(
fb
->
depth_stencil
);
if
(
state
->
render_states
[
WINED3D_RS_ZWRITEENABLE
]
||
state
->
render_states
[
WINED3D_RS_ZENABLE
])
{
...
...
@@ -494,9 +495,9 @@ void draw_primitive(struct wined3d_device *device, UINT start_idx, UINT index_co
return
;
}
if
(
device
->
fb
.
depth_stencil
&&
state
->
render_states
[
WINED3D_RS_ZWRITEENABLE
])
if
(
fb
->
depth_stencil
&&
state
->
render_states
[
WINED3D_RS_ZWRITEENABLE
])
{
struct
wined3d_surface
*
ds
=
wined3d_rendertarget_view_get_surface
(
device
->
fb
.
depth_stencil
);
struct
wined3d_surface
*
ds
=
wined3d_rendertarget_view_get_surface
(
fb
->
depth_stencil
);
DWORD
location
=
context
->
render_offscreen
?
ds
->
container
->
resource
.
draw_binding
:
WINED3D_LOCATION_DRAWABLE
;
surface_modify_ds_location
(
ds
,
location
,
ds
->
ds_current_size
.
cx
,
ds
->
ds_current_size
.
cy
);
...
...
dlls/wined3d/wined3d_private.h
View file @
a3401dfa
...
...
@@ -1181,8 +1181,9 @@ struct wined3d_stream_info
WORD
use_map
;
/* MAX_ATTRIBS, 16 */
};
void
draw_primitive
(
struct
wined3d_device
*
device
,
UINT
start_idx
,
UINT
index_count
,
UINT
start_instance
,
UINT
instance_count
,
BOOL
indexed
)
DECLSPEC_HIDDEN
;
void
draw_primitive
(
struct
wined3d_device
*
device
,
const
struct
wined3d_state
*
state
,
unsigned
int
start_idx
,
unsigned
int
index_count
,
unsigned
int
start_instance
,
unsigned
int
instance_count
,
BOOL
indexed
)
DECLSPEC_HIDDEN
;
DWORD
get_flexible_vertex_size
(
DWORD
d3dvtVertexType
)
DECLSPEC_HIDDEN
;
#define eps 1e-8f
...
...
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