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
6db6df95
Commit
6db6df95
authored
Jul 29, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Introduce a wined3d_usage_from_d3d() helper.
parent
bc7b188f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
buffer.c
dlls/d3d8/buffer.c
+2
-2
d3d8_private.h
dlls/d3d8/d3d8_private.h
+8
-0
texture.c
dlls/d3d8/texture.c
+3
-10
No files found.
dlls/d3d8/buffer.c
View file @
6db6df95
...
...
@@ -296,7 +296,7 @@ HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device *
buffer
->
usage
=
usage
;
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. */
...
...
@@ -600,7 +600,7 @@ HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_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/d3d8/d3d8_private.h
View file @
6db6df95
...
...
@@ -353,6 +353,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_d3d8_usage
(
DWORD
usage
)
{
unsigned
int
bind_flags
=
0
;
...
...
dlls/d3d8/texture.c
View file @
6db6df95
...
...
@@ -1105,9 +1105,7 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device,
desc
.
format
=
wined3dformat_from_d3dformat
(
format
);
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
if
(
pool
==
D3DPOOL_SCRATCH
)
desc
.
usage
|=
WINED3DUSAGE_SCRATCH
;
desc
.
usage
=
wined3d_usage_from_d3d
(
pool
,
usage
);
desc
.
bind_flags
=
wined3d_bind_flags_from_d3d8_usage
(
usage
)
|
WINED3D_BIND_SHADER_RESOURCE
;
desc
.
access
=
wined3daccess_from_d3dpool
(
pool
,
usage
);
desc
.
width
=
width
;
...
...
@@ -1158,10 +1156,7 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic
desc
.
format
=
wined3dformat_from_d3dformat
(
format
);
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
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_d3d8_usage
(
usage
)
|
WINED3D_BIND_SHADER_RESOURCE
;
desc
.
access
=
wined3daccess_from_d3dpool
(
pool
,
usage
);
desc
.
width
=
edge_length
;
...
...
@@ -1216,9 +1211,7 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev
desc
.
format
=
wined3dformat_from_d3dformat
(
format
);
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
if
(
pool
==
D3DPOOL_SCRATCH
)
desc
.
usage
|=
WINED3DUSAGE_SCRATCH
;
desc
.
usage
=
wined3d_usage_from_d3d
(
pool
,
usage
);
desc
.
bind_flags
=
wined3d_bind_flags_from_d3d8_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