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
909c5cc6
Commit
909c5cc6
authored
Nov 04, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Make a copy of shader signature string data.
parent
a10a4538
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
shader.c
dlls/wined3d/shader.c
+32
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/shader.c
View file @
909c5cc6
...
...
@@ -1603,6 +1603,7 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
static
void
shader_cleanup
(
struct
wined3d_shader
*
shader
)
{
HeapFree
(
GetProcessHeap
(),
0
,
shader
->
signature_strings
);
shader
->
device
->
shader_backend
->
shader_destroy
(
shader
);
HeapFree
(
GetProcessHeap
(),
0
,
shader
->
reg_maps
.
constf
);
HeapFree
(
GetProcessHeap
(),
0
,
shader
->
function
);
...
...
@@ -2011,11 +2012,41 @@ static HRESULT vertexshader_init(struct wined3d_shader *shader, struct wined3d_d
if
(
output_signature
)
{
struct
wined3d_shader_signature_element
*
e
;
SIZE_T
total
,
len
;
char
*
ptr
;
total
=
0
;
for
(
i
=
0
;
i
<
output_signature
->
element_count
;
++
i
)
{
e
=
&
output_signature
->
elements
[
i
];
len
=
strlen
(
e
->
semantic_name
);
if
(
len
>=
~
(
SIZE_T
)
0
-
total
)
{
shader_cleanup
(
shader
);
return
E_OUTOFMEMORY
;
}
total
+=
len
+
1
;
}
if
(
!
(
shader
->
signature_strings
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
)))
{
shader_cleanup
(
shader
);
return
E_OUTOFMEMORY
;
}
ptr
=
shader
->
signature_strings
;
for
(
i
=
0
;
i
<
output_signature
->
element_count
;
++
i
)
{
struct
wined3d_shader_signature_element
*
e
=
&
output_signature
->
elements
[
i
];
e
=
&
output_signature
->
elements
[
i
];
reg_maps
->
output_registers
|=
1
<<
e
->
register_idx
;
shader
->
output_signature
[
e
->
register_idx
]
=
*
e
;
len
=
strlen
(
e
->
semantic_name
);
memcpy
(
ptr
,
e
->
semantic_name
,
len
+
1
);
shader
->
output_signature
[
e
->
register_idx
].
semantic_name
=
ptr
;
ptr
+=
len
+
1
;
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
909c5cc6
...
...
@@ -2879,6 +2879,7 @@ struct wined3d_shader
struct
wined3d_shader_signature_element
input_signature
[
max
(
MAX_ATTRIBS
,
MAX_REG_INPUT
)];
struct
wined3d_shader_signature_element
output_signature
[
MAX_REG_OUTPUT
];
char
*
signature_strings
;
/* Pointer to the parent device */
struct
wined3d_device
*
device
;
...
...
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