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
f2d17347
Commit
f2d17347
authored
Oct 29, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Oct 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11/tests: Use CRT allocation functions.
parent
b99ea513
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
d3d11.c
dlls/d3d11/tests/d3d11.c
+17
-18
No files found.
dlls/d3d11/tests/d3d11.c
View file @
f2d17347
...
...
@@ -26,7 +26,6 @@
#include "initguid.h"
#include "d3d11_4.h"
#include "winternl.h"
#include "wine/heap.h"
#include "wine/wined3d.h"
#include "wine/test.h"
...
...
@@ -135,7 +134,7 @@ static void queue_test_entry(const struct test_entry *t)
if
(
mt_test_count
>=
mt_tests_size
)
{
mt_tests_size
=
max
(
16
,
mt_tests_size
*
2
);
mt_tests
=
heap_
realloc
(
mt_tests
,
mt_tests_size
*
sizeof
(
*
t
));
mt_tests
=
realloc
(
mt_tests
,
mt_tests_size
*
sizeof
(
*
t
));
}
mt_tests
[
mt_test_count
++
]
=
*
t
;
}
...
...
@@ -205,7 +204,7 @@ static void run_queued_tests(void)
GetSystemInfo
(
&
si
);
thread_count
=
si
.
dwNumberOfProcessors
;
threads
=
heap_
calloc
(
thread_count
,
sizeof
(
*
threads
));
threads
=
calloc
(
thread_count
,
sizeof
(
*
threads
));
for
(
i
=
0
,
test_idx
=
0
;
i
<
thread_count
;
++
i
)
{
threads
[
i
]
=
CreateThread
(
NULL
,
0
,
thread_func
,
&
test_idx
,
0
,
NULL
);
...
...
@@ -216,7 +215,7 @@ static void run_queued_tests(void)
{
CloseHandle
(
threads
[
i
]);
}
heap_
free
(
threads
);
free
(
threads
);
}
static
void
set_box
(
D3D11_BOX
*
box
,
UINT
left
,
UINT
top
,
UINT
front
,
UINT
right
,
UINT
bottom
,
UINT
back
)
...
...
@@ -11473,7 +11472,7 @@ static void test_render_target_views(void)
texture_desc
.
CPUAccessFlags
=
0
;
texture_desc
.
MiscFlags
=
0
;
data
=
heap_alloc_zero
(
texture_desc
.
Width
*
texture_desc
.
Height
*
4
);
data
=
calloc
(
texture_desc
.
Width
*
texture_desc
.
Height
,
4
);
ok
(
!!
data
,
"Failed to allocate memory.
\n
"
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
++
i
)
...
...
@@ -11557,7 +11556,7 @@ static void test_render_target_views(void)
ID3D11Resource_Release
(
resource
);
}
heap_
free
(
data
);
free
(
data
);
release_test_context
(
&
test_context
);
}
...
...
@@ -15403,7 +15402,7 @@ static void test_resource_access(const D3D_FEATURE_LEVEL feature_level)
data
.
SysMemPitch
=
0
;
data
.
SysMemSlicePitch
=
0
;
data
.
pSysMem
=
heap_
alloc
(
10240
);
data
.
pSysMem
=
m
alloc
(
10240
);
ok
(
!!
data
.
pSysMem
,
"Failed to allocate memory.
\n
"
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
++
i
)
...
...
@@ -15588,7 +15587,7 @@ static void test_resource_access(const D3D_FEATURE_LEVEL feature_level)
}
}
heap_
free
((
void
*
)
data
.
pSysMem
);
free
((
void
*
)
data
.
pSysMem
);
ID3D11DeviceContext_Release
(
context
);
refcount
=
ID3D11Device_Release
(
device
);
...
...
@@ -24691,7 +24690,7 @@ static void test_buffer_srv(void)
resource_data
.
SysMemSlicePitch
=
0
;
if
(
current_buffer
->
data_offset
)
{
data
=
heap_alloc_zero
(
current_buffer
->
byte_count
);
data
=
calloc
(
1
,
current_buffer
->
byte_count
);
ok
(
!!
data
,
"Failed to allocate memory.
\n
"
);
memcpy
(
data
+
current_buffer
->
data_offset
,
current_buffer
->
data
,
current_buffer
->
byte_count
-
current_buffer
->
data_offset
);
...
...
@@ -24703,7 +24702,7 @@ static void test_buffer_srv(void)
}
hr
=
ID3D11Device_CreateBuffer
(
device
,
&
buffer_desc
,
&
resource_data
,
&
buffer
);
ok
(
hr
==
S_OK
,
"Test %u: Got unexpected hr %#lx.
\n
"
,
i
,
hr
);
heap_
free
(
data
);
free
(
data
);
}
else
{
...
...
@@ -28460,7 +28459,7 @@ static void test_depth_bias(void)
rasterizer_desc
.
SlopeScaledDepthBias
=
0
.
0
f
;
rasterizer_desc
.
DepthClipEnable
=
TRUE
;
depth_values
=
heap_
calloc
(
swapchain_desc
.
height
,
sizeof
(
*
depth_values
));
depth_values
=
calloc
(
swapchain_desc
.
height
,
sizeof
(
*
depth_values
));
ok
(
!!
depth_values
,
"Failed to allocate memory.
\n
"
);
for
(
format_idx
=
0
;
format_idx
<
ARRAY_SIZE
(
formats
);
++
format_idx
)
...
...
@@ -28669,7 +28668,7 @@ static void test_depth_bias(void)
winetest_pop_context
();
}
heap_
free
(
depth_values
);
free
(
depth_values
);
release_test_context
(
&
test_context
);
}
...
...
@@ -30430,7 +30429,7 @@ static void test_generate_mips(void)
device
=
test_context
.
device
;
context
=
test_context
.
immediate_context
;
data
=
heap_
alloc
(
sizeof
(
*
data
)
*
32
*
32
*
32
);
data
=
m
alloc
(
sizeof
(
*
data
)
*
32
*
32
*
32
);
for
(
z
=
0
;
z
<
32
;
++
z
)
{
...
...
@@ -30457,7 +30456,7 @@ static void test_generate_mips(void)
}
}
zero_data
=
heap_alloc_zero
(
sizeof
(
*
zero_data
)
*
16
*
16
*
16
);
zero_data
=
calloc
(
16
*
16
*
16
,
sizeof
(
*
zero_data
)
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
resource_types
);
++
i
)
{
...
...
@@ -30659,8 +30658,8 @@ static void test_generate_mips(void)
ID3D11Resource_Release
(
resource
);
heap_
free
(
zero_data
);
heap_
free
(
data
);
free
(
zero_data
);
free
(
data
);
release_test_context
(
&
test_context
);
}
...
...
@@ -33987,7 +33986,7 @@ static void test_texture_compressed_3d(void)
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
/* Simply test all combinations of r0 and r1. */
texture_data
=
heap_
alloc
(
256
*
256
*
sizeof
(
UINT64
));
texture_data
=
m
alloc
(
256
*
256
*
sizeof
(
UINT64
));
for
(
r1
=
0
;
r1
<
256
;
++
r1
)
{
for
(
r0
=
0
;
r0
<
256
;
++
r0
)
...
...
@@ -34012,7 +34011,7 @@ static void test_texture_compressed_3d(void)
texture_desc
.
MiscFlags
=
0
;
hr
=
ID3D11Device_CreateTexture3D
(
device
,
&
texture_desc
,
&
resource_data
,
&
texture
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
heap_
free
(
texture_data
);
free
(
texture_data
);
hr
=
ID3D11Device_CreateShaderResourceView
(
device
,
(
ID3D11Resource
*
)
texture
,
NULL
,
&
srv
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
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