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
a21784b1
Commit
a21784b1
authored
Nov 04, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Free the output signature after creating the wined3d shader.
parent
d74fe031
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
46 deletions
+19
-46
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+0
-3
shader.c
dlls/d3d10core/shader.c
+19
-42
wined3d.h
include/wine/wined3d.h
+0
-1
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
a21784b1
...
...
@@ -190,7 +190,6 @@ struct d3d10_vertex_shader
LONG
refcount
;
struct
wined3d_shader
*
wined3d_shader
;
struct
wined3d_shader_signature
output_signature
;
ID3D10Device1
*
device
;
};
...
...
@@ -205,7 +204,6 @@ struct d3d10_geometry_shader
LONG
refcount
;
struct
wined3d_shader
*
wined3d_shader
;
struct
wined3d_shader_signature
output_signature
;
};
HRESULT
d3d10_geometry_shader_init
(
struct
d3d10_geometry_shader
*
shader
,
struct
d3d10_device
*
device
,
...
...
@@ -219,7 +217,6 @@ struct d3d10_pixel_shader
LONG
refcount
;
struct
wined3d_shader
*
wined3d_shader
;
struct
wined3d_shader_signature
output_signature
;
ID3D10Device1
*
device
;
};
...
...
dlls/d3d10core/shader.c
View file @
a21784b1
...
...
@@ -70,10 +70,7 @@ static HRESULT shader_extract_from_dxbc(const void *dxbc, SIZE_T dxbc_length, st
HRESULT
shader_parse_signature
(
const
char
*
data
,
DWORD
data_size
,
struct
wined3d_shader_signature
*
s
)
{
struct
wined3d_shader_signature_element
*
e
;
unsigned
int
string_data_offset
;
unsigned
int
string_data_size
;
const
char
*
ptr
=
data
;
char
*
string_data
;
unsigned
int
i
;
DWORD
count
;
...
...
@@ -89,24 +86,12 @@ HRESULT shader_parse_signature(const char *data, DWORD data_size, struct wined3d
return
E_OUTOFMEMORY
;
}
/* 2 DWORDs for the header, 6 for each element. */
string_data_offset
=
2
*
sizeof
(
DWORD
)
+
count
*
6
*
sizeof
(
DWORD
);
string_data_size
=
data_size
-
string_data_offset
;
string_data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
string_data_size
);
if
(
!
string_data
)
{
ERR
(
"Failed to allocate string data memory.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
e
);
return
E_OUTOFMEMORY
;
}
memcpy
(
string_data
,
data
+
string_data_offset
,
string_data_size
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
UINT
name_offset
;
read_dword
(
&
ptr
,
&
name_offset
);
e
[
i
].
semantic_name
=
string_data
+
(
name_offset
-
string_data_offset
)
;
e
[
i
].
semantic_name
=
data
+
name_offset
;
read_dword
(
&
ptr
,
&
e
[
i
].
semantic_idx
);
read_dword
(
&
ptr
,
&
e
[
i
].
sysval_semantic
);
read_dword
(
&
ptr
,
&
e
[
i
].
component_type
);
...
...
@@ -121,14 +106,12 @@ HRESULT shader_parse_signature(const char *data, DWORD data_size, struct wined3d
s
->
elements
=
e
;
s
->
element_count
=
count
;
s
->
string_data
=
string_data
;
return
S_OK
;
}
void
shader_free_signature
(
struct
wined3d_shader_signature
*
s
)
{
HeapFree
(
GetProcessHeap
(),
0
,
s
->
string_data
);
HeapFree
(
GetProcessHeap
(),
0
,
s
->
elements
);
}
...
...
@@ -248,9 +231,7 @@ static const struct ID3D10VertexShaderVtbl d3d10_vertex_shader_vtbl =
static
void
STDMETHODCALLTYPE
d3d10_vertex_shader_wined3d_object_destroyed
(
void
*
parent
)
{
struct
d3d10_vertex_shader
*
shader
=
parent
;
shader_free_signature
(
&
shader
->
output_signature
);
HeapFree
(
GetProcessHeap
(),
0
,
shader
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
}
static
const
struct
wined3d_parent_ops
d3d10_vertex_shader_wined3d_parent_ops
=
...
...
@@ -261,13 +242,14 @@ static const struct wined3d_parent_ops d3d10_vertex_shader_wined3d_parent_ops =
HRESULT
d3d10_vertex_shader_init
(
struct
d3d10_vertex_shader
*
shader
,
struct
d3d10_device
*
device
,
const
void
*
byte_code
,
SIZE_T
byte_code_length
)
{
struct
wined3d_shader_signature
output_signature
;
struct
d3d10_shader_info
shader_info
;
HRESULT
hr
;
shader
->
ID3D10VertexShader_iface
.
lpVtbl
=
&
d3d10_vertex_shader_vtbl
;
shader
->
refcount
=
1
;
shader_info
.
output_signature
=
&
shader
->
output_signature
;
shader_info
.
output_signature
=
&
output_signature
;
hr
=
shader_extract_from_dxbc
(
byte_code
,
byte_code_length
,
&
shader_info
);
if
(
FAILED
(
hr
))
{
...
...
@@ -276,13 +258,12 @@ HRESULT d3d10_vertex_shader_init(struct d3d10_vertex_shader *shader, struct d3d1
}
hr
=
wined3d_shader_create_vs
(
device
->
wined3d_device
,
shader_info
.
shader_code
,
&
shader
->
output_signature
,
shader
,
&
d3d10_vertex_shader_wined3d_parent_ops
,
&
shader
->
wined3d_shader
,
4
);
&
output_signature
,
shader
,
&
d3d10_vertex_shader_wined3d_parent_ops
,
&
shader
->
wined3d_shader
,
4
);
shader_free_signature
(
&
output_signature
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d vertex shader, hr %#x.
\n
"
,
hr
);
shader_free_signature
(
&
shader
->
output_signature
);
hr
=
E_INVALIDARG
;
return
hr
;
return
E_INVALIDARG
;
}
shader
->
device
=
&
device
->
ID3D10Device1_iface
;
...
...
@@ -398,9 +379,7 @@ static const struct ID3D10GeometryShaderVtbl d3d10_geometry_shader_vtbl =
static
void
STDMETHODCALLTYPE
d3d10_geometry_shader_wined3d_object_destroyed
(
void
*
parent
)
{
struct
d3d10_geometry_shader
*
shader
=
parent
;
shader_free_signature
(
&
shader
->
output_signature
);
HeapFree
(
GetProcessHeap
(),
0
,
shader
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
}
static
const
struct
wined3d_parent_ops
d3d10_geometry_shader_wined3d_parent_ops
=
...
...
@@ -411,13 +390,14 @@ static const struct wined3d_parent_ops d3d10_geometry_shader_wined3d_parent_ops
HRESULT
d3d10_geometry_shader_init
(
struct
d3d10_geometry_shader
*
shader
,
struct
d3d10_device
*
device
,
const
void
*
byte_code
,
SIZE_T
byte_code_length
)
{
struct
wined3d_shader_signature
output_signature
;
struct
d3d10_shader_info
shader_info
;
HRESULT
hr
;
shader
->
ID3D10GeometryShader_iface
.
lpVtbl
=
&
d3d10_geometry_shader_vtbl
;
shader
->
refcount
=
1
;
shader_info
.
output_signature
=
&
shader
->
output_signature
;
shader_info
.
output_signature
=
&
output_signature
;
hr
=
shader_extract_from_dxbc
(
byte_code
,
byte_code_length
,
&
shader_info
);
if
(
FAILED
(
hr
))
{
...
...
@@ -426,13 +406,12 @@ HRESULT d3d10_geometry_shader_init(struct d3d10_geometry_shader *shader, struct
}
hr
=
wined3d_shader_create_gs
(
device
->
wined3d_device
,
shader_info
.
shader_code
,
&
shader
->
output_signature
,
shader
,
&
d3d10_geometry_shader_wined3d_parent_ops
,
&
shader
->
wined3d_shader
,
4
);
&
output_signature
,
shader
,
&
d3d10_geometry_shader_wined3d_parent_ops
,
&
shader
->
wined3d_shader
,
4
);
shader_free_signature
(
&
output_signature
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d geometry shader, hr %#x.
\n
"
,
hr
);
shader_free_signature
(
&
shader
->
output_signature
);
hr
=
E_INVALIDARG
;
return
hr
;
return
E_INVALIDARG
;
}
return
S_OK
;
...
...
@@ -563,9 +542,7 @@ static const struct ID3D10PixelShaderVtbl d3d10_pixel_shader_vtbl =
static
void
STDMETHODCALLTYPE
d3d10_pixel_shader_wined3d_object_destroyed
(
void
*
parent
)
{
struct
d3d10_pixel_shader
*
shader
=
parent
;
shader_free_signature
(
&
shader
->
output_signature
);
HeapFree
(
GetProcessHeap
(),
0
,
shader
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
}
static
const
struct
wined3d_parent_ops
d3d10_pixel_shader_wined3d_parent_ops
=
...
...
@@ -576,13 +553,14 @@ static const struct wined3d_parent_ops d3d10_pixel_shader_wined3d_parent_ops =
HRESULT
d3d10_pixel_shader_init
(
struct
d3d10_pixel_shader
*
shader
,
struct
d3d10_device
*
device
,
const
void
*
byte_code
,
SIZE_T
byte_code_length
)
{
struct
wined3d_shader_signature
output_signature
;
struct
d3d10_shader_info
shader_info
;
HRESULT
hr
;
shader
->
ID3D10PixelShader_iface
.
lpVtbl
=
&
d3d10_pixel_shader_vtbl
;
shader
->
refcount
=
1
;
shader_info
.
output_signature
=
&
shader
->
output_signature
;
shader_info
.
output_signature
=
&
output_signature
;
hr
=
shader_extract_from_dxbc
(
byte_code
,
byte_code_length
,
&
shader_info
);
if
(
FAILED
(
hr
))
{
...
...
@@ -591,13 +569,12 @@ HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d10_
}
hr
=
wined3d_shader_create_ps
(
device
->
wined3d_device
,
shader_info
.
shader_code
,
&
shader
->
output_signature
,
shader
,
&
d3d10_pixel_shader_wined3d_parent_ops
,
&
shader
->
wined3d_shader
,
4
);
&
output_signature
,
shader
,
&
d3d10_pixel_shader_wined3d_parent_ops
,
&
shader
->
wined3d_shader
,
4
);
shader_free_signature
(
&
output_signature
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d pixel shader, hr %#x.
\n
"
,
hr
);
shader_free_signature
(
&
shader
->
output_signature
);
hr
=
E_INVALIDARG
;
return
hr
;
return
E_INVALIDARG
;
}
shader
->
device
=
&
device
->
ID3D10Device1_iface
;
...
...
include/wine/wined3d.h
View file @
a21784b1
...
...
@@ -1970,7 +1970,6 @@ struct wined3d_shader_signature
{
UINT
element_count
;
struct
wined3d_shader_signature_element
*
elements
;
char
*
string_data
;
};
struct
wined3d_parent_ops
...
...
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