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
b500ae04
Commit
b500ae04
authored
Sep 06, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Sep 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Implement d3d11_device_CreateBuffer().
parent
4444917f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
19 deletions
+39
-19
buffer.c
dlls/d3d11/buffer.c
+24
-2
d3d11_private.h
dlls/d3d11/d3d11_private.h
+2
-2
device.c
dlls/d3d11/device.c
+13
-15
No files found.
dlls/d3d11/buffer.c
View file @
b500ae04
...
...
@@ -376,8 +376,8 @@ static const struct wined3d_parent_ops d3d10_buffer_wined3d_parent_ops =
d3d10_buffer_wined3d_object_released
,
};
HRESULT
d3d_buffer_init
(
struct
d3d_buffer
*
buffer
,
struct
d3d_device
*
device
,
const
D3D11_BUFFER_DESC
*
desc
,
const
D3D1
0
_SUBRESOURCE_DATA
*
data
)
static
HRESULT
d3d_buffer_init
(
struct
d3d_buffer
*
buffer
,
struct
d3d_device
*
device
,
const
D3D11_BUFFER_DESC
*
desc
,
const
D3D1
1
_SUBRESOURCE_DATA
*
data
)
{
struct
wined3d_buffer_desc
wined3d_desc
;
HRESULT
hr
;
...
...
@@ -414,3 +414,25 @@ HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *device,
return
S_OK
;
}
HRESULT
d3d_buffer_create
(
struct
d3d_device
*
device
,
const
D3D11_BUFFER_DESC
*
desc
,
const
D3D11_SUBRESOURCE_DATA
*
data
,
struct
d3d_buffer
**
buffer
)
{
struct
d3d_buffer
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_buffer_init
(
object
,
device
,
desc
,
data
)))
{
WARN
(
"Failed to initialize buffer, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created buffer %p.
\n
"
,
object
);
*
buffer
=
object
;
return
S_OK
;
}
dlls/d3d11/d3d11_private.h
View file @
b500ae04
...
...
@@ -145,8 +145,8 @@ struct d3d_buffer
ID3D11Device
*
device
;
};
HRESULT
d3d_buffer_
init
(
struct
d3d_buffer
*
buffer
,
struct
d3d_device
*
device
,
const
D3D11_
BUFFER_DESC
*
desc
,
const
D3D10_SUBRESOURCE_DATA
*
data
)
DECLSPEC_HIDDEN
;
HRESULT
d3d_buffer_
create
(
struct
d3d_device
*
device
,
const
D3D11_BUFFER_DESC
*
desc
,
const
D3D11_
SUBRESOURCE_DATA
*
data
,
struct
d3d_buffer
**
buffer
)
DECLSPEC_HIDDEN
;
struct
d3d_buffer
*
unsafe_impl_from_ID3D10Buffer
(
ID3D10Buffer
*
iface
)
DECLSPEC_HIDDEN
;
/* ID3D10DepthStencilView */
...
...
dlls/d3d11/device.c
View file @
b500ae04
...
...
@@ -59,9 +59,18 @@ static ULONG STDMETHODCALLTYPE d3d11_device_Release(ID3D11Device *iface)
static
HRESULT
STDMETHODCALLTYPE
d3d11_device_CreateBuffer
(
ID3D11Device
*
iface
,
const
D3D11_BUFFER_DESC
*
desc
,
const
D3D11_SUBRESOURCE_DATA
*
data
,
ID3D11Buffer
**
buffer
)
{
FIXME
(
"iface %p, desc %p, data %p, buffer %p stub!
\n
"
,
iface
,
desc
,
data
,
buffer
);
struct
d3d_device
*
device
=
impl_from_ID3D11Device
(
iface
);
struct
d3d_buffer
*
object
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"iface %p, desc %p, data %p, buffer %p.
\n
"
,
iface
,
desc
,
data
,
buffer
);
if
(
FAILED
(
hr
=
d3d_buffer_create
(
device
,
desc
,
data
,
&
object
)))
return
hr
;
*
buffer
=
&
object
->
ID3D11Buffer_iface
;
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_device_CreateTexture1D
(
ID3D11Device
*
iface
,
...
...
@@ -1985,7 +1994,7 @@ static void STDMETHODCALLTYPE d3d10_device_Flush(ID3D10Device1 *iface)
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_CreateBuffer
(
ID3D10Device1
*
iface
,
const
D3D10_BUFFER_DESC
*
desc
,
const
D3D10_SUBRESOURCE_DATA
*
data
,
ID3D10Buffer
**
buffer
)
{
struct
d3d_device
*
This
=
impl_from_ID3D10Device
(
iface
);
struct
d3d_device
*
device
=
impl_from_ID3D10Device
(
iface
);
D3D11_BUFFER_DESC
d3d11_desc
;
struct
d3d_buffer
*
object
;
HRESULT
hr
;
...
...
@@ -1999,22 +2008,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device1 *iface,
d3d11_desc
.
MiscFlags
=
d3d11_resource_misc_flags_from_d3d10_resource_misc_flags
(
desc
->
MiscFlags
);
d3d11_desc
.
StructureByteStride
=
0
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
hr
=
d3d_buffer_init
(
object
,
This
,
&
d3d11_desc
,
data
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize buffer, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
if
(
FAILED
(
hr
=
d3d_buffer_create
(
device
,
&
d3d11_desc
,
(
const
D3D11_SUBRESOURCE_DATA
*
)
data
,
&
object
)))
return
hr
;
}
*
buffer
=
&
object
->
ID3D10Buffer_iface
;
TRACE
(
"Created ID3D10Buffer %p
\n
"
,
object
);
return
S_OK
;
}
...
...
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