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
51406b47
Commit
51406b47
authored
Dec 16, 2014
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Don't assert for shaders with the wrong vtbl.
parent
f95e7a4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
shader.c
dlls/d3d9/shader.c
+4
-2
device.c
dlls/d3d9/tests/device.c
+22
-0
No files found.
dlls/d3d9/shader.c
View file @
51406b47
...
...
@@ -167,7 +167,8 @@ struct d3d9_vertexshader *unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVerte
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
d3d9_vertexshader_vtbl
);
if
(
iface
->
lpVtbl
!=
&
d3d9_vertexshader_vtbl
)
WARN
(
"Vertex shader %p with the wrong vtbl %p
\n
"
,
iface
,
iface
->
lpVtbl
);
return
impl_from_IDirect3DVertexShader9
(
iface
);
}
...
...
@@ -317,7 +318,8 @@ struct d3d9_pixelshader *unsafe_impl_from_IDirect3DPixelShader9(IDirect3DPixelSh
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
d3d9_pixelshader_vtbl
);
if
(
iface
->
lpVtbl
!=
&
d3d9_pixelshader_vtbl
)
WARN
(
"Pixel shader %p with the wrong vtbl %p
\n
"
,
iface
,
iface
->
lpVtbl
);
return
impl_from_IDirect3DPixelShader9
(
iface
);
}
dlls/d3d9/tests/device.c
View file @
51406b47
...
...
@@ -5518,6 +5518,7 @@ static void test_get_set_vertex_shader(void)
{
IDirect3DVertexShader9
*
current_shader
=
NULL
;
IDirect3DVertexShader9
*
shader
=
NULL
;
const
IDirect3DVertexShader9Vtbl
*
shader_vtbl
;
IDirect3DDevice9
*
device
;
ULONG
refcount
,
i
;
IDirect3D9
*
d3d
;
...
...
@@ -5568,6 +5569,16 @@ static void test_get_set_vertex_shader(void)
ok
(
current_shader
==
shader
,
"Got unexpected shader %p, expected %p.
\n
"
,
current_shader
,
shader
);
IDirect3DVertexShader9_Release
(
current_shader
);
/* SetVertexShader() with a bogus shader vtbl */
shader_vtbl
=
shader
->
lpVtbl
;
shader
->
lpVtbl
=
(
IDirect3DVertexShader9Vtbl
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9_SetVertexShader
(
device
,
shader
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set vertex shader, hr %#x.
\n
"
,
hr
);
shader
->
lpVtbl
=
NULL
;
hr
=
IDirect3DDevice9_SetVertexShader
(
device
,
shader
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set vertex shader, hr %#x.
\n
"
,
hr
);
shader
->
lpVtbl
=
shader_vtbl
;
IDirect3DVertexShader9_Release
(
shader
);
refcount
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
...
...
@@ -5640,6 +5651,7 @@ static void test_get_set_pixel_shader(void)
{
IDirect3DPixelShader9
*
current_shader
=
NULL
;
IDirect3DPixelShader9
*
shader
=
NULL
;
const
IDirect3DPixelShader9Vtbl
*
shader_vtbl
;
IDirect3DDevice9
*
device
;
ULONG
refcount
,
i
;
IDirect3D9
*
d3d
;
...
...
@@ -5690,6 +5702,16 @@ static void test_get_set_pixel_shader(void)
ok
(
current_shader
==
shader
,
"Got unexpected shader %p, expected %p.
\n
"
,
current_shader
,
shader
);
IDirect3DPixelShader9_Release
(
current_shader
);
/* SetPixelShader() with a bogus shader vtbl */
shader_vtbl
=
shader
->
lpVtbl
;
shader
->
lpVtbl
=
(
IDirect3DPixelShader9Vtbl
*
)
0xdeadbeef
;
hr
=
IDirect3DDevice9_SetPixelShader
(
device
,
shader
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set pixel shader, hr %#x.
\n
"
,
hr
);
shader
->
lpVtbl
=
NULL
;
hr
=
IDirect3DDevice9_SetPixelShader
(
device
,
shader
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set pixel shader, hr %#x.
\n
"
,
hr
);
shader
->
lpVtbl
=
shader_vtbl
;
IDirect3DPixelShader9_Release
(
shader
);
refcount
=
IDirect3DDevice9_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