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
e4eee4dd
Commit
e4eee4dd
authored
Feb 13, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Implement d3d10_pixel_shader_GetDevice().
parent
687c1c73
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+1
-0
shader.c
dlls/d3d10core/shader.c
+19
-1
device.c
dlls/d3d10core/tests/device.c
+11
-2
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
e4eee4dd
...
...
@@ -210,6 +210,7 @@ struct d3d10_pixel_shader
struct
wined3d_shader
*
wined3d_shader
;
struct
wined3d_shader_signature
output_signature
;
ID3D10Device1
*
device
;
};
HRESULT
d3d10_pixel_shader_init
(
struct
d3d10_pixel_shader
*
shader
,
struct
d3d10_device
*
device
,
...
...
dlls/d3d10core/shader.c
View file @
e4eee4dd
...
...
@@ -482,7 +482,10 @@ static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_AddRef(ID3D10PixelShader *ifac
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
if
(
refcount
==
1
)
{
ID3D10Device1_AddRef
(
This
->
device
);
wined3d_shader_incref
(
This
->
wined3d_shader
);
}
return
refcount
;
}
...
...
@@ -495,7 +498,14 @@ static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_Release(ID3D10PixelShader *ifa
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
if
(
!
refcount
)
{
ID3D10Device1
*
device
=
This
->
device
;
wined3d_shader_decref
(
This
->
wined3d_shader
);
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D10Device1_Release
(
device
);
}
return
refcount
;
}
...
...
@@ -504,7 +514,12 @@ static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_Release(ID3D10PixelShader *ifa
static
void
STDMETHODCALLTYPE
d3d10_pixel_shader_GetDevice
(
ID3D10PixelShader
*
iface
,
ID3D10Device
**
device
)
{
FIXME
(
"iface %p, device %p stub!
\n
"
,
iface
,
device
);
struct
d3d10_pixel_shader
*
shader
=
impl_from_ID3D10PixelShader
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
ID3D10Device
*
)
shader
->
device
;
ID3D10Device_AddRef
(
*
device
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_pixel_shader_GetPrivateData
(
ID3D10PixelShader
*
iface
,
...
...
@@ -585,6 +600,9 @@ HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d10_
return
hr
;
}
shader
->
device
=
&
device
->
ID3D10Device1_iface
;
ID3D10Device1_AddRef
(
shader
->
device
);
return
S_OK
;
}
...
...
dlls/d3d10core/tests/device.c
View file @
e4eee4dd
...
...
@@ -584,10 +584,19 @@ float4 main(const float4 color : COLOR) : SV_TARGET
hr
=
ID3D10Device_CreateVertexShader
(
device
,
ps_4_0
,
sizeof
(
ps_4_0
),
&
vs
);
ok
(
hr
==
E_INVALIDARG
,
"Created a SM4 vertex shader from a pixel shader source, hr %#x
\n
"
,
hr
);
expected_refcount
=
get_refcount
((
IUnknown
*
)
device
)
+
1
;
hr
=
ID3D10Device_CreatePixelShader
(
device
,
ps_4_0
,
sizeof
(
ps_4_0
),
&
ps
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create SM4 vertex shader, hr %#x
\n
"
,
hr
);
if
(
ps
)
ID3D10PixelShader_Release
(
ps
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
>=
expected_refcount
,
"Got unexpected refcount %u, expected >= %u.
\n
"
,
refcount
,
expected_refcount
);
tmp
=
NULL
;
expected_refcount
=
refcount
+
1
;
ID3D10PixelShader_GetDevice
(
ps
,
&
tmp
);
ok
(
tmp
==
device
,
"Got unexpected device %p, expected %p.
\n
"
,
tmp
,
device
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ID3D10Device_Release
(
tmp
);
ID3D10PixelShader_Release
(
ps
);
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
...
...
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