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
7ef8b319
Commit
7ef8b319
authored
Jan 31, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use the resource access flags in resource_init().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d732b47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
resource.c
dlls/wined3d/resource.c
+7
-5
utils.c
dlls/wined3d/utils.c
+16
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/resource.c
View file @
7ef8b319
...
...
@@ -83,6 +83,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
enum
wined3d_gl_resource_type
base_type
=
WINED3D_GL_RES_TYPE_COUNT
;
enum
wined3d_gl_resource_type
gl_type
=
WINED3D_GL_RES_TYPE_COUNT
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
DWORD
access
=
resource_access_from_pool
(
pool
);
BOOL
tex_2d_ok
=
FALSE
;
unsigned
int
i
;
...
...
@@ -104,9 +105,10 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
resource_check_usage
(
usage
);
if
(
usage
&
WINED3DUSAGE_SCRATCH
&&
pool
!=
WINED3D_POOL_SYSTEM_MEM
)
if
(
usage
&
WINED3DUSAGE_SCRATCH
&&
access
&
WINED3D_RESOURCE_ACCESS_GPU
)
{
ERR
(
"WINED3DUSAGE_SCRATCH used with pool %s.
\n
"
,
debug_d3dpool
(
pool
));
ERR
(
"Trying to create a scratch resource with access flags %s.
\n
"
,
wined3d_debug_resource_access
(
access
));
return
WINED3DERR_INVALIDCALL
;
}
...
...
@@ -197,9 +199,9 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
resource
->
multisample_quality
=
multisample_quality
;
resource
->
usage
=
usage
;
resource
->
pool
=
pool
;
resource
->
access
=
resource_access_from_pool
(
pool
);
if
(
usage
&
WINED3DUSAGE_DYNAMIC
)
resource
->
access
|=
WINED3D_RESOURCE_ACCESS_MAP
;
access
|=
WINED3D_RESOURCE_ACCESS_MAP
;
resource
->
access
=
access
;
resource
->
width
=
width
;
resource
->
height
=
height
;
resource
->
depth
=
depth
;
...
...
@@ -226,7 +228,7 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
if
(
!
(
usage
&
WINED3DUSAGE_PRIVATE
))
{
/* Check that we have enough video ram left */
if
(
pool
==
WINED3D_POOL_DEFAULT
&&
device
->
wined3d
->
flags
&
WINED3D_VIDMEM_ACCOUNTING
)
if
(
!
(
access
&
WINED3D_RESOURCE_ACCESS_CPU
)
&&
device
->
wined3d
->
flags
&
WINED3D_VIDMEM_ACCOUNTING
)
{
if
(
size
>
wined3d_device_get_available_texture_mem
(
device
))
{
...
...
dlls/wined3d/utils.c
View file @
7ef8b319
...
...
@@ -4129,6 +4129,22 @@ const char *debug_d3ddevicetype(enum wined3d_device_type device_type)
}
}
const
char
*
wined3d_debug_resource_access
(
DWORD
access
)
{
char
buf
[
91
];
buf
[
0
]
=
'\0'
;
#define ACCESS_TO_STR(x) if (access & x) { strcat(buf, " | "#x); access &= ~x; }
ACCESS_TO_STR
(
WINED3D_RESOURCE_ACCESS_GPU
);
ACCESS_TO_STR
(
WINED3D_RESOURCE_ACCESS_CPU
);
ACCESS_TO_STR
(
WINED3D_RESOURCE_ACCESS_MAP
);
#undef ACCESS_TO_STR
if
(
access
)
FIXME
(
"Unrecognised access flag(s) %#x.
\n
"
,
access
);
return
buf
[
0
]
?
wine_dbg_sprintf
(
"%s"
,
&
buf
[
3
])
:
"0"
;
}
const
char
*
debug_d3dusage
(
DWORD
usage
)
{
char
buf
[
552
];
...
...
dlls/wined3d/wined3d_private.h
View file @
7ef8b319
...
...
@@ -2965,6 +2965,8 @@ static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD sta
#define WINED3D_RESOURCE_ACCESS_CPU 0x2u
#define WINED3D_RESOURCE_ACCESS_MAP 0x4u
const
char
*
wined3d_debug_resource_access
(
DWORD
access
)
DECLSPEC_HIDDEN
;
static
inline
BOOL
wined3d_resource_access_is_managed
(
unsigned
int
access
)
{
return
!
(
~
access
&
(
WINED3D_RESOURCE_ACCESS_GPU
|
WINED3D_RESOURCE_ACCESS_CPU
));
...
...
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