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
96432c4c
Commit
96432c4c
authored
Feb 09, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Use wined3d_buffer_create() in d3d9_device_prepare_vertex_buffer().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
661d11d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
61 deletions
+11
-61
device.c
dlls/d3d9/device.c
+11
-4
buffer.c
dlls/wined3d/buffer.c
+0
-46
wined3d.spec
dlls/wined3d/wined3d.spec
+0
-1
wined3d.h
include/wine/wined3d.h
+0
-10
No files found.
dlls/d3d9/device.c
View file @
96432c4c
...
...
@@ -2543,15 +2543,22 @@ static HRESULT d3d9_device_prepare_vertex_buffer(struct d3d9_device *device, UIN
if
(
device
->
vertex_buffer_size
<
min_size
||
!
device
->
vertex_buffer
)
{
UINT
size
=
max
(
device
->
vertex_buffer_size
*
2
,
min_size
);
struct
wined3d_buffer_desc
desc
;
struct
wined3d_buffer
*
buffer
;
TRACE
(
"Growing vertex buffer to %u bytes.
\n
"
,
size
);
hr
=
wined3d_buffer_create_vb
(
device
->
wined3d_device
,
size
,
WINED3DUSAGE_DYNAMIC
|
WINED3DUSAGE_WRITEONLY
,
WINED3D_POOL_DEFAULT
,
NULL
,
&
d3d9_null_wined3d_parent_ops
,
&
buffer
);
if
(
FAILED
(
hr
))
desc
.
byte_width
=
size
;
desc
.
usage
=
WINED3DUSAGE_DYNAMIC
|
WINED3DUSAGE_WRITEONLY
;
desc
.
bind_flags
=
WINED3D_BIND_VERTEX_BUFFER
;
desc
.
access
=
WINED3D_RESOURCE_ACCESS_GPU
;
desc
.
misc_flags
=
0
;
desc
.
structure_byte_stride
=
0
;
if
(
FAILED
(
hr
=
wined3d_buffer_create
(
device
->
wined3d_device
,
&
desc
,
NULL
,
NULL
,
&
d3d9_null_wined3d_parent_ops
,
&
buffer
)))
{
ERR
(
"
(%p) wined3d_buffer_create_vb failed with hr = %08x.
\n
"
,
device
,
hr
);
ERR
(
"
Failed to create vertex buffer, hr %#x.
\n
"
,
hr
);
return
hr
;
}
...
...
dlls/wined3d/buffer.c
View file @
96432c4c
...
...
@@ -1441,49 +1441,3 @@ HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct
return
WINED3D_OK
;
}
static
DWORD
resource_access_from_pool
(
enum
wined3d_pool
pool
)
{
switch
(
pool
)
{
case
WINED3D_POOL_DEFAULT
:
return
WINED3D_RESOURCE_ACCESS_GPU
;
case
WINED3D_POOL_MANAGED
:
return
WINED3D_RESOURCE_ACCESS_GPU
|
WINED3D_RESOURCE_ACCESS_CPU
|
WINED3D_RESOURCE_ACCESS_MAP
;
case
WINED3D_POOL_SYSTEM_MEM
:
return
WINED3D_RESOURCE_ACCESS_CPU
|
WINED3D_RESOURCE_ACCESS_MAP
;
default:
FIXME
(
"Unhandled pool %#x.
\n
"
,
pool
);
return
0
;
}
}
HRESULT
CDECL
wined3d_buffer_create_vb
(
struct
wined3d_device
*
device
,
UINT
size
,
DWORD
usage
,
enum
wined3d_pool
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_buffer
**
buffer
)
{
struct
wined3d_buffer_desc
desc
;
TRACE
(
"device %p, size %u, usage %#x, pool %#x, parent %p, parent_ops %p, buffer %p.
\n
"
,
device
,
size
,
usage
,
pool
,
parent
,
parent_ops
,
buffer
);
if
(
usage
&
WINED3DUSAGE_SCRATCH
)
{
/* The d3d9 tests shows that this is not allowed. It doesn't make much
* sense anyway, SCRATCH buffers wouldn't be usable anywhere. */
WARN
(
"Vertex buffer with WINED3DUSAGE_SCRATCH requested, returning WINED3DERR_INVALIDCALL.
\n
"
);
*
buffer
=
NULL
;
return
WINED3DERR_INVALIDCALL
;
}
desc
.
byte_width
=
size
;
desc
.
usage
=
usage
;
desc
.
bind_flags
=
WINED3D_BIND_VERTEX_BUFFER
;
desc
.
access
=
resource_access_from_pool
(
pool
);
desc
.
misc_flags
=
0
;
desc
.
structure_byte_stride
=
0
;
return
wined3d_buffer_create
(
device
,
&
desc
,
NULL
,
parent
,
parent_ops
,
buffer
);
}
dlls/wined3d/wined3d.spec
View file @
96432c4c
...
...
@@ -28,7 +28,6 @@
@ cdecl wined3d_blend_state_incref(ptr)
@ cdecl wined3d_buffer_create(ptr ptr ptr ptr ptr ptr)
@ cdecl wined3d_buffer_create_vb(ptr long long long ptr ptr ptr)
@ cdecl wined3d_buffer_decref(ptr)
@ cdecl wined3d_buffer_get_parent(ptr)
@ cdecl wined3d_buffer_get_resource(ptr)
...
...
include/wine/wined3d.h
View file @
96432c4c
...
...
@@ -680,13 +680,6 @@ enum wined3d_resource_type
WINED3D_RTYPE_TEXTURE_3D
=
3
,
};
enum
wined3d_pool
{
WINED3D_POOL_DEFAULT
=
0
,
WINED3D_POOL_MANAGED
=
1
,
WINED3D_POOL_SYSTEM_MEM
=
2
,
};
enum
wined3d_query_type
{
WINED3D_QUERY_TYPE_VCACHE
=
4
,
...
...
@@ -2195,9 +2188,6 @@ HRESULT __cdecl wined3d_set_adapter_display_mode(struct wined3d *wined3d,
HRESULT
__cdecl
wined3d_buffer_create
(
struct
wined3d_device
*
device
,
const
struct
wined3d_buffer_desc
*
desc
,
const
struct
wined3d_sub_resource_data
*
data
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_buffer
**
buffer
);
HRESULT
__cdecl
wined3d_buffer_create_vb
(
struct
wined3d_device
*
device
,
UINT
length
,
DWORD
usage
,
enum
wined3d_pool
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_buffer
**
buffer
);
ULONG
__cdecl
wined3d_buffer_decref
(
struct
wined3d_buffer
*
buffer
);
void
*
__cdecl
wined3d_buffer_get_parent
(
const
struct
wined3d_buffer
*
buffer
);
struct
wined3d_resource
*
__cdecl
wined3d_buffer_get_resource
(
struct
wined3d_buffer
*
buffer
);
...
...
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