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
aa3a43f7
Commit
aa3a43f7
authored
Aug 22, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't lock the dst volume in device_update_volume.
parent
5ff12375
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
23 deletions
+43
-23
device.c
dlls/wined3d/device.c
+13
-14
volume.c
dlls/wined3d/volume.c
+27
-9
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-0
No files found.
dlls/wined3d/device.c
View file @
aa3a43f7
...
@@ -4092,29 +4092,28 @@ static HRESULT device_update_volume(struct wined3d_device *device,
...
@@ -4092,29 +4092,28 @@ static HRESULT device_update_volume(struct wined3d_device *device,
struct
wined3d_volume
*
src_volume
,
struct
wined3d_volume
*
dst_volume
)
struct
wined3d_volume
*
src_volume
,
struct
wined3d_volume
*
dst_volume
)
{
{
struct
wined3d_map_desc
src
;
struct
wined3d_map_desc
src
;
struct
wined3d_map_desc
dst
;
HRESULT
hr
;
HRESULT
hr
;
struct
wined3d_bo_address
data
;
struct
wined3d_context
*
context
;
TRACE
(
"device %p, src_volume %p, dst_volume %p.
\n
"
,
TRACE
(
"device %p, src_volume %p, dst_volume %p.
\n
"
,
device
,
src_volume
,
dst_volume
);
device
,
src_volume
,
dst_volume
);
/* TODO: Implement direct loading into the gl volume instead of using
* memcpy and dirtification to improve loading performance. */
if
(
FAILED
(
hr
=
wined3d_volume_map
(
src_volume
,
&
src
,
NULL
,
WINED3D_MAP_READONLY
)))
if
(
FAILED
(
hr
=
wined3d_volume_map
(
src_volume
,
&
src
,
NULL
,
WINED3D_MAP_READONLY
)))
return
hr
;
return
hr
;
if
(
FAILED
(
hr
=
wined3d_volume_map
(
dst_volume
,
&
dst
,
NULL
,
WINED3D_MAP_DISCARD
)))
{
wined3d_volume_unmap
(
src_volume
);
return
hr
;
}
memcpy
(
dst
.
data
,
src
.
data
,
dst_volume
->
resource
.
size
);
context
=
context_acquire
(
device
,
NULL
);
hr
=
wined3d_volume_unmap
(
dst_volume
);
wined3d_volume_load
(
dst_volume
,
context
,
FALSE
);
if
(
FAILED
(
hr
))
wined3d_volume_unmap
(
src_volume
);
data
.
buffer_object
=
0
;
else
data
.
addr
=
src
.
data
;
hr
=
wined3d_volume_unmap
(
src_volume
);
wined3d_volume_upload_data
(
dst_volume
,
context
,
&
data
);
wined3d_volume_invalidate_location
(
dst_volume
,
~
WINED3D_LOCATION_TEXTURE_RGB
);
context_release
(
context
);
hr
=
wined3d_volume_unmap
(
src_volume
);
return
hr
;
return
hr
;
}
}
...
...
dlls/wined3d/volume.c
View file @
aa3a43f7
...
@@ -69,7 +69,7 @@ static void wined3d_volume_allocate_texture(const struct wined3d_volume *volume,
...
@@ -69,7 +69,7 @@ static void wined3d_volume_allocate_texture(const struct wined3d_volume *volume,
}
}
/* Context activation is done by the caller. */
/* Context activation is done by the caller. */
static
void
wined3d_volume_upload_data
(
struct
wined3d_volume
*
volume
,
const
struct
wined3d_context
*
context
,
void
wined3d_volume_upload_data
(
struct
wined3d_volume
*
volume
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_bo_address
*
data
)
const
struct
wined3d_bo_address
*
data
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
...
@@ -105,7 +105,7 @@ static void wined3d_volume_validate_location(struct wined3d_volume *volume, DWOR
...
@@ -105,7 +105,7 @@ static void wined3d_volume_validate_location(struct wined3d_volume *volume, DWOR
TRACE
(
"new location flags are %s.
\n
"
,
wined3d_debug_location
(
volume
->
locations
));
TRACE
(
"new location flags are %s.
\n
"
,
wined3d_debug_location
(
volume
->
locations
));
}
}
static
void
wined3d_volume_invalidate_location
(
struct
wined3d_volume
*
volume
,
DWORD
location
)
void
wined3d_volume_invalidate_location
(
struct
wined3d_volume
*
volume
,
DWORD
location
)
{
{
TRACE
(
"Volume %p, clearing %s.
\n
"
,
volume
,
wined3d_debug_location
(
location
));
TRACE
(
"Volume %p, clearing %s.
\n
"
,
volume
,
wined3d_debug_location
(
location
));
volume
->
locations
&=
~
location
;
volume
->
locations
&=
~
location
;
...
@@ -132,10 +132,31 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume)
...
@@ -132,10 +132,31 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume)
wined3d_volume_invalidate_location
(
volume
,
WINED3D_LOCATION_SYSMEM
);
wined3d_volume_invalidate_location
(
volume
,
WINED3D_LOCATION_SYSMEM
);
}
}
static
DWORD
volume_access_from_location
(
DWORD
location
)
{
switch
(
location
)
{
case
WINED3D_LOCATION_DISCARDED
:
return
0
;
case
WINED3D_LOCATION_SYSMEM
:
return
WINED3D_RESOURCE_ACCESS_CPU
;
case
WINED3D_LOCATION_TEXTURE_RGB
:
return
WINED3D_RESOURCE_ACCESS_GPU
;
default:
FIXME
(
"Unhandled location %#x.
\n
"
,
location
);
return
0
;
}
}
/* Context activation is done by the caller. */
/* Context activation is done by the caller. */
static
void
wined3d_volume_load_location
(
struct
wined3d_volume
*
volume
,
static
void
wined3d_volume_load_location
(
struct
wined3d_volume
*
volume
,
struct
wined3d_context
*
context
,
DWORD
location
)
struct
wined3d_context
*
context
,
DWORD
location
)
{
{
DWORD
required_access
=
volume_access_from_location
(
location
);
TRACE
(
"Volume %p, loading %s, have %s.
\n
"
,
volume
,
wined3d_debug_location
(
location
),
TRACE
(
"Volume %p, loading %s, have %s.
\n
"
,
volume
,
wined3d_debug_location
(
location
),
wined3d_debug_location
(
volume
->
locations
));
wined3d_debug_location
(
volume
->
locations
));
...
@@ -145,14 +166,11 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
...
@@ -145,14 +166,11 @@ static void wined3d_volume_load_location(struct wined3d_volume *volume,
return
;
return
;
}
}
if
(
!
(
volume
->
resource
.
access_flags
&
WINED3D_RESOURCE_ACCESS_GPU
)
)
if
(
(
volume
->
resource
.
access_flags
&
required_access
)
!=
required_access
)
{
{
if
(
location
&
~
WINED3D_LOCATION_SYSMEM
)
ERR
(
"Operation requires %#x access, but volume only has %#x.
\n
"
,
{
required_access
,
volume
->
resource
.
access_flags
);
ERR
(
"Trying to load a cpu-only access volume into %s.
\n
"
,
return
;
wined3d_debug_location
(
location
));
return
;
}
}
}
switch
(
location
)
switch
(
location
)
...
...
dlls/wined3d/wined3d_private.h
View file @
aa3a43f7
...
@@ -2077,6 +2077,9 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc
...
@@ -2077,6 +2077,9 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc
void
wined3d_volume_load
(
struct
wined3d_volume
*
volume
,
struct
wined3d_context
*
context
,
BOOL
srgb_mode
)
DECLSPEC_HIDDEN
;
void
wined3d_volume_load
(
struct
wined3d_volume
*
volume
,
struct
wined3d_context
*
context
,
BOOL
srgb_mode
)
DECLSPEC_HIDDEN
;
void
volume_set_container
(
struct
wined3d_volume
*
volume
,
struct
wined3d_texture
*
container
)
DECLSPEC_HIDDEN
;
void
volume_set_container
(
struct
wined3d_volume
*
volume
,
struct
wined3d_texture
*
container
)
DECLSPEC_HIDDEN
;
void
wined3d_volume_invalidate_location
(
struct
wined3d_volume
*
volume
,
DWORD
location
)
DECLSPEC_HIDDEN
;
void
wined3d_volume_upload_data
(
struct
wined3d_volume
*
volume
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_bo_address
*
data
)
DECLSPEC_HIDDEN
;
struct
wined3d_surface_dib
struct
wined3d_surface_dib
{
{
...
...
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