Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
c4ccdb24
Commit
c4ccdb24
authored
Jul 10, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Synchronise WINED3D_CS_OP_DRAW resource access.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ff584b98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
0 deletions
+91
-0
cs.c
dlls/wined3d/cs.c
+91
-0
No files found.
dlls/wined3d/cs.c
View file @
c4ccdb24
...
...
@@ -361,7 +361,11 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
static
void
wined3d_cs_exec_draw
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
struct
wined3d_state
*
state
=
&
cs
->
device
->
state
;
struct
wined3d_shader_sampler_map_entry
*
entry
;
struct
wined3d_shader_resource_view
*
view
;
const
struct
wined3d_cs_draw
*
op
=
data
;
struct
wined3d_shader
*
shader
;
unsigned
int
i
,
j
;
if
(
!
cs
->
device
->
adapter
->
gl_info
.
supported
[
ARB_DRAW_ELEMENTS_BASE_VERTEX
]
&&
state
->
load_base_vertex_index
!=
op
->
base_vertex_idx
)
...
...
@@ -372,12 +376,58 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
draw_primitive
(
cs
->
device
,
state
,
op
->
base_vertex_idx
,
op
->
start_idx
,
op
->
index_count
,
op
->
start_instance
,
op
->
instance_count
,
op
->
indexed
);
if
(
op
->
indexed
)
wined3d_resource_release
(
&
state
->
index_buffer
->
resource
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
state
->
streams
);
++
i
)
{
if
(
state
->
streams
[
i
].
buffer
)
wined3d_resource_release
(
&
state
->
streams
[
i
].
buffer
->
resource
);
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
state
->
textures
);
++
i
)
{
if
(
state
->
textures
[
i
])
wined3d_resource_release
(
&
state
->
textures
[
i
]
->
resource
);
}
for
(
i
=
0
;
i
<
cs
->
device
->
adapter
->
gl_info
.
limits
.
buffers
;
++
i
)
{
if
(
state
->
fb
->
render_targets
[
i
])
wined3d_resource_release
(
state
->
fb
->
render_targets
[
i
]
->
resource
);
}
if
(
state
->
fb
->
depth_stencil
)
wined3d_resource_release
(
state
->
fb
->
depth_stencil
->
resource
);
for
(
i
=
0
;
i
<
WINED3D_SHADER_TYPE_COUNT
;
++
i
)
{
if
(
!
(
shader
=
state
->
shader
[
i
]))
continue
;
for
(
j
=
0
;
j
<
WINED3D_MAX_CBS
;
++
j
)
{
if
(
state
->
cb
[
i
][
j
])
wined3d_resource_release
(
&
state
->
cb
[
i
][
j
]
->
resource
);
}
for
(
j
=
0
;
j
<
shader
->
reg_maps
.
sampler_map
.
count
;
++
j
)
{
entry
=
&
shader
->
reg_maps
.
sampler_map
.
entries
[
j
];
if
(
!
(
view
=
state
->
shader_resource_view
[
i
][
entry
->
resource_idx
]))
continue
;
wined3d_resource_release
(
view
->
resource
);
}
}
}
void
wined3d_cs_emit_draw
(
struct
wined3d_cs
*
cs
,
int
base_vertex_idx
,
unsigned
int
start_idx
,
unsigned
int
index_count
,
unsigned
int
start_instance
,
unsigned
int
instance_count
,
BOOL
indexed
)
{
const
struct
wined3d_state
*
state
=
&
cs
->
device
->
state
;
struct
wined3d_shader_sampler_map_entry
*
entry
;
struct
wined3d_shader_resource_view
*
view
;
struct
wined3d_shader
*
shader
;
struct
wined3d_cs_draw
*
op
;
unsigned
int
i
,
j
;
op
=
cs
->
ops
->
require_space
(
cs
,
sizeof
(
*
op
));
op
->
opcode
=
WINED3D_CS_OP_DRAW
;
...
...
@@ -388,6 +438,47 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i
op
->
instance_count
=
instance_count
;
op
->
indexed
=
indexed
;
if
(
indexed
)
wined3d_resource_acquire
(
&
state
->
index_buffer
->
resource
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
state
->
streams
);
++
i
)
{
if
(
state
->
streams
[
i
].
buffer
)
wined3d_resource_acquire
(
&
state
->
streams
[
i
].
buffer
->
resource
);
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
state
->
textures
);
++
i
)
{
if
(
state
->
textures
[
i
])
wined3d_resource_acquire
(
&
state
->
textures
[
i
]
->
resource
);
}
for
(
i
=
0
;
i
<
cs
->
device
->
adapter
->
gl_info
.
limits
.
buffers
;
++
i
)
{
if
(
state
->
fb
->
render_targets
[
i
])
wined3d_resource_acquire
(
state
->
fb
->
render_targets
[
i
]
->
resource
);
}
if
(
state
->
fb
->
depth_stencil
)
wined3d_resource_acquire
(
state
->
fb
->
depth_stencil
->
resource
);
for
(
i
=
0
;
i
<
WINED3D_SHADER_TYPE_COUNT
;
++
i
)
{
if
(
!
(
shader
=
state
->
shader
[
i
]))
continue
;
for
(
j
=
0
;
j
<
WINED3D_MAX_CBS
;
++
j
)
{
if
(
state
->
cb
[
i
][
j
])
wined3d_resource_acquire
(
&
state
->
cb
[
i
][
j
]
->
resource
);
}
for
(
j
=
0
;
j
<
shader
->
reg_maps
.
sampler_map
.
count
;
++
j
)
{
entry
=
&
shader
->
reg_maps
.
sampler_map
.
entries
[
j
];
if
(
!
(
view
=
state
->
shader_resource_view
[
i
][
entry
->
resource_idx
]))
continue
;
wined3d_resource_acquire
(
view
->
resource
);
}
}
cs
->
ops
->
submit
(
cs
);
}
...
...
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