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
5317f869
Commit
5317f869
authored
May 25, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/effect: Add a helper to append shader objects to the context.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
35c4117b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
21 deletions
+25
-21
effect.c
dlls/d2d1/effect.c
+25
-21
No files found.
dlls/d2d1/effect.c
View file @
5317f869
...
...
@@ -37,18 +37,35 @@ static inline struct d2d_effect_context *impl_from_ID2D1EffectContext(ID2D1Effec
static
void
d2d_effect_context_cleanup
(
struct
d2d_effect_context
*
effect_context
)
{
unsigned
in
t
i
;
size_
t
i
;
for
(
i
=
0
;
i
<
effect_context
->
shader_count
;
++
i
)
{
if
(
effect_context
->
shaders
[
i
].
shader
)
IUnknown_Release
(
effect_context
->
shaders
[
i
].
shader
);
}
IUnknown_Release
(
effect_context
->
shaders
[
i
].
shader
);
heap_free
(
effect_context
->
shaders
);
ID2D1DeviceContext_Release
(
&
effect_context
->
device_context
->
ID2D1DeviceContext_iface
);
}
static
HRESULT
d2d_effect_context_add_shader
(
struct
d2d_effect_context
*
effect_context
,
REFGUID
shader_id
,
void
*
shader
)
{
struct
d2d_shader
*
entry
;
if
(
!
d2d_array_reserve
((
void
**
)
&
effect_context
->
shaders
,
&
effect_context
->
shaders_size
,
effect_context
->
shader_count
+
1
,
sizeof
(
*
effect_context
->
shaders
)))
{
WARN
(
"Failed to resize shaders array.
\n
"
);
return
E_OUTOFMEMORY
;
}
entry
=
&
effect_context
->
shaders
[
effect_context
->
shader_count
++
];
entry
->
id
=
*
shader_id
;
entry
->
shader
=
shader
;
IUnknown_AddRef
(
entry
->
shader
);
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_effect_context_QueryInterface
(
ID2D1EffectContext
*
iface
,
REFIID
iid
,
void
**
out
)
{
TRACE
(
"iface %p, iid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
...
...
@@ -189,7 +206,6 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadVertexShader(ID2D1Effect
{
struct
d2d_effect_context
*
effect_context
=
impl_from_ID2D1EffectContext
(
iface
);
ID3D11VertexShader
*
vertex_shader
;
struct
d2d_shader
*
shader
;
HRESULT
hr
;
TRACE
(
"iface %p, shader_id %s, buffer %p, buffer_size %u.
\n
"
,
...
...
@@ -205,22 +221,10 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadVertexShader(ID2D1Effect
return
hr
;
}
if
(
!
d2d_array_reserve
((
void
**
)
&
effect_context
->
shaders
,
&
effect_context
->
shaders_size
,
effect_context
->
shader_count
+
1
,
sizeof
(
*
effect_context
->
shaders
)))
{
ERR
(
"Failed to resize shaders array.
\n
"
);
ID3D11VertexShader_Release
(
vertex_shader
);
return
E_OUTOFMEMORY
;
}
memset
(
effect_context
->
shaders
+
effect_context
->
shader_count
,
0
,
sizeof
(
*
effect_context
->
shaders
)
*
(
effect_context
->
shaders_size
-
effect_context
->
shader_count
));
hr
=
d2d_effect_context_add_shader
(
effect_context
,
shader_id
,
vertex_shader
);
ID3D11VertexShader_Release
(
vertex_shader
);
effect_context
->
shader_count
++
;
shader
=
&
effect_context
->
shaders
[
effect_context
->
shader_count
-
1
];
shader
->
id
=
*
shader_id
;
shader
->
shader
=
(
IUnknown
*
)
vertex_shader
;
return
S_OK
;
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_effect_context_LoadComputeShader
(
ID2D1EffectContext
*
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