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
a3c4410f
Commit
a3c4410f
authored
Jul 29, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Introduce a wined3d_usage_from_d3d() helper.
parent
6db6df95
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
21 deletions
+15
-21
buffer.c
dlls/d3d9/buffer.c
+2
-2
d3d9_private.h
dlls/d3d9/d3d9_private.h
+8
-5
device.c
dlls/d3d9/device.c
+2
-4
texture.c
dlls/d3d9/texture.c
+3
-10
No files found.
dlls/d3d9/buffer.c
View file @
a3c4410f
...
...
@@ -303,7 +303,7 @@ HRESULT vertexbuffer_init(struct d3d9_vertexbuffer *buffer, struct d3d9_device *
d3d9_resource_init
(
&
buffer
->
resource
);
desc
.
byte_width
=
size
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
desc
.
usage
=
wined3d_usage_from_d3d
(
pool
,
usage
)
;
desc
.
bind_flags
=
0
;
desc
.
access
=
wined3daccess_from_d3dpool
(
pool
,
usage
)
|
map_access_from_usage
(
usage
);
/* Buffers are always readable. */
...
...
@@ -611,7 +611,7 @@ HRESULT indexbuffer_init(struct d3d9_indexbuffer *buffer, struct d3d9_device *de
return
D3DERR_INVALIDCALL
;
desc
.
byte_width
=
size
;
desc
.
usage
=
(
usage
&
WINED3DUSAGE_MASK
)
|
WINED3DUSAGE_STATICDECL
;
desc
.
usage
=
wined3d_usage_from_d3d
(
pool
,
usage
)
|
WINED3DUSAGE_STATICDECL
;
desc
.
bind_flags
=
0
;
desc
.
access
=
wined3daccess_from_d3dpool
(
pool
,
usage
)
|
map_access_from_usage
(
usage
);
/* Buffers are always readable. */
...
...
dlls/d3d9/d3d9_private.h
View file @
a3c4410f
...
...
@@ -373,6 +373,14 @@ static inline unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int
return
access
;
}
static
inline
unsigned
int
wined3d_usage_from_d3d
(
D3DPOOL
pool
,
DWORD
usage
)
{
usage
&=
WINED3DUSAGE_MASK
;
if
(
pool
==
D3DPOOL_SCRATCH
)
usage
|=
WINED3DUSAGE_SCRATCH
;
return
usage
;
}
static
inline
unsigned
int
wined3d_bind_flags_from_d3d9_usage
(
DWORD
usage
)
{
unsigned
int
bind_flags
=
0
;
...
...
@@ -385,11 +393,6 @@ static inline unsigned int wined3d_bind_flags_from_d3d9_usage(DWORD usage)
return
bind_flags
;
}
static
inline
DWORD
wined3dusage_from_d3dusage
(
unsigned
int
usage
)
{
return
usage
&
WINED3DUSAGE_MASK
;
}
static
inline
enum
wined3d_multisample_type
wined3d_multisample_type_from_d3d
(
D3DMULTISAMPLE_TYPE
type
)
{
return
(
enum
wined3d_multisample_type
)
type
;
...
...
dlls/d3d9/device.c
View file @
a3c4410f
...
...
@@ -1976,10 +1976,8 @@ static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurface(IDirect3DDevice9Ex
}
}
usage
=
0
;
if
(
pool
==
D3DPOOL_SCRATCH
)
usage
|=
WINED3DUSAGE_SCRATCH
;
access
=
wined3daccess_from_d3dpool
(
pool
,
usage
)
usage
=
wined3d_usage_from_d3d
(
pool
,
0
);
access
=
wined3daccess_from_d3dpool
(
pool
,
0
)
|
WINED3D_RESOURCE_ACCESS_MAP_R
|
WINED3D_RESOURCE_ACCESS_MAP_W
;
return
d3d9_device_create_surface
(
device
,
0
,
wined3dformat_from_d3dformat
(
format
),
...
...
dlls/d3d9/texture.c
View file @
a3c4410f
...
...
@@ -1317,9 +1317,7 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device,
desc
.
format
=
wined3dformat_from_d3dformat
(
format
);
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
wined3dusage_from_d3dusage
(
usage
);
if
(
pool
==
D3DPOOL_SCRATCH
)
desc
.
usage
|=
WINED3DUSAGE_SCRATCH
;
desc
.
usage
=
wined3d_usage_from_d3d
(
pool
,
usage
);
desc
.
bind_flags
=
wined3d_bind_flags_from_d3d9_usage
(
usage
)
|
WINED3D_BIND_SHADER_RESOURCE
;
desc
.
access
=
wined3daccess_from_d3dpool
(
pool
,
usage
);
desc
.
width
=
width
;
...
...
@@ -1414,10 +1412,7 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic
desc
.
format
=
wined3dformat_from_d3dformat
(
format
);
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
wined3dusage_from_d3dusage
(
usage
);
desc
.
usage
|=
WINED3DUSAGE_LEGACY_CUBEMAP
;
if
(
pool
==
D3DPOOL_SCRATCH
)
desc
.
usage
|=
WINED3DUSAGE_SCRATCH
;
desc
.
usage
=
wined3d_usage_from_d3d
(
pool
,
usage
)
|
WINED3DUSAGE_LEGACY_CUBEMAP
;
desc
.
bind_flags
=
wined3d_bind_flags_from_d3d9_usage
(
usage
)
|
WINED3D_BIND_SHADER_RESOURCE
;
desc
.
access
=
wined3daccess_from_d3dpool
(
pool
,
usage
);
desc
.
width
=
edge_length
;
...
...
@@ -1500,9 +1495,7 @@ HRESULT volumetexture_init(struct d3d9_texture *texture, struct d3d9_device *dev
desc
.
format
=
wined3dformat_from_d3dformat
(
format
);
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
wined3dusage_from_d3dusage
(
usage
);
if
(
pool
==
D3DPOOL_SCRATCH
)
desc
.
usage
|=
WINED3DUSAGE_SCRATCH
;
desc
.
usage
=
wined3d_usage_from_d3d
(
pool
,
usage
);
desc
.
bind_flags
=
wined3d_bind_flags_from_d3d9_usage
(
usage
)
|
WINED3D_BIND_SHADER_RESOURCE
;
desc
.
access
=
wined3daccess_from_d3dpool
(
pool
,
usage
);
desc
.
width
=
width
;
...
...
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