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
63aae387
Commit
63aae387
authored
Apr 03, 2018
by
Sven Hesse
Committed by
Alexandre Julliard
Apr 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Implement d3d10_device_CreateTexture1D().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f3840daf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
2 deletions
+103
-2
device.c
dlls/d3d10core/tests/device.c
+82
-0
device.c
dlls/d3d11/device.c
+21
-2
No files found.
dlls/d3d10core/tests/device.c
View file @
63aae387
...
...
@@ -1310,6 +1310,87 @@ static void test_device_interfaces(void)
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
static
void
test_create_texture1d
(
void
)
{
ULONG
refcount
,
expected_refcount
;
ID3D10Device
*
device
,
*
tmp
;
D3D10_TEXTURE1D_DESC
desc
;
ID3D10Texture1D
*
texture
;
unsigned
int
i
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
{
skip
(
"Failed to create device.
\n
"
);
return
;
}
desc
.
Width
=
512
;
desc
.
MipLevels
=
1
;
desc
.
ArraySize
=
1
;
desc
.
Format
=
DXGI_FORMAT_R8G8B8A8_UNORM
;
desc
.
Usage
=
D3D10_USAGE_DEFAULT
;
desc
.
BindFlags
=
D3D10_BIND_SHADER_RESOURCE
;
desc
.
CPUAccessFlags
=
0
;
desc
.
MiscFlags
=
0
;
expected_refcount
=
get_refcount
(
device
)
+
1
;
hr
=
ID3D10Device_CreateTexture1D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a 1d texture, hr %#x.
\n
"
,
hr
);
refcount
=
get_refcount
(
device
);
ok
(
refcount
>=
expected_refcount
,
"Got unexpected refcount %u, expected >= %u.
\n
"
,
refcount
,
expected_refcount
);
tmp
=
NULL
;
expected_refcount
=
refcount
+
1
;
ID3D10Texture1D_GetDevice
(
texture
,
&
tmp
);
ok
(
tmp
==
device
,
"Got unexpected device %p, expected %p.
\n
"
,
tmp
,
device
);
refcount
=
get_refcount
(
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ID3D10Device_Release
(
tmp
);
ID3D10Texture1D_Release
(
texture
);
desc
.
MipLevels
=
0
;
expected_refcount
=
get_refcount
(
device
)
+
1
;
hr
=
ID3D10Device_CreateTexture1D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a 1d texture, hr %#x.
\n
"
,
hr
);
refcount
=
get_refcount
(
device
);
ok
(
refcount
>=
expected_refcount
,
"Got unexpected refcount %u, expected >= %u.
\n
"
,
refcount
,
expected_refcount
);
tmp
=
NULL
;
expected_refcount
=
refcount
+
1
;
ID3D10Texture1D_GetDevice
(
texture
,
&
tmp
);
ok
(
tmp
==
device
,
"Got unexpected device %p, expected %p.
\n
"
,
tmp
,
device
);
refcount
=
get_refcount
(
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ID3D10Device_Release
(
tmp
);
check_interface
(
texture
,
&
IID_IDXGISurface
,
FALSE
,
FALSE
);
ID3D10Texture1D_Release
(
texture
);
desc
.
MipLevels
=
1
;
desc
.
ArraySize
=
2
;
hr
=
ID3D10Device_CreateTexture1D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a 1d texture, hr %#x.
\n
"
,
hr
);
check_interface
(
texture
,
&
IID_IDXGISurface
,
FALSE
,
FALSE
);
ID3D10Texture1D_Release
(
texture
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
desc
.
ArraySize
=
i
;
desc
.
Format
=
DXGI_FORMAT_R32G32B32A32_TYPELESS
;
desc
.
BindFlags
=
D3D10_BIND_SHADER_RESOURCE
;
desc
.
MiscFlags
=
0
;
hr
=
ID3D10Device_CreateTexture1D
(
device
,
&
desc
,
NULL
,
(
ID3D10Texture1D
**
)
&
texture
);
todo_wine_if
(
!
i
)
ok
(
hr
==
(
i
?
S_OK
:
E_INVALIDARG
),
"Test %u: Got unexpected hr %#x.
\n
"
,
i
,
hr
);
if
(
SUCCEEDED
(
hr
))
ID3D10Texture1D_Release
(
texture
);
}
refcount
=
ID3D10Device_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
}
static
void
test_create_texture2d
(
void
)
{
ULONG
refcount
,
expected_refcount
;
...
...
@@ -14935,6 +15016,7 @@ START_TEST(device)
test_feature_level
();
test_device_interfaces
();
test_create_texture1d
();
test_create_texture2d
();
test_texture2d_interfaces
();
test_create_texture3d
();
...
...
dlls/d3d11/device.c
View file @
63aae387
...
...
@@ -4995,9 +4995,28 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device1 *iface,
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_CreateTexture1D
(
ID3D10Device1
*
iface
,
const
D3D10_TEXTURE1D_DESC
*
desc
,
const
D3D10_SUBRESOURCE_DATA
*
data
,
ID3D10Texture1D
**
texture
)
{
FIXME
(
"iface %p, desc %p, data %p, texture %p stub!
\n
"
,
iface
,
desc
,
data
,
texture
);
struct
d3d_device
*
device
=
impl_from_ID3D10Device
(
iface
);
D3D11_TEXTURE1D_DESC
d3d11_desc
;
struct
d3d_texture1d
*
object
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"iface %p, desc %p, data %p, texture %p.
\n
"
,
iface
,
desc
,
data
,
texture
);
d3d11_desc
.
Width
=
desc
->
Width
;
d3d11_desc
.
MipLevels
=
desc
->
MipLevels
;
d3d11_desc
.
ArraySize
=
desc
->
ArraySize
;
d3d11_desc
.
Format
=
desc
->
Format
;
d3d11_desc
.
Usage
=
d3d11_usage_from_d3d10_usage
(
desc
->
Usage
);
d3d11_desc
.
BindFlags
=
d3d11_bind_flags_from_d3d10_bind_flags
(
desc
->
BindFlags
);
d3d11_desc
.
CPUAccessFlags
=
d3d11_cpu_access_flags_from_d3d10_cpu_access_flags
(
desc
->
CPUAccessFlags
);
d3d11_desc
.
MiscFlags
=
d3d11_resource_misc_flags_from_d3d10_resource_misc_flags
(
desc
->
MiscFlags
);
if
(
FAILED
(
hr
=
d3d_texture1d_create
(
device
,
&
d3d11_desc
,
(
const
D3D11_SUBRESOURCE_DATA
*
)
data
,
&
object
)))
return
hr
;
*
texture
=
&
object
->
ID3D10Texture1D_iface
;
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_CreateTexture2D
(
ID3D10Device1
*
iface
,
...
...
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