Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fb752928
Commit
fb752928
authored
Dec 13, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't store user memory in allocatedMemory.
parent
a1762ba8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
18 deletions
+28
-18
surface.c
dlls/wined3d/surface.c
+27
-18
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/surface.c
View file @
fb752928
...
@@ -88,9 +88,6 @@ static void surface_cleanup(struct wined3d_surface *surface)
...
@@ -88,9 +88,6 @@ static void surface_cleanup(struct wined3d_surface *surface)
surface
->
resource
.
allocatedMemory
=
NULL
;
surface
->
resource
.
allocatedMemory
=
NULL
;
}
}
if
(
surface
->
flags
&
SFLAG_USERPTR
)
surface
->
resource
.
allocatedMemory
=
NULL
;
if
(
surface
->
overlay_dest
)
if
(
surface
->
overlay_dest
)
list_remove
(
&
surface
->
overlay_entry
);
list_remove
(
&
surface
->
overlay_entry
);
...
@@ -497,7 +494,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
...
@@ -497,7 +494,7 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
memcpy
(
surface
->
dib
.
bitmap_data
,
surface
->
resource
.
allocatedMemory
,
memcpy
(
surface
->
dib
.
bitmap_data
,
surface
->
resource
.
allocatedMemory
,
surface
->
resource
.
height
*
wined3d_surface_get_pitch
(
surface
));
surface
->
resource
.
height
*
wined3d_surface_get_pitch
(
surface
));
}
}
else
else
if
(
!
surface
->
user_memory
)
{
{
/* This is to make maps read the GL texture although memory is allocated. */
/* This is to make maps read the GL texture although memory is allocated. */
surface
->
flags
&=
~
SFLAG_INSYSMEM
;
surface
->
flags
&=
~
SFLAG_INSYSMEM
;
...
@@ -519,16 +516,20 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
...
@@ -519,16 +516,20 @@ static HRESULT surface_create_dib_section(struct wined3d_surface *surface)
static
void
surface_get_memory
(
const
struct
wined3d_surface
*
surface
,
struct
wined3d_bo_address
*
data
)
static
void
surface_get_memory
(
const
struct
wined3d_surface
*
surface
,
struct
wined3d_bo_address
*
data
)
{
{
if
(
surface
->
user_memory
)
{
data
->
addr
=
surface
->
user_memory
;
data
->
buffer_object
=
0
;
return
;
}
if
(
surface
->
flags
&
SFLAG_PBO
)
if
(
surface
->
flags
&
SFLAG_PBO
)
{
{
data
->
addr
=
NULL
;
data
->
addr
=
NULL
;
data
->
buffer_object
=
surface
->
pbo
;
data
->
buffer_object
=
surface
->
pbo
;
return
;
}
}
else
data
->
addr
=
surface
->
resource
.
allocatedMemory
;
{
data
->
buffer_object
=
0
;
data
->
addr
=
surface
->
resource
.
allocatedMemory
;
data
->
buffer_object
=
0
;
}
}
}
static
BOOL
surface_need_pbo
(
const
struct
wined3d_surface
*
surface
,
const
struct
wined3d_gl_info
*
gl_info
)
static
BOOL
surface_need_pbo
(
const
struct
wined3d_surface
*
surface
,
const
struct
wined3d_gl_info
*
gl_info
)
...
@@ -587,7 +588,8 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
...
@@ -587,7 +588,8 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
if
(
!
(
surface
->
flags
&
SFLAG_PBO
)
&&
surface_need_pbo
(
surface
,
gl_info
))
if
(
!
(
surface
->
flags
&
SFLAG_PBO
)
&&
surface_need_pbo
(
surface
,
gl_info
))
surface_create_pbo
(
surface
,
gl_info
);
surface_create_pbo
(
surface
,
gl_info
);
else
if
(
!
(
surface
->
resource
.
allocatedMemory
||
surface
->
flags
&
SFLAG_PBO
))
else
if
(
!
(
surface
->
resource
.
allocatedMemory
||
surface
->
flags
&
SFLAG_PBO
||
surface
->
user_memory
))
{
{
/* Whatever surface we have, make sure that there is memory allocated
/* Whatever surface we have, make sure that there is memory allocated
* for the downloaded copy, or a PBO to map. */
* for the downloaded copy, or a PBO to map. */
...
@@ -831,6 +833,9 @@ static BYTE *surface_map(struct wined3d_surface *surface, const RECT *rect, DWOR
...
@@ -831,6 +833,9 @@ static BYTE *surface_map(struct wined3d_surface *surface, const RECT *rect, DWOR
return
ret
;
return
ret
;
}
}
if
(
surface
->
user_memory
)
return
surface
->
user_memory
;
return
surface
->
resource
.
allocatedMemory
;
return
surface
->
resource
.
allocatedMemory
;
}
}
...
@@ -1296,7 +1301,11 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win
...
@@ -1296,7 +1301,11 @@ static void surface_remove_pbo(struct wined3d_surface *surface, const struct win
static
BOOL
surface_init_sysmem
(
struct
wined3d_surface
*
surface
)
static
BOOL
surface_init_sysmem
(
struct
wined3d_surface
*
surface
)
{
{
if
(
!
surface
->
resource
.
allocatedMemory
)
if
(
surface
->
resource
.
allocatedMemory
)
{
memset
(
surface
->
resource
.
allocatedMemory
,
0
,
surface
->
resource
.
size
);
}
else
if
(
!
surface
->
user_memory
)
{
{
if
(
!
surface
->
resource
.
heap_memory
)
if
(
!
surface
->
resource
.
heap_memory
)
{
{
...
@@ -1314,10 +1323,6 @@ static BOOL surface_init_sysmem(struct wined3d_surface *surface)
...
@@ -1314,10 +1323,6 @@ static BOOL surface_init_sysmem(struct wined3d_surface *surface)
surface
->
resource
.
allocatedMemory
=
surface
->
resource
.
heap_memory
;
surface
->
resource
.
allocatedMemory
=
surface
->
resource
.
heap_memory
;
}
}
else
{
memset
(
surface
->
resource
.
allocatedMemory
,
0
,
surface
->
resource
.
size
);
}
surface_validate_location
(
surface
,
SFLAG_INSYSMEM
);
surface_validate_location
(
surface
,
SFLAG_INSYSMEM
);
surface_invalidate_location
(
surface
,
~
SFLAG_INSYSMEM
);
surface_invalidate_location
(
surface
,
~
SFLAG_INSYSMEM
);
...
@@ -1491,6 +1496,9 @@ static BYTE *gdi_surface_map(struct wined3d_surface *surface, const RECT *rect,
...
@@ -1491,6 +1496,9 @@ static BYTE *gdi_surface_map(struct wined3d_surface *surface, const RECT *rect,
TRACE
(
"surface %p, rect %s, flags %#x.
\n
"
,
TRACE
(
"surface %p, rect %s, flags %#x.
\n
"
,
surface
,
wine_dbgstr_rect
(
rect
),
flags
);
surface
,
wine_dbgstr_rect
(
rect
),
flags
);
if
(
surface
->
user_memory
)
return
surface
->
user_memory
;
return
surface
->
resource
.
allocatedMemory
;
return
surface
->
resource
.
allocatedMemory
;
}
}
...
@@ -2611,7 +2619,7 @@ HRESULT CDECL wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem
...
@@ -2611,7 +2619,7 @@ HRESULT CDECL wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem
return
WINED3DERR_INVALIDCALL
;
return
WINED3DERR_INVALIDCALL
;
}
}
if
(
mem
&&
mem
!=
surface
->
resource
.
allocatedM
emory
)
if
(
mem
&&
mem
!=
surface
->
user_m
emory
)
{
{
/* Do I have to copy the old surface content? */
/* Do I have to copy the old surface content? */
if
(
surface
->
flags
&
SFLAG_DIBSECTION
)
if
(
surface
->
flags
&
SFLAG_DIBSECTION
)
...
@@ -2626,8 +2634,9 @@ HRESULT CDECL wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem
...
@@ -2626,8 +2634,9 @@ HRESULT CDECL wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem
else
if
(
!
(
surface
->
flags
&
SFLAG_USERPTR
))
else
if
(
!
(
surface
->
flags
&
SFLAG_USERPTR
))
{
{
wined3d_resource_free_sysmem
(
&
surface
->
resource
);
wined3d_resource_free_sysmem
(
&
surface
->
resource
);
surface
->
resource
.
allocatedMemory
=
NULL
;
}
}
surface
->
resource
.
allocatedM
emory
=
mem
;
surface
->
user_m
emory
=
mem
;
surface
->
flags
|=
SFLAG_USERPTR
;
surface
->
flags
|=
SFLAG_USERPTR
;
/* Now the surface memory is most up do date. Invalidate drawable and texture. */
/* Now the surface memory is most up do date. Invalidate drawable and texture. */
...
@@ -2646,7 +2655,7 @@ HRESULT CDECL wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem
...
@@ -2646,7 +2655,7 @@ HRESULT CDECL wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem
if
(
!
mem
)
if
(
!
mem
)
{
{
surface
->
resource
.
allocatedM
emory
=
NULL
;
surface
->
user_m
emory
=
NULL
;
surface
->
flags
&=
~
(
SFLAG_USERPTR
|
SFLAG_INSYSMEM
);
surface
->
flags
&=
~
(
SFLAG_USERPTR
|
SFLAG_INSYSMEM
);
if
(
surface
->
flags
&
SFLAG_CLIENT
)
if
(
surface
->
flags
&
SFLAG_CLIENT
)
...
...
dlls/wined3d/wined3d_private.h
View file @
fb752928
...
@@ -2186,6 +2186,7 @@ struct wined3d_surface
...
@@ -2186,6 +2186,7 @@ struct wined3d_surface
struct
wined3d_swapchain
*
swapchain
;
struct
wined3d_swapchain
*
swapchain
;
struct
wined3d_palette
*
palette
;
/* D3D7 style palette handling */
struct
wined3d_palette
*
palette
;
/* D3D7 style palette handling */
DWORD
draw_binding
;
DWORD
draw_binding
;
void
*
user_memory
;
DWORD
flags
;
DWORD
flags
;
...
...
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