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
c2a240e8
Commit
c2a240e8
authored
Sep 17, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Add a separate function for d3d10_buffer initialization.
parent
22124bc5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
17 deletions
+34
-17
buffer.c
dlls/d3d10core/buffer.c
+29
-1
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+3
-1
device.c
dlls/d3d10core/device.c
+2
-15
No files found.
dlls/d3d10core/buffer.c
View file @
c2a240e8
...
...
@@ -145,7 +145,7 @@ static void STDMETHODCALLTYPE d3d10_buffer_GetDesc(ID3D10Buffer *iface, D3D10_BU
FIXME
(
"iface %p, desc %p stub!
\n
"
,
iface
,
desc
);
}
const
struct
ID3D10BufferVtbl
d3d10_buffer_vtbl
=
static
const
struct
ID3D10BufferVtbl
d3d10_buffer_vtbl
=
{
/* IUnknown methods */
d3d10_buffer_QueryInterface
,
...
...
@@ -165,3 +165,31 @@ const struct ID3D10BufferVtbl d3d10_buffer_vtbl =
d3d10_buffer_Unmap
,
d3d10_buffer_GetDesc
,
};
HRESULT
d3d10_buffer_init
(
struct
d3d10_buffer
*
buffer
,
struct
d3d10_device
*
device
,
const
D3D10_BUFFER_DESC
*
desc
,
const
D3D10_SUBRESOURCE_DATA
*
data
)
{
struct
wined3d_buffer_desc
wined3d_desc
;
HRESULT
hr
;
buffer
->
vtbl
=
&
d3d10_buffer_vtbl
;
buffer
->
refcount
=
1
;
FIXME
(
"Implement DXGI<->wined3d usage conversion
\n
"
);
wined3d_desc
.
byte_width
=
desc
->
ByteWidth
;
wined3d_desc
.
usage
=
desc
->
Usage
;
wined3d_desc
.
bind_flags
=
desc
->
BindFlags
;
wined3d_desc
.
cpu_access_flags
=
desc
->
CPUAccessFlags
;
wined3d_desc
.
misc_flags
=
desc
->
MiscFlags
;
hr
=
IWineD3DDevice_CreateBuffer
(
device
->
wined3d_device
,
&
wined3d_desc
,
data
?
data
->
pSysMem
:
NULL
,
(
IUnknown
*
)
buffer
,
&
buffer
->
wined3d_buffer
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d buffer, hr %#x.
\n
"
,
hr
);
return
hr
;
}
return
S_OK
;
}
dlls/d3d10core/d3d10core_private.h
View file @
c2a240e8
...
...
@@ -96,7 +96,6 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
const
D3D10_TEXTURE2D_DESC
*
desc
);
/* ID3D10Buffer */
extern
const
struct
ID3D10BufferVtbl
d3d10_buffer_vtbl
;
struct
d3d10_buffer
{
const
struct
ID3D10BufferVtbl
*
vtbl
;
...
...
@@ -105,6 +104,9 @@ struct d3d10_buffer
IWineD3DBuffer
*
wined3d_buffer
;
};
HRESULT
d3d10_buffer_init
(
struct
d3d10_buffer
*
buffer
,
struct
d3d10_device
*
device
,
const
D3D10_BUFFER_DESC
*
desc
,
const
D3D10_SUBRESOURCE_DATA
*
data
);
/* ID3D10RenderTargetView */
extern
const
struct
ID3D10RenderTargetViewVtbl
d3d10_rendertarget_view_vtbl
;
struct
d3d10_rendertarget_view
...
...
dlls/d3d10core/device.c
View file @
c2a240e8
...
...
@@ -618,7 +618,6 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device *iface,
const
D3D10_BUFFER_DESC
*
desc
,
const
D3D10_SUBRESOURCE_DATA
*
data
,
ID3D10Buffer
**
buffer
)
{
struct
d3d10_device
*
This
=
(
struct
d3d10_device
*
)
iface
;
struct
wined3d_buffer_desc
wined3d_desc
;
struct
d3d10_buffer
*
object
;
HRESULT
hr
;
...
...
@@ -631,22 +630,10 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device *iface,
return
E_OUTOFMEMORY
;
}
object
->
vtbl
=
&
d3d10_buffer_vtbl
;
object
->
refcount
=
1
;
FIXME
(
"Implement DXGI<->wined3d usage conversion
\n
"
);
wined3d_desc
.
byte_width
=
desc
->
ByteWidth
;
wined3d_desc
.
usage
=
desc
->
Usage
;
wined3d_desc
.
bind_flags
=
desc
->
BindFlags
;
wined3d_desc
.
cpu_access_flags
=
desc
->
CPUAccessFlags
;
wined3d_desc
.
misc_flags
=
desc
->
MiscFlags
;
hr
=
IWineD3DDevice_CreateBuffer
(
This
->
wined3d_device
,
&
wined3d_desc
,
data
?
data
->
pSysMem
:
NULL
,
(
IUnknown
*
)
object
,
&
object
->
wined3d_buffer
);
hr
=
d3d10_buffer_init
(
object
,
This
,
desc
,
data
);
if
(
FAILED
(
hr
))
{
ERR
(
"CreateBuffer failed, returning %#x
\n
"
,
hr
);
WARN
(
"Failed to initialize buffer, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
...
...
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