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
cf2e1db7
Commit
cf2e1db7
authored
Aug 02, 2023
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/tests: Add some more tests for effect shader loading.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
198917ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
6 deletions
+64
-6
d2d1.c
dlls/d2d1/tests/d2d1.c
+64
-6
No files found.
dlls/d2d1/tests/d2d1.c
View file @
cf2e1db7
...
...
@@ -11405,11 +11405,14 @@ static void test_effect_register(BOOL d3d11)
static
void
test_effect_context
(
BOOL
d3d11
)
{
ID2D1EffectContext
*
effect_context
;
ID2D1EffectContext
*
effect_context
,
*
effect_context2
;
ID2D1Effect
*
effect
=
NULL
,
*
effect2
=
NULL
;
ID2D1DeviceContext
*
device_context
;
D2D1_PROPERTY_BINDING
binding
;
struct
d2d1_test_context
ctx
;
ID2D1Effect
*
effect
=
NULL
;
ID2D1Factory1
*
factory
;
ID2D1Device
*
device
;
ULONG
refcount
;
BOOL
loaded
;
HRESULT
hr
;
...
...
@@ -11441,9 +11444,9 @@ static void test_effect_context(BOOL d3d11)
/* Test shader loading */
loaded
=
ID2D1EffectContext_IsShaderLoaded
(
effect_context
,
&
GUID_TestVertexShader
);
ok
(
!
loaded
,
"
Shader is loaded
.
\n
"
);
ok
(
!
loaded
,
"
Unexpected shader loaded state
.
\n
"
);
loaded
=
ID2D1EffectContext_IsShaderLoaded
(
effect_context
,
&
GUID_TestPixelShader
);
ok
(
!
loaded
,
"
Shader is loaded
.
\n
"
);
ok
(
!
loaded
,
"
Unexpected shader loaded state
.
\n
"
);
hr
=
ID2D1EffectContext_LoadVertexShader
(
effect_context
,
&
GUID_TestVertexShader
,
(
const
BYTE
*
)
test_ps
,
sizeof
(
test_ps
));
...
...
@@ -11452,7 +11455,7 @@ static void test_effect_context(BOOL d3d11)
&
GUID_TestVertexShader
,
(
const
BYTE
*
)
test_vs
,
sizeof
(
test_vs
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
loaded
=
ID2D1EffectContext_IsShaderLoaded
(
effect_context
,
&
GUID_TestVertexShader
);
ok
(
loaded
,
"
Shader is not loaded
.
\n
"
);
ok
(
loaded
,
"
Unexpected shader loaded state
.
\n
"
);
hr
=
ID2D1EffectContext_LoadVertexShader
(
effect_context
,
&
GUID_TestVertexShader
,
(
const
BYTE
*
)
test_ps
,
sizeof
(
test_ps
));
...
...
@@ -11468,9 +11471,64 @@ static void test_effect_context(BOOL d3d11)
&
GUID_TestPixelShader
,
(
const
BYTE
*
)
test_ps
,
sizeof
(
test_ps
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
loaded
=
ID2D1EffectContext_IsShaderLoaded
(
effect_context
,
&
GUID_TestPixelShader
);
ok
(
loaded
,
"Shader is not loaded.
\n
"
);
ok
(
loaded
,
"Unexpected shader loaded state.
\n
"
);
/* Same shader id, using different context. */
hr
=
ID2D1DeviceContext_CreateEffect
(
ctx
.
context
,
&
CLSID_TestEffect
,
&
effect2
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
effect_context2
=
NULL
;
hr
=
ID2D1Effect_GetValueByName
(
effect2
,
L"Context"
,
D2D1_PROPERTY_TYPE_IUNKNOWN
,
(
BYTE
*
)
&
effect_context2
,
sizeof
(
effect_context2
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
loaded
=
ID2D1EffectContext_IsShaderLoaded
(
effect_context2
,
&
GUID_TestPixelShader
);
todo_wine
ok
(
loaded
,
"Unexpected shader loaded state.
\n
"
);
ID2D1Effect_Release
(
effect2
);
/* Same shader id, using different device. */
hr
=
ID2D1Factory1_CreateDevice
(
factory
,
ctx
.
device
,
&
device
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1Device_CreateDeviceContext
(
device
,
D2D1_DEVICE_CONTEXT_OPTIONS_NONE
,
&
device_context
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1DeviceContext_CreateEffect
(
device_context
,
&
CLSID_TestEffect
,
&
effect2
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
effect_context
=
NULL
;
hr
=
ID2D1Effect_GetValueByName
(
effect2
,
L"Context"
,
D2D1_PROPERTY_TYPE_IUNKNOWN
,
(
BYTE
*
)
&
effect_context
,
sizeof
(
effect_context
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
loaded
=
ID2D1EffectContext_IsShaderLoaded
(
effect_context
,
&
GUID_TestPixelShader
);
ok
(
!
loaded
,
"Unexpected shader loaded state.
\n
"
);
ID2D1Effect_Release
(
effect2
);
ID2D1DeviceContext_Release
(
device_context
);
ID2D1Device_Release
(
device
);
/* Release all created effects, check shader map. */
refcount
=
ID2D1Effect_Release
(
effect
);
ok
(
!
refcount
,
"Unexpected refcount %lu.
\n
"
,
refcount
);
hr
=
ID2D1DeviceContext_CreateEffect
(
ctx
.
context
,
&
CLSID_TestEffect
,
&
effect
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
effect_context
=
NULL
;
hr
=
ID2D1Effect_GetValueByName
(
effect
,
L"Context"
,
D2D1_PROPERTY_TYPE_IUNKNOWN
,
(
BYTE
*
)
&
effect_context
,
sizeof
(
effect_context
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
loaded
=
ID2D1EffectContext_IsShaderLoaded
(
effect_context
,
&
GUID_TestPixelShader
);
todo_wine
ok
(
loaded
,
"Unexpected shader loaded state.
\n
"
);
ID2D1Effect_Release
(
effect
);
hr
=
ID2D1Factory1_UnregisterEffect
(
factory
,
&
CLSID_TestEffect
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
release_test_context
(
&
ctx
);
...
...
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