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
600d6b01
Commit
600d6b01
authored
Feb 04, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Use the global memory allocation helpers.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2e027f86
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
73 additions
and
80 deletions
+73
-80
async.c
dlls/d3d11/async.c
+3
-3
buffer.c
dlls/d3d11/buffer.c
+3
-3
d3d11_private.h
dlls/d3d11/d3d11_private.h
+1
-7
device.c
dlls/d3d11/device.c
+3
-3
inputlayout.c
dlls/d3d11/inputlayout.c
+5
-6
shader.c
dlls/d3d11/shader.c
+26
-26
state.c
dlls/d3d11/state.c
+14
-14
texture.c
dlls/d3d11/texture.c
+6
-6
view.c
dlls/d3d11/view.c
+12
-12
No files found.
dlls/d3d11/async.c
View file @
600d6b01
...
...
@@ -189,7 +189,7 @@ static void STDMETHODCALLTYPE d3d_query_wined3d_object_destroyed(void *parent)
struct
d3d_query
*
query
=
parent
;
wined3d_private_store_cleanup
(
&
query
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_query_wined3d_parent_ops
=
...
...
@@ -502,13 +502,13 @@ HRESULT d3d_query_create(struct d3d_device *device, const D3D11_QUERY_DESC *desc
if
(
is_predicate_type
)
predicate
=
TRUE
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_query_init
(
object
,
device
,
desc
,
predicate
)))
{
WARN
(
"Failed to initialize predicate, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
dlls/d3d11/buffer.c
View file @
600d6b01
...
...
@@ -379,7 +379,7 @@ static void STDMETHODCALLTYPE d3d_buffer_wined3d_object_released(void *parent)
struct
d3d_buffer
*
buffer
=
parent
;
wined3d_private_store_cleanup
(
&
buffer
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_buffer_wined3d_parent_ops
=
...
...
@@ -484,13 +484,13 @@ HRESULT d3d_buffer_create(struct d3d_device *device, const D3D11_BUFFER_DESC *de
struct
d3d_buffer
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_buffer_init
(
object
,
device
,
desc
,
data
)))
{
WARN
(
"Failed to initialize buffer, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
dlls/d3d11/d3d11_private.h
View file @
600d6b01
...
...
@@ -20,6 +20,7 @@
#define __WINE_D3D11_PRIVATE_H
#include "wine/debug.h"
#include "wine/heap.h"
#include <assert.h>
...
...
@@ -94,13 +95,6 @@ HRESULT d3d_set_private_data(struct wined3d_private_store *store,
HRESULT
d3d_set_private_data_interface
(
struct
wined3d_private_store
*
store
,
REFGUID
guid
,
const
IUnknown
*
object
)
DECLSPEC_HIDDEN
;
static
inline
void
*
d3d11_calloc
(
SIZE_T
count
,
SIZE_T
size
)
{
if
(
count
>
~
(
SIZE_T
)
0
/
size
)
return
NULL
;
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
count
*
size
);
}
static
inline
void
read_dword
(
const
char
**
ptr
,
DWORD
*
d
)
{
memcpy
(
d
,
*
ptr
,
sizeof
(
*
d
));
...
...
dlls/d3d11/device.c
View file @
600d6b01
...
...
@@ -5198,7 +5198,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutp
}
if
(
output_stream_decl_count
&&
!
(
so_entries
=
d3d11
_calloc
(
output_stream_decl_count
,
sizeof
(
*
so_entries
))))
&&
!
(
so_entries
=
heap
_calloc
(
output_stream_decl_count
,
sizeof
(
*
so_entries
))))
{
ERR
(
"Failed to allocate D3D11 SO declaration array memory.
\n
"
);
*
shader
=
NULL
;
...
...
@@ -5220,7 +5220,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutp
if
(
output_stream_stride
)
{
WARN
(
"Stride must be 0 when multiple output slots are used.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
so_entries
);
heap_free
(
so_entries
);
*
shader
=
NULL
;
return
E_INVALIDARG
;
}
...
...
@@ -5229,7 +5229,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutp
hr
=
d3d_geometry_shader_create
(
device
,
byte_code
,
byte_code_length
,
so_entries
,
output_stream_decl_count
,
&
output_stream_stride
,
stride_count
,
0
,
&
object
);
HeapFree
(
GetProcessHeap
(),
0
,
so_entries
);
heap_free
(
so_entries
);
if
(
FAILED
(
hr
))
{
*
shader
=
NULL
;
...
...
dlls/d3d11/inputlayout.c
View file @
600d6b01
...
...
@@ -54,7 +54,7 @@ static HRESULT d3d11_input_layout_to_wined3d_declaration(const D3D11_INPUT_ELEME
return
E_FAIL
;
}
if
(
!
(
*
wined3d_elements
=
d3d11
_calloc
(
element_count
,
sizeof
(
**
wined3d_elements
))))
if
(
!
(
*
wined3d_elements
=
heap
_calloc
(
element_count
,
sizeof
(
**
wined3d_elements
))))
{
ERR
(
"Failed to allocate wined3d vertex element array memory.
\n
"
);
shader_free_signature
(
&
is
);
...
...
@@ -315,7 +315,7 @@ static void STDMETHODCALLTYPE d3d_input_layout_wined3d_object_destroyed(void *pa
struct
d3d_input_layout
*
layout
=
parent
;
wined3d_private_store_cleanup
(
&
layout
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_input_layout_wined3d_parent_ops
=
...
...
@@ -347,7 +347,7 @@ static HRESULT d3d_input_layout_init(struct d3d_input_layout *layout, struct d3d
hr
=
wined3d_vertex_declaration_create
(
device
->
wined3d_device
,
wined3d_elements
,
element_count
,
layout
,
&
d3d_input_layout_wined3d_parent_ops
,
&
layout
->
wined3d_decl
);
HeapFree
(
GetProcessHeap
(),
0
,
wined3d_elements
);
heap_free
(
wined3d_elements
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d vertex declaration, hr %#x.
\n
"
,
hr
);
...
...
@@ -370,15 +370,14 @@ HRESULT d3d_input_layout_create(struct d3d_device *device,
struct
d3d_input_layout
*
object
;
HRESULT
hr
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_input_layout_init
(
object
,
device
,
element_descs
,
element_count
,
shader_byte_code
,
shader_byte_code_length
)))
{
WARN
(
"Failed to initialize input layout, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
dlls/d3d11/shader.c
View file @
600d6b01
...
...
@@ -220,7 +220,7 @@ HRESULT shader_parse_signature(DWORD tag, const char *data, DWORD data_size,
return
E_INVALIDARG
;
}
if
(
!
(
e
=
d3d11
_calloc
(
count
,
sizeof
(
*
e
))))
if
(
!
(
e
=
heap
_calloc
(
count
,
sizeof
(
*
e
))))
{
ERR
(
"Failed to allocate input signature memory.
\n
"
);
return
E_OUTOFMEMORY
;
...
...
@@ -238,7 +238,7 @@ HRESULT shader_parse_signature(DWORD tag, const char *data, DWORD data_size,
if
(
!
(
e
[
i
].
semantic_name
=
shader_get_string
(
data
,
data_size
,
name_offset
)))
{
WARN
(
"Invalid name offset %#x (data size %#x).
\n
"
,
name_offset
,
data_size
);
HeapFree
(
GetProcessHeap
(),
0
,
e
);
heap_free
(
e
);
return
E_INVALIDARG
;
}
read_dword
(
&
ptr
,
&
e
[
i
].
semantic_idx
);
...
...
@@ -277,7 +277,7 @@ struct wined3d_shader_signature_element *shader_find_signature_element(const str
void
shader_free_signature
(
struct
wined3d_shader_signature
*
s
)
{
HeapFree
(
GetProcessHeap
(),
0
,
s
->
elements
);
heap_free
(
s
->
elements
);
}
/* ID3D11VertexShader methods */
...
...
@@ -509,7 +509,7 @@ static void STDMETHODCALLTYPE d3d_vertex_shader_wined3d_object_destroyed(void *p
struct
d3d_vertex_shader
*
shader
=
parent
;
wined3d_private_store_cleanup
(
&
shader
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_vertex_shader_wined3d_parent_ops
=
...
...
@@ -583,13 +583,13 @@ HRESULT d3d_vertex_shader_create(struct d3d_device *device, const void *byte_cod
struct
d3d_vertex_shader
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_vertex_shader_init
(
object
,
device
,
byte_code
,
byte_code_length
)))
{
WARN
(
"Failed to initialize vertex shader, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -744,7 +744,7 @@ static void STDMETHODCALLTYPE d3d11_hull_shader_wined3d_object_destroyed(void *p
struct
d3d11_hull_shader
*
shader
=
parent
;
wined3d_private_store_cleanup
(
&
shader
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d11_hull_shader_wined3d_parent_ops
=
...
...
@@ -796,12 +796,12 @@ HRESULT d3d11_hull_shader_create(struct d3d_device *device, const void *byte_cod
struct
d3d11_hull_shader
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d11_hull_shader_init
(
object
,
device
,
byte_code
,
byte_code_length
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -947,7 +947,7 @@ static void STDMETHODCALLTYPE d3d11_domain_shader_wined3d_object_destroyed(void
struct
d3d11_domain_shader
*
shader
=
parent
;
wined3d_private_store_cleanup
(
&
shader
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d11_domain_shader_wined3d_parent_ops
=
...
...
@@ -999,12 +999,12 @@ HRESULT d3d11_domain_shader_create(struct d3d_device *device, const void *byte_c
struct
d3d11_domain_shader
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d11_domain_shader_init
(
object
,
device
,
byte_code
,
byte_code_length
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -1253,7 +1253,7 @@ static void STDMETHODCALLTYPE d3d_geometry_shader_wined3d_object_destroyed(void
struct
d3d_geometry_shader
*
shader
=
parent
;
wined3d_private_store_cleanup
(
&
shader
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_geometry_shader_wined3d_parent_ops
=
...
...
@@ -1491,7 +1491,7 @@ static HRESULT d3d_geometry_shader_init(struct d3d_geometry_shader *shader,
so_desc
.
buffer_stride_count
=
buffer_stride_count
;
so_desc
.
rasterizer_stream_idx
=
rasterizer_stream
;
if
(
!
(
so_desc
.
elements
=
d3d11
_calloc
(
so_entry_count
,
sizeof
(
*
so_desc
.
elements
))))
if
(
!
(
so_desc
.
elements
=
heap
_calloc
(
so_entry_count
,
sizeof
(
*
so_desc
.
elements
))))
{
ERR
(
"Failed to allocate wined3d stream output element array memory.
\n
"
);
free_shader_desc
(
&
desc
);
...
...
@@ -1501,7 +1501,7 @@ static HRESULT d3d_geometry_shader_init(struct d3d_geometry_shader *shader,
so_entries
,
so_entry_count
,
buffer_strides
,
buffer_stride_count
,
&
desc
.
output_signature
,
device
->
feature_level
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
so_desc
.
elements
);
heap_free
(
so_desc
.
elements
);
free_shader_desc
(
&
desc
);
return
hr
;
}
...
...
@@ -1515,7 +1515,7 @@ static HRESULT d3d_geometry_shader_init(struct d3d_geometry_shader *shader,
hr
=
wined3d_shader_create_gs
(
device
->
wined3d_device
,
&
desc
,
so_entries
?
&
so_desc
:
NULL
,
shader
,
&
d3d_geometry_shader_wined3d_parent_ops
,
&
shader
->
wined3d_shader
);
HeapFree
(
GetProcessHeap
(),
0
,
so_desc
.
elements
);
heap_free
(
so_desc
.
elements
);
free_shader_desc
(
&
desc
);
if
(
FAILED
(
hr
))
{
...
...
@@ -1540,14 +1540,14 @@ HRESULT d3d_geometry_shader_create(struct d3d_device *device, const void *byte_c
struct
d3d_geometry_shader
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_geometry_shader_init
(
object
,
device
,
byte_code
,
byte_code_length
,
so_entries
,
so_entry_count
,
buffer_strides
,
buffer_stride_count
,
rasterizer_stream
)))
{
WARN
(
"Failed to initialize geometry shader, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -1804,7 +1804,7 @@ static void STDMETHODCALLTYPE d3d_pixel_shader_wined3d_object_destroyed(void *pa
struct
d3d_pixel_shader
*
shader
=
parent
;
wined3d_private_store_cleanup
(
&
shader
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_pixel_shader_wined3d_parent_ops
=
...
...
@@ -1857,13 +1857,13 @@ HRESULT d3d_pixel_shader_create(struct d3d_device *device, const void *byte_code
struct
d3d_pixel_shader
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_pixel_shader_init
(
object
,
device
,
byte_code
,
byte_code_length
)))
{
WARN
(
"Failed to initialize pixel shader, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -2016,7 +2016,7 @@ static void STDMETHODCALLTYPE d3d11_compute_shader_wined3d_object_destroyed(void
struct
d3d11_compute_shader
*
shader
=
parent
;
wined3d_private_store_cleanup
(
&
shader
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d11_compute_shader_wined3d_parent_ops
=
...
...
@@ -2067,12 +2067,12 @@ HRESULT d3d11_compute_shader_create(struct d3d_device *device, const void *byte_
struct
d3d11_compute_shader
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d11_compute_shader_init
(
object
,
device
,
byte_code
,
byte_code_length
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -2139,7 +2139,7 @@ static ULONG STDMETHODCALLTYPE d3d11_class_linkage_Release(ID3D11ClassLinkage *i
ID3D11Device
*
device
=
class_linkage
->
device
;
wined3d_private_store_cleanup
(
&
class_linkage
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
class_linkage
);
heap_free
(
class_linkage
);
ID3D11Device_Release
(
device
);
}
...
...
@@ -2228,7 +2228,7 @@ HRESULT d3d11_class_linkage_create(struct d3d_device *device, struct d3d11_class
{
struct
d3d11_class_linkage
*
object
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
ID3D11ClassLinkage_iface
.
lpVtbl
=
&
d3d11_class_linkage_vtbl
;
...
...
dlls/d3d11/state.c
View file @
600d6b01
...
...
@@ -87,7 +87,7 @@ static ULONG STDMETHODCALLTYPE d3d11_blend_state_Release(ID3D11BlendState *iface
wine_rb_remove
(
&
device
->
blend_states
,
&
state
->
entry
);
d3d_blend_state_cleanup
(
state
);
wined3d_mutex_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
state
);
heap_free
(
state
);
}
return
refcount
;
...
...
@@ -357,7 +357,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
return
S_OK
;
}
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
{
wined3d_mutex_unlock
();
return
E_OUTOFMEMORY
;
...
...
@@ -366,7 +366,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
if
(
FAILED
(
hr
=
d3d_blend_state_init
(
object
,
device
,
&
tmp_desc
)))
{
WARN
(
"Failed to initialize blend state, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
wined3d_mutex_unlock
();
return
hr
;
}
...
...
@@ -375,7 +375,7 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
{
ERR
(
"Failed to insert blend state entry.
\n
"
);
d3d_blend_state_cleanup
(
object
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
wined3d_mutex_unlock
();
return
E_FAIL
;
}
...
...
@@ -467,7 +467,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_Release(ID3D11DepthStenc
wine_rb_remove
(
&
device
->
depthstencil_states
,
&
state
->
entry
);
d3d_depthstencil_state_cleanup
(
state
);
wined3d_mutex_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
state
);
heap_free
(
state
);
}
return
refcount
;
...
...
@@ -721,7 +721,7 @@ HRESULT d3d_depthstencil_state_create(struct d3d_device *device, const D3D11_DEP
return
S_OK
;
}
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
{
wined3d_mutex_unlock
();
return
E_OUTOFMEMORY
;
...
...
@@ -730,7 +730,7 @@ HRESULT d3d_depthstencil_state_create(struct d3d_device *device, const D3D11_DEP
if
(
FAILED
(
hr
=
d3d_depthstencil_state_init
(
object
,
device
,
&
tmp_desc
)))
{
WARN
(
"Failed to initialize depthstencil state, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
wined3d_mutex_unlock
();
return
hr
;
}
...
...
@@ -739,7 +739,7 @@ HRESULT d3d_depthstencil_state_create(struct d3d_device *device, const D3D11_DEP
{
ERR
(
"Failed to insert depthstencil state entry.
\n
"
);
d3d_depthstencil_state_cleanup
(
object
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
wined3d_mutex_unlock
();
return
E_FAIL
;
}
...
...
@@ -1025,7 +1025,7 @@ static void STDMETHODCALLTYPE d3d_rasterizer_state_wined3d_object_destroyed(void
wine_rb_remove
(
&
device
->
rasterizer_states
,
&
state
->
entry
);
wined3d_private_store_cleanup
(
&
state
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_rasterizer_state_wined3d_parent_ops
=
...
...
@@ -1093,7 +1093,7 @@ HRESULT d3d_rasterizer_state_create(struct d3d_device *device, const D3D11_RASTE
return
S_OK
;
}
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
{
wined3d_mutex_unlock
();
return
E_OUTOFMEMORY
;
...
...
@@ -1104,7 +1104,7 @@ HRESULT d3d_rasterizer_state_create(struct d3d_device *device, const D3D11_RASTE
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize rasterizer state, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -1388,7 +1388,7 @@ static void STDMETHODCALLTYPE d3d_sampler_wined3d_object_destroyed(void *parent)
wine_rb_remove
(
&
device
->
sampler_states
,
&
state
->
entry
);
wined3d_private_store_cleanup
(
&
state
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_sampler_wined3d_parent_ops
=
...
...
@@ -1518,7 +1518,7 @@ HRESULT d3d_sampler_state_create(struct d3d_device *device, const D3D11_SAMPLER_
return
S_OK
;
}
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
{
wined3d_mutex_unlock
();
return
E_OUTOFMEMORY
;
...
...
@@ -1529,7 +1529,7 @@ HRESULT d3d_sampler_state_create(struct d3d_device *device, const D3D11_SAMPLER_
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize sampler state, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
dlls/d3d11/texture.c
View file @
600d6b01
...
...
@@ -275,7 +275,7 @@ static void STDMETHODCALLTYPE d3d_texture2d_wined3d_object_released(void *parent
if
(
texture
->
dxgi_surface
)
IUnknown_Release
(
texture
->
dxgi_surface
);
wined3d_private_store_cleanup
(
&
texture
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
heap_free
(
texture
);
}
static
ULONG
STDMETHODCALLTYPE
d3d10_texture2d_Release
(
ID3D10Texture2D
*
iface
)
...
...
@@ -502,7 +502,7 @@ HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DE
return
E_INVALIDARG
;
}
if
(
!
(
texture
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
texture
))))
if
(
!
(
texture
=
heap_alloc_zero
(
sizeof
(
*
texture
))))
return
E_OUTOFMEMORY
;
texture
->
ID3D11Texture2D_iface
.
lpVtbl
=
&
d3d11_texture2d_vtbl
;
...
...
@@ -539,7 +539,7 @@ HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DE
{
WARN
(
"Failed to create wined3d texture, hr %#x.
\n
"
,
hr
);
wined3d_private_store_cleanup
(
&
texture
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
heap_free
(
texture
);
wined3d_mutex_unlock
();
if
(
hr
==
WINED3DERR_NOTAVAILABLE
||
hr
==
WINED3DERR_INVALIDCALL
)
hr
=
E_INVALIDARG
;
...
...
@@ -642,7 +642,7 @@ static void STDMETHODCALLTYPE d3d_texture3d_wined3d_object_released(void *parent
struct
d3d_texture3d
*
texture
=
parent
;
wined3d_private_store_cleanup
(
&
texture
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
ULONG
STDMETHODCALLTYPE
d3d11_texture3d_Release
(
ID3D11Texture3D
*
iface
)
...
...
@@ -1016,13 +1016,13 @@ HRESULT d3d_texture3d_create(struct d3d_device *device, const D3D11_TEXTURE3D_DE
struct
d3d_texture3d
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_texture3d_init
(
object
,
device
,
desc
,
data
)))
{
WARN
(
"Failed to initialize texture, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
dlls/d3d11/view.c
View file @
600d6b01
...
...
@@ -1244,7 +1244,7 @@ static void STDMETHODCALLTYPE d3d_depth_stencil_view_wined3d_object_destroyed(vo
struct
d3d_depthstencil_view
*
view
=
parent
;
wined3d_private_store_cleanup
(
&
view
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_depth_stencil_view_wined3d_parent_ops
=
...
...
@@ -1367,13 +1367,13 @@ HRESULT d3d_depthstencil_view_create(struct d3d_device *device, ID3D11Resource *
struct
d3d_depthstencil_view
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_depthstencil_view_init
(
object
,
device
,
resource
,
desc
)))
{
WARN
(
"Failed to initialize depthstencil view, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -1684,7 +1684,7 @@ static void STDMETHODCALLTYPE d3d_render_target_view_wined3d_object_destroyed(vo
struct
d3d_rendertarget_view
*
view
=
parent
;
wined3d_private_store_cleanup
(
&
view
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_render_target_view_wined3d_parent_ops
=
...
...
@@ -1815,13 +1815,13 @@ HRESULT d3d_rendertarget_view_create(struct d3d_device *device, ID3D11Resource *
struct
d3d_rendertarget_view
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_rendertarget_view_init
(
object
,
device
,
resource
,
desc
)))
{
WARN
(
"Failed to initialize rendertarget view, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -2146,7 +2146,7 @@ static void STDMETHODCALLTYPE d3d_shader_resource_view_wined3d_object_destroyed(
struct
d3d_shader_resource_view
*
view
=
parent
;
wined3d_private_store_cleanup
(
&
view
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d_shader_resource_view_wined3d_parent_ops
=
...
...
@@ -2316,13 +2316,13 @@ HRESULT d3d_shader_resource_view_create(struct d3d_device *device, ID3D11Resourc
struct
d3d_shader_resource_view
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_shader_resource_view_init
(
object
,
device
,
resource
,
desc
)))
{
WARN
(
"Failed to initialize shader resource view, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -2496,7 +2496,7 @@ static void STDMETHODCALLTYPE d3d11_unordered_access_view_wined3d_object_destroy
struct
d3d11_unordered_access_view
*
view
=
parent
;
wined3d_private_store_cleanup
(
&
view
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
heap_free
(
parent
);
}
static
const
struct
wined3d_parent_ops
d3d11_unordered_access_view_wined3d_parent_ops
=
...
...
@@ -2625,13 +2625,13 @@ HRESULT d3d11_unordered_access_view_create(struct d3d_device *device, ID3D11Reso
struct
d3d11_unordered_access_view
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d11_unordered_access_view_init
(
object
,
device
,
resource
,
desc
)))
{
WARN
(
"Failed to initialize unordered access view, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
heap_free
(
object
);
return
hr
;
}
...
...
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