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
32892beb
Commit
32892beb
authored
Sep 16, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Sep 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Implement ID3D11VertexShader interface.
parent
92a71ae0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
131 additions
and
29 deletions
+131
-29
d3d11_private.h
dlls/d3d11/d3d11_private.h
+3
-2
shader.c
dlls/d3d11/shader.c
+128
-27
No files found.
dlls/d3d11/d3d11_private.h
View file @
32892beb
...
...
@@ -224,15 +224,16 @@ HRESULT d3d_input_layout_create(struct d3d_device *device,
struct
d3d_input_layout
**
layout
)
DECLSPEC_HIDDEN
;
struct
d3d_input_layout
*
unsafe_impl_from_ID3D10InputLayout
(
ID3D10InputLayout
*
iface
)
DECLSPEC_HIDDEN
;
/* ID3D10VertexShader */
/* ID3D1
1VertexShader, ID3D1
0VertexShader */
struct
d3d_vertex_shader
{
ID3D11VertexShader
ID3D11VertexShader_iface
;
ID3D10VertexShader
ID3D10VertexShader_iface
;
LONG
refcount
;
struct
wined3d_private_store
private_store
;
struct
wined3d_shader
*
wined3d_shader
;
ID3D1
0Device1
*
device
;
ID3D1
1Device
*
device
;
};
HRESULT
d3d_vertex_shader_init
(
struct
d3d_vertex_shader
*
shader
,
struct
d3d_device
*
device
,
...
...
dlls/d3d11/shader.c
View file @
32892beb
...
...
@@ -122,73 +122,174 @@ void shader_free_signature(struct wined3d_shader_signature *s)
HeapFree
(
GetProcessHeap
(),
0
,
s
->
elements
);
}
static
inline
struct
d3d_vertex_shader
*
impl_from_ID3D10VertexShader
(
ID3D10VertexShader
*
iface
)
/* ID3D11VertexShader methods */
static
inline
struct
d3d_vertex_shader
*
impl_from_ID3D11VertexShader
(
ID3D11VertexShader
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d3d_vertex_shader
,
ID3D1
0
VertexShader_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d_vertex_shader
,
ID3D1
1
VertexShader_iface
);
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
d3d10_vertex_shader_QueryInterface
(
ID3D10VertexShader
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
d3d11_vertex_shader_QueryInterface
(
ID3D11VertexShader
*
iface
,
REFIID
riid
,
void
**
object
)
{
TRACE
(
"iface %p, riid %s, object %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
struct
d3d_vertex_shader
*
shader
=
impl_from_ID3D11VertexShader
(
iface
);
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D10VertexShader
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D10DeviceChild
)
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D11VertexShader
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D11DeviceChild
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
I
Unknown
_AddRef
(
iface
);
I
D3D11VertexShader
_AddRef
(
iface
);
*
object
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
riid
));
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D10VertexShader
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D10DeviceChild
))
{
IUnknown_AddRef
(
&
shader
->
ID3D10VertexShader_iface
);
*
object
=
&
shader
->
ID3D10VertexShader_iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
object
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
d3d1
0_vertex_shader_AddRef
(
ID3D10
VertexShader
*
iface
)
static
ULONG
STDMETHODCALLTYPE
d3d1
1_vertex_shader_AddRef
(
ID3D11
VertexShader
*
iface
)
{
struct
d3d_vertex_shader
*
This
=
impl_from_ID3D10
VertexShader
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
refcount
);
struct
d3d_vertex_shader
*
shader
=
impl_from_ID3D11
VertexShader
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
shader
->
refcount
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p increasing refcount to %u
.
\n
"
,
shader
,
refcount
);
if
(
refcount
==
1
)
{
ID3D1
0Device1_AddRef
(
This
->
device
);
ID3D1
1Device_AddRef
(
shader
->
device
);
wined3d_mutex_lock
();
wined3d_shader_incref
(
This
->
wined3d_shader
);
wined3d_shader_incref
(
shader
->
wined3d_shader
);
wined3d_mutex_unlock
();
}
return
refcount
;
}
static
ULONG
STDMETHODCALLTYPE
d3d1
0_vertex_shader_Release
(
ID3D10
VertexShader
*
iface
)
static
ULONG
STDMETHODCALLTYPE
d3d1
1_vertex_shader_Release
(
ID3D11
VertexShader
*
iface
)
{
struct
d3d_vertex_shader
*
This
=
impl_from_ID3D10
VertexShader
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
This
->
refcount
);
struct
d3d_vertex_shader
*
shader
=
impl_from_ID3D11
VertexShader
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
shader
->
refcount
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p decreasing refcount to %u
.
\n
"
,
shader
,
refcount
);
if
(
!
refcount
)
{
ID3D1
0Device1
*
device
=
This
->
device
;
ID3D1
1Device
*
device
=
shader
->
device
;
wined3d_mutex_lock
();
wined3d_shader_decref
(
This
->
wined3d_shader
);
wined3d_shader_decref
(
shader
->
wined3d_shader
);
wined3d_mutex_unlock
();
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D1
0Device1
_Release
(
device
);
ID3D1
1Device
_Release
(
device
);
}
return
refcount
;
}
static
void
STDMETHODCALLTYPE
d3d11_vertex_shader_GetDevice
(
ID3D11VertexShader
*
iface
,
ID3D11Device
**
device
)
{
struct
d3d_vertex_shader
*
shader
=
impl_from_ID3D11VertexShader
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
shader
->
device
;
ID3D11Device_AddRef
(
*
device
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_vertex_shader_GetPrivateData
(
ID3D11VertexShader
*
iface
,
REFGUID
guid
,
UINT
*
data_size
,
void
*
data
)
{
struct
d3d_vertex_shader
*
shader
=
impl_from_ID3D11VertexShader
(
iface
);
TRACE
(
"iface %p, guid %s, data_size %p, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
d3d_get_private_data
(
&
shader
->
private_store
,
guid
,
data_size
,
data
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_vertex_shader_SetPrivateData
(
ID3D11VertexShader
*
iface
,
REFGUID
guid
,
UINT
data_size
,
const
void
*
data
)
{
struct
d3d_vertex_shader
*
shader
=
impl_from_ID3D11VertexShader
(
iface
);
TRACE
(
"iface %p, guid %s, data_size %u, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
d3d_set_private_data
(
&
shader
->
private_store
,
guid
,
data_size
,
data
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_vertex_shader_SetPrivateDataInterface
(
ID3D11VertexShader
*
iface
,
REFGUID
guid
,
const
IUnknown
*
data
)
{
struct
d3d_vertex_shader
*
shader
=
impl_from_ID3D11VertexShader
(
iface
);
TRACE
(
"iface %p, guid %s, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data
);
return
d3d_set_private_data_interface
(
&
shader
->
private_store
,
guid
,
data
);
}
static
const
struct
ID3D11VertexShaderVtbl
d3d11_vertex_shader_vtbl
=
{
/* IUnknown methods */
d3d11_vertex_shader_QueryInterface
,
d3d11_vertex_shader_AddRef
,
d3d11_vertex_shader_Release
,
/* ID3D11DeviceChild methods */
d3d11_vertex_shader_GetDevice
,
d3d11_vertex_shader_GetPrivateData
,
d3d11_vertex_shader_SetPrivateData
,
d3d11_vertex_shader_SetPrivateDataInterface
,
};
/* ID3D10VertexShader methods */
static
inline
struct
d3d_vertex_shader
*
impl_from_ID3D10VertexShader
(
ID3D10VertexShader
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d3d_vertex_shader
,
ID3D10VertexShader_iface
);
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
d3d10_vertex_shader_QueryInterface
(
ID3D10VertexShader
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
d3d_vertex_shader
*
shader
=
impl_from_ID3D10VertexShader
(
iface
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
return
d3d11_vertex_shader_QueryInterface
(
&
shader
->
ID3D11VertexShader_iface
,
riid
,
object
);
}
static
ULONG
STDMETHODCALLTYPE
d3d10_vertex_shader_AddRef
(
ID3D10VertexShader
*
iface
)
{
struct
d3d_vertex_shader
*
shader
=
impl_from_ID3D10VertexShader
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
d3d11_vertex_shader_AddRef
(
&
shader
->
ID3D11VertexShader_iface
);
}
static
ULONG
STDMETHODCALLTYPE
d3d10_vertex_shader_Release
(
ID3D10VertexShader
*
iface
)
{
struct
d3d_vertex_shader
*
shader
=
impl_from_ID3D10VertexShader
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
d3d11_vertex_shader_Release
(
&
shader
->
ID3D11VertexShader_iface
);
}
/* ID3D10DeviceChild methods */
static
void
STDMETHODCALLTYPE
d3d10_vertex_shader_GetDevice
(
ID3D10VertexShader
*
iface
,
ID3D10Device
**
device
)
...
...
@@ -197,8 +298,7 @@ static void STDMETHODCALLTYPE d3d10_vertex_shader_GetDevice(ID3D10VertexShader *
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
ID3D10Device
*
)
shader
->
device
;
ID3D10Device_AddRef
(
*
device
);
ID3D11Device_QueryInterface
(
shader
->
device
,
&
IID_ID3D10Device
,
(
void
**
)
device
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_vertex_shader_GetPrivateData
(
ID3D10VertexShader
*
iface
,
...
...
@@ -268,6 +368,7 @@ HRESULT d3d_vertex_shader_init(struct d3d_vertex_shader *shader, struct d3d_devi
struct
wined3d_shader_desc
desc
;
HRESULT
hr
;
shader
->
ID3D11VertexShader_iface
.
lpVtbl
=
&
d3d11_vertex_shader_vtbl
;
shader
->
ID3D10VertexShader_iface
.
lpVtbl
=
&
d3d10_vertex_shader_vtbl
;
shader
->
refcount
=
1
;
wined3d_mutex_lock
();
...
...
@@ -301,8 +402,8 @@ HRESULT d3d_vertex_shader_init(struct d3d_vertex_shader *shader, struct d3d_devi
}
wined3d_mutex_unlock
();
shader
->
device
=
&
device
->
ID3D1
0Device1
_iface
;
ID3D1
0Device1
_AddRef
(
shader
->
device
);
shader
->
device
=
&
device
->
ID3D1
1Device
_iface
;
ID3D1
1Device
_AddRef
(
shader
->
device
);
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