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
bf8171a3
Commit
bf8171a3
authored
Jun 08, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11/tests: Add some tests for IDXGIResource support.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
76a0108c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
2 deletions
+91
-2
d3d11.c
dlls/d3d11/tests/d3d11.c
+91
-2
No files found.
dlls/d3d11/tests/d3d11.c
View file @
bf8171a3
...
@@ -2499,6 +2499,63 @@ static void test_create_texture1d(void)
...
@@ -2499,6 +2499,63 @@ static void test_create_texture1d(void)
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
}
}
#define test_dxgi_resource(a) test_dxgi_resource_(__LINE__, a)
static
void
test_dxgi_resource_
(
unsigned
int
line
,
void
*
iface
)
{
IDXGIResource
*
resource
,
*
resource2
;
IDXGISurface
*
surface
,
*
surface2
;
IUnknown
*
object
=
iface
,
*
unk
;
DWORD
data
;
HRESULT
hr
;
UINT
size
;
hr
=
IUnknown_QueryInterface
(
object
,
&
IID_IDXGIResource
,
(
void
**
)
&
resource
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
if
(
SUCCEEDED
(
IUnknown_QueryInterface
(
object
,
&
IID_IDXGISurface
,
(
void
**
)
&
surface
)))
{
hr
=
IDXGISurface_QueryInterface
(
surface
,
&
IID_IDXGIDeviceSubObject
,
(
void
**
)
&
unk
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)((
IUnknown
*
)
resource
==
unk
,
"Unexpected interface pointer.
\n
"
);
IUnknown_Release
(
unk
);
hr
=
IDXGISurface_QueryInterface
(
surface
,
&
IID_IDXGIObject
,
(
void
**
)
&
unk
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)((
IUnknown
*
)
resource
==
unk
,
"Unexpected interface pointer.
\n
"
);
IUnknown_Release
(
unk
);
hr
=
IDXGISurface_QueryInterface
(
surface
,
&
IID_IDXGIResource
,
(
void
**
)
&
resource2
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
resource2
==
resource
,
"Unexpected resource pointer.
\n
"
);
IDXGIResource_Release
(
resource2
);
hr
=
IDXGIResource_QueryInterface
(
resource
,
&
IID_IDXGISurface
,
(
void
**
)
&
surface2
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
surface2
==
surface
,
"Unexpected surface pointer.
\n
"
);
IDXGISurface_Release
(
surface2
);
hr
=
IDXGISurface_GetParent
(
surface
,
&
IID_IDXGIResource
,
(
void
**
)
&
resource2
);
ok_
(
__FILE__
,
line
)(
hr
==
E_NOINTERFACE
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDXGIResource_GetParent
(
resource
,
&
IID_IDXGISurface
,
(
void
**
)
&
surface2
);
ok_
(
__FILE__
,
line
)(
hr
==
E_NOINTERFACE
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
data
=
123
;
hr
=
IDXGIResource_SetPrivateData
(
resource
,
&
IID_IUnknown
,
sizeof
(
data
),
&
data
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
size
=
sizeof
(
data
);
data
=
0
;
hr
=
IDXGISurface_GetPrivateData
(
surface
,
&
IID_IUnknown
,
&
size
,
&
data
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
data
==
123
,
"Unexpected data %#lx.
\n
"
,
data
);
IDXGISurface_Release
(
surface
);
}
IDXGIResource_Release
(
resource
);
}
static
void
test_texture1d_interfaces
(
void
)
static
void
test_texture1d_interfaces
(
void
)
{
{
ID3D10Texture1D
*
d3d10_texture
;
ID3D10Texture1D
*
d3d10_texture
;
...
@@ -2548,7 +2605,7 @@ static void test_texture1d_interfaces(void)
...
@@ -2548,7 +2605,7 @@ static void test_texture1d_interfaces(void)
}
}
desc
.
Width
=
512
;
desc
.
Width
=
512
;
desc
.
MipLevels
=
0
;
desc
.
MipLevels
=
1
;
desc
.
ArraySize
=
1
;
desc
.
ArraySize
=
1
;
desc
.
Format
=
DXGI_FORMAT_R8G8B8A8_UNORM
;
desc
.
Format
=
DXGI_FORMAT_R8G8B8A8_UNORM
;
desc
.
Usage
=
D3D11_USAGE_DEFAULT
;
desc
.
Usage
=
D3D11_USAGE_DEFAULT
;
...
@@ -2558,7 +2615,18 @@ static void test_texture1d_interfaces(void)
...
@@ -2558,7 +2615,18 @@ static void test_texture1d_interfaces(void)
hr
=
ID3D11Device_CreateTexture1D
(
device
,
&
desc
,
NULL
,
&
texture
);
hr
=
ID3D11Device_CreateTexture1D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
test_dxgi_resource
(
texture
);
ID3D11Texture1D_Release
(
texture
);
desc
.
MipLevels
=
0
;
hr
=
ID3D11Device_CreateTexture1D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
test_dxgi_resource
(
texture
);
check_interface
(
texture
,
&
IID_IDXGISurface
,
FALSE
,
FALSE
);
check_interface
(
texture
,
&
IID_IDXGISurface
,
FALSE
,
FALSE
);
todo_wine
check_interface
(
texture
,
&
IID_IDXGIResource
,
TRUE
,
FALSE
);
hr
=
check_interface
(
texture
,
&
IID_ID3D10Texture1D
,
TRUE
,
TRUE
);
/* Not available on all Windows versions. */
hr
=
check_interface
(
texture
,
&
IID_ID3D10Texture1D
,
TRUE
,
TRUE
);
/* Not available on all Windows versions. */
ID3D11Texture1D_Release
(
texture
);
ID3D11Texture1D_Release
(
texture
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
...
@@ -2934,7 +3002,7 @@ static void test_texture2d_interfaces(void)
...
@@ -2934,7 +3002,7 @@ static void test_texture2d_interfaces(void)
desc
.
Width
=
512
;
desc
.
Width
=
512
;
desc
.
Height
=
512
;
desc
.
Height
=
512
;
desc
.
MipLevels
=
0
;
desc
.
MipLevels
=
1
;
desc
.
ArraySize
=
1
;
desc
.
ArraySize
=
1
;
desc
.
Format
=
DXGI_FORMAT_R8G8B8A8_UNORM
;
desc
.
Format
=
DXGI_FORMAT_R8G8B8A8_UNORM
;
desc
.
SampleDesc
.
Count
=
1
;
desc
.
SampleDesc
.
Count
=
1
;
...
@@ -2946,7 +3014,21 @@ static void test_texture2d_interfaces(void)
...
@@ -2946,7 +3014,21 @@ static void test_texture2d_interfaces(void)
hr
=
ID3D11Device_CreateTexture2D
(
device
,
&
desc
,
NULL
,
&
texture
);
hr
=
ID3D11Device_CreateTexture2D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
check_interface
(
texture
,
&
IID_IDXGISurface
,
TRUE
,
FALSE
);
todo_wine
check_interface
(
texture
,
&
IID_IDXGIResource
,
TRUE
,
FALSE
);
todo_wine
test_dxgi_resource
(
texture
);
ID3D11Texture2D_Release
(
texture
);
desc
.
MipLevels
=
0
;
hr
=
ID3D11Device_CreateTexture2D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
check_interface
(
texture
,
&
IID_IDXGISurface
,
FALSE
,
FALSE
);
check_interface
(
texture
,
&
IID_IDXGISurface
,
FALSE
,
FALSE
);
todo_wine
check_interface
(
texture
,
&
IID_IDXGIResource
,
TRUE
,
FALSE
);
todo_wine
test_dxgi_resource
(
texture
);
hr
=
check_interface
(
texture
,
&
IID_ID3D10Texture2D
,
TRUE
,
TRUE
);
/* Not available on all Windows versions. */
hr
=
check_interface
(
texture
,
&
IID_ID3D10Texture2D
,
TRUE
,
TRUE
);
/* Not available on all Windows versions. */
ID3D11Texture2D_Release
(
texture
);
ID3D11Texture2D_Release
(
texture
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
...
@@ -3211,6 +3293,10 @@ static void test_texture3d_interfaces(void)
...
@@ -3211,6 +3293,10 @@ static void test_texture3d_interfaces(void)
hr
=
ID3D11Device_CreateTexture3D
(
device
,
&
desc
,
NULL
,
&
texture
);
hr
=
ID3D11Device_CreateTexture3D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
check_interface
(
texture
,
&
IID_IDXGISurface
,
FALSE
,
FALSE
);
check_interface
(
texture
,
&
IID_IDXGISurface
,
FALSE
,
FALSE
);
todo_wine
check_interface
(
texture
,
&
IID_IDXGIResource
,
TRUE
,
FALSE
);
todo_wine
test_dxgi_resource
(
texture
);
hr
=
check_interface
(
texture
,
&
IID_ID3D10Texture3D
,
TRUE
,
TRUE
);
/* Not available on all Windows versions. */
hr
=
check_interface
(
texture
,
&
IID_ID3D10Texture3D
,
TRUE
,
TRUE
);
/* Not available on all Windows versions. */
ID3D11Texture3D_Release
(
texture
);
ID3D11Texture3D_Release
(
texture
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
...
@@ -3526,6 +3612,9 @@ static void test_create_buffer(void)
...
@@ -3526,6 +3612,9 @@ static void test_create_buffer(void)
continue
;
continue
;
}
}
todo_wine
check_interface
(
buffer
,
&
IID_IDXGIResource
,
TRUE
,
FALSE
);
if
(
!
(
desc
.
MiscFlags
&
D3D11_RESOURCE_MISC_BUFFER_STRUCTURED
))
if
(
!
(
desc
.
MiscFlags
&
D3D11_RESOURCE_MISC_BUFFER_STRUCTURED
))
desc
.
StructureByteStride
=
0
;
desc
.
StructureByteStride
=
0
;
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