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
3179a6af
Commit
3179a6af
authored
Aug 16, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce wined3d_resource_prepare_sysmem().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dc23cca3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
20 deletions
+16
-20
buffer.c
dlls/wined3d/buffer.c
+2
-7
resource.c
dlls/wined3d/resource.c
+9
-1
texture.c
dlls/wined3d/texture.c
+4
-11
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/buffer.c
View file @
3179a6af
...
...
@@ -601,12 +601,7 @@ static BOOL wined3d_buffer_prepare_location(struct wined3d_buffer *buffer,
switch
(
location
)
{
case
WINED3D_LOCATION_SYSMEM
:
if
(
buffer
->
resource
.
heap_memory
)
return
TRUE
;
if
(
!
wined3d_resource_allocate_sysmem
(
&
buffer
->
resource
))
return
FALSE
;
return
TRUE
;
return
wined3d_resource_prepare_sysmem
(
&
buffer
->
resource
);
case
WINED3D_LOCATION_BUFFER
:
if
(
buffer_gl
->
buffer_object
)
...
...
@@ -1419,7 +1414,7 @@ static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d
if
(
buffer
->
locations
&
WINED3D_LOCATION_SYSMEM
||
!
(
buffer
->
flags
&
WINED3D_BUFFER_USE_BO
))
{
if
(
!
wined3d_resource_
allocat
e_sysmem
(
&
buffer
->
resource
))
if
(
!
wined3d_resource_
prepar
e_sysmem
(
&
buffer
->
resource
))
return
E_OUTOFMEMORY
;
}
...
...
dlls/wined3d/resource.c
View file @
3179a6af
...
...
@@ -395,7 +395,7 @@ void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
wined3d_cs_emit_preload_resource
(
resource
->
device
->
cs
,
resource
);
}
BOOL
wined3d_resource_allocate_sysmem
(
struct
wined3d_resource
*
resource
)
static
BOOL
wined3d_resource_allocate_sysmem
(
struct
wined3d_resource
*
resource
)
{
void
**
p
;
SIZE_T
align
=
RESOURCE_ALIGNMENT
-
1
+
sizeof
(
*
p
);
...
...
@@ -415,6 +415,14 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
return
TRUE
;
}
BOOL
wined3d_resource_prepare_sysmem
(
struct
wined3d_resource
*
resource
)
{
if
(
resource
->
heap_memory
)
return
TRUE
;
return
wined3d_resource_allocate_sysmem
(
resource
);
}
void
wined3d_resource_free_sysmem
(
struct
wined3d_resource
*
resource
)
{
void
**
p
=
resource
->
heap_memory
;
...
...
dlls/wined3d/texture.c
View file @
3179a6af
...
...
@@ -1505,14 +1505,6 @@ void wined3d_texture_gl_set_compatible_renderbuffer(struct wined3d_texture_gl *t
checkGLcall
(
"set compatible renderbuffer"
);
}
static
BOOL
wined3d_texture_prepare_sysmem
(
struct
wined3d_texture
*
texture
)
{
if
(
texture
->
resource
.
heap_memory
)
return
TRUE
;
return
wined3d_resource_allocate_sysmem
(
&
texture
->
resource
);
}
HRESULT
CDECL
wined3d_texture_update_desc
(
struct
wined3d_texture
*
texture
,
UINT
width
,
UINT
height
,
enum
wined3d_format_id
format_id
,
enum
wined3d_multisample_type
multisample_type
,
UINT
multisample_quality
,
void
*
mem
,
UINT
pitch
)
...
...
@@ -1638,7 +1630,8 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
}
else
{
wined3d_texture_prepare_sysmem
(
texture
);
if
(
!
wined3d_resource_prepare_sysmem
(
&
texture
->
resource
))
ERR
(
"Failed to allocate resource memory.
\n
"
);
valid_location
=
WINED3D_LOCATION_SYSMEM
;
}
...
...
@@ -1813,7 +1806,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
switch
(
location
)
{
case
WINED3D_LOCATION_SYSMEM
:
return
wined3d_
texture_prepare_sysmem
(
textur
e
);
return
wined3d_
resource_prepare_sysmem
(
&
texture
->
resourc
e
);
case
WINED3D_LOCATION_USER_MEMORY
:
if
(
!
texture
->
user_memory
)
...
...
@@ -3296,7 +3289,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
if
(
desc
->
resource_type
!=
WINED3D_RTYPE_TEXTURE_3D
||
!
wined3d_texture_use_pbo
(
texture
,
gl_info
))
{
if
(
!
wined3d_resource_
allocat
e_sysmem
(
&
texture
->
resource
))
if
(
!
wined3d_resource_
prepar
e_sysmem
(
&
texture
->
resource
))
{
wined3d_texture_cleanup_sync
(
texture
);
return
E_OUTOFMEMORY
;
...
...
dlls/wined3d/wined3d_private.h
View file @
3179a6af
...
...
@@ -3437,7 +3437,6 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
unsigned
int
size
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
const
struct
wined3d_resource_ops
*
resource_ops
)
DECLSPEC_HIDDEN
;
void
resource_unload
(
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
BOOL
wined3d_resource_allocate_sysmem
(
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
void
wined3d_resource_free_sysmem
(
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
const
struct
wined3d_format
*
wined3d_resource_get_decompress_format
(
const
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
...
...
@@ -3445,6 +3444,7 @@ unsigned int wined3d_resource_get_sample_count(const struct wined3d_resource *re
GLbitfield
wined3d_resource_gl_map_flags
(
DWORD
d3d_flags
)
DECLSPEC_HIDDEN
;
GLenum
wined3d_resource_gl_legacy_map_flags
(
DWORD
d3d_flags
)
DECLSPEC_HIDDEN
;
BOOL
wined3d_resource_is_offscreen
(
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
BOOL
wined3d_resource_prepare_sysmem
(
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
void
wined3d_resource_update_draw_binding
(
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
/* Tests show that the start address of resources is 32 byte aligned */
...
...
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