Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1cb18166
Commit
1cb18166
authored
Sep 15, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Sep 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Implement d3d11_device_CreateInputLayout().
parent
8361963f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
24 deletions
+51
-24
d3d11_private.h
dlls/d3d11/d3d11_private.h
+4
-3
device.c
dlls/d3d11/device.c
+16
-16
inputlayout.c
dlls/d3d11/inputlayout.c
+31
-5
No files found.
dlls/d3d11/d3d11_private.h
View file @
1cb18166
...
...
@@ -218,9 +218,10 @@ struct d3d_input_layout
struct
wined3d_vertex_declaration
*
wined3d_decl
;
};
HRESULT
d3d_input_layout_init
(
struct
d3d_input_layout
*
layout
,
struct
d3d_device
*
device
,
const
D3D10_INPUT_ELEMENT_DESC
*
element_descs
,
UINT
element_count
,
const
void
*
shader_byte_code
,
SIZE_T
shader_byte_code_length
)
DECLSPEC_HIDDEN
;
HRESULT
d3d_input_layout_create
(
struct
d3d_device
*
device
,
const
D3D11_INPUT_ELEMENT_DESC
*
element_descs
,
UINT
element_count
,
const
void
*
shader_byte_code
,
SIZE_T
shader_byte_code_length
,
struct
d3d_input_layout
**
layout
)
DECLSPEC_HIDDEN
;
struct
d3d_input_layout
*
unsafe_impl_from_ID3D10InputLayout
(
ID3D10InputLayout
*
iface
)
DECLSPEC_HIDDEN
;
/* ID3D10VertexShader */
...
...
dlls/d3d11/device.c
View file @
1cb18166
...
...
@@ -179,11 +179,21 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateInputLayout(ID3D11Device *if
const
D3D11_INPUT_ELEMENT_DESC
*
element_descs
,
UINT
element_count
,
const
void
*
shader_byte_code
,
SIZE_T
shader_byte_code_length
,
ID3D11InputLayout
**
input_layout
)
{
FIXME
(
"iface %p, element_descs %p, element_count %u, shader_byte_code %p, shader_byte_code_length %lu, "
"input_layout %p stub!
\n
"
,
iface
,
element_descs
,
element_count
,
shader_byte_code
,
struct
d3d_device
*
device
=
impl_from_ID3D11Device
(
iface
);
struct
d3d_input_layout
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, element_descs %p, element_count %u, shader_byte_code %p, shader_byte_code_length %lu, "
"input_layout %p.
\n
"
,
iface
,
element_descs
,
element_count
,
shader_byte_code
,
shader_byte_code_length
,
input_layout
);
return
E_NOTIMPL
;
if
(
FAILED
(
hr
=
d3d_input_layout_create
(
device
,
element_descs
,
element_count
,
shader_byte_code
,
shader_byte_code_length
,
&
object
)))
return
hr
;
*
input_layout
=
&
object
->
ID3D11InputLayout_iface
;
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_device_CreateVertexShader
(
ID3D11Device
*
iface
,
const
void
*
byte_code
,
...
...
@@ -2206,7 +2216,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateInputLayout(ID3D10Device1 *i
const
void
*
shader_byte_code
,
SIZE_T
shader_byte_code_length
,
ID3D10InputLayout
**
input_layout
)
{
struct
d3d_device
*
This
=
impl_from_ID3D10Device
(
iface
);
struct
d3d_device
*
device
=
impl_from_ID3D10Device
(
iface
);
struct
d3d_input_layout
*
object
;
HRESULT
hr
;
...
...
@@ -2215,20 +2225,10 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateInputLayout(ID3D10Device1 *i
iface
,
element_descs
,
element_count
,
shader_byte_code
,
shader_byte_code_length
,
input_layout
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
hr
=
d3d_input_layout_init
(
object
,
This
,
element_descs
,
element_count
,
shader_byte_code
,
shader_byte_code_length
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize input layout, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
if
(
FAILED
(
hr
=
d3d_input_layout_create
(
device
,
(
const
D3D11_INPUT_ELEMENT_DESC
*
)
element_descs
,
element_count
,
shader_byte_code
,
shader_byte_code_length
,
&
object
)))
return
hr
;
}
TRACE
(
"Created input layout %p.
\n
"
,
object
);
*
input_layout
=
&
object
->
ID3D10InputLayout_iface
;
return
S_OK
;
...
...
dlls/d3d11/inputlayout.c
View file @
1cb18166
...
...
@@ -39,7 +39,7 @@ static HRESULT isgn_handler(const char *data, DWORD data_size, DWORD tag, void *
}
}
static
HRESULT
d3d1
0_input_layout_to_wined3d_declaration
(
const
D3D10
_INPUT_ELEMENT_DESC
*
element_descs
,
static
HRESULT
d3d1
1_input_layout_to_wined3d_declaration
(
const
D3D11
_INPUT_ELEMENT_DESC
*
element_descs
,
UINT
element_count
,
const
void
*
shader_byte_code
,
SIZE_T
shader_byte_code_length
,
struct
wined3d_vertex_element
**
wined3d_elements
)
{
...
...
@@ -65,7 +65,7 @@ static HRESULT d3d10_input_layout_to_wined3d_declaration(const D3D10_INPUT_ELEME
for
(
i
=
0
;
i
<
element_count
;
++
i
)
{
struct
wined3d_vertex_element
*
e
=
&
(
*
wined3d_elements
)[
i
];
const
D3D1
0
_INPUT_ELEMENT_DESC
*
f
=
&
element_descs
[
i
];
const
D3D1
1
_INPUT_ELEMENT_DESC
*
f
=
&
element_descs
[
i
];
UINT
j
;
e
->
format
=
wined3dformat_from_dxgi_format
(
f
->
Format
);
...
...
@@ -316,8 +316,8 @@ static const struct wined3d_parent_ops d3d_input_layout_wined3d_parent_ops =
d3d_input_layout_wined3d_object_destroyed
,
};
HRESULT
d3d_input_layout_init
(
struct
d3d_input_layout
*
layout
,
struct
d3d_device
*
device
,
const
D3D1
0
_INPUT_ELEMENT_DESC
*
element_descs
,
UINT
element_count
,
static
HRESULT
d3d_input_layout_init
(
struct
d3d_input_layout
*
layout
,
struct
d3d_device
*
device
,
const
D3D1
1
_INPUT_ELEMENT_DESC
*
element_descs
,
UINT
element_count
,
const
void
*
shader_byte_code
,
SIZE_T
shader_byte_code_length
)
{
struct
wined3d_vertex_element
*
wined3d_elements
;
...
...
@@ -329,7 +329,7 @@ HRESULT d3d_input_layout_init(struct d3d_input_layout *layout, struct d3d_device
wined3d_mutex_lock
();
wined3d_private_store_init
(
&
layout
->
private_store
);
if
(
FAILED
(
hr
=
d3d1
0
_input_layout_to_wined3d_declaration
(
element_descs
,
element_count
,
if
(
FAILED
(
hr
=
d3d1
1
_input_layout_to_wined3d_declaration
(
element_descs
,
element_count
,
shader_byte_code
,
shader_byte_code_length
,
&
wined3d_elements
)))
{
WARN
(
"Failed to create wined3d vertex declaration elements, hr %#x.
\n
"
,
hr
);
...
...
@@ -353,6 +353,32 @@ HRESULT d3d_input_layout_init(struct d3d_input_layout *layout, struct d3d_device
return
S_OK
;
}
HRESULT
d3d_input_layout_create
(
struct
d3d_device
*
device
,
const
D3D11_INPUT_ELEMENT_DESC
*
element_descs
,
UINT
element_count
,
const
void
*
shader_byte_code
,
SIZE_T
shader_byte_code_length
,
struct
d3d_input_layout
**
layout
)
{
struct
d3d_input_layout
*
object
;
HRESULT
hr
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_input_layout_init
(
object
,
device
,
element_descs
,
element_count
,
shader_byte_code
,
shader_byte_code_length
)))
{
WARN
(
"Failed to initialize input layout, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created input layout %p.
\n
"
,
object
);
*
layout
=
object
;
return
S_OK
;
}
struct
d3d_input_layout
*
unsafe_impl_from_ID3D10InputLayout
(
ID3D10InputLayout
*
iface
)
{
if
(
!
iface
)
...
...
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