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
e0e72d28
Commit
e0e72d28
authored
Aug 30, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Aug 31, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Implement d3d11_device_CreateTexture2D().
parent
a24ff273
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
17 deletions
+38
-17
d3d11_private.h
dlls/d3d11/d3d11_private.h
+2
-2
device.c
dlls/d3d11/device.c
+12
-13
texture.c
dlls/d3d11/texture.c
+24
-2
No files found.
dlls/d3d11/d3d11_private.h
View file @
e0e72d28
...
...
@@ -112,8 +112,8 @@ static inline struct d3d10_texture2d *impl_from_ID3D10Texture2D(ID3D10Texture2D
return
CONTAINING_RECORD
(
iface
,
struct
d3d10_texture2d
,
ID3D10Texture2D_iface
);
}
HRESULT
d3d
10_texture2d_init
(
struct
d3d10_texture2d
*
texture
,
struct
d3d_device
*
device
,
const
D3D11_
TEXTURE2D_DESC
*
desc
,
const
D3D10_SUBRESOURCE_DATA
*
initial_data
)
DECLSPEC_HIDDEN
;
HRESULT
d3d
_texture2d_create
(
struct
d3d_device
*
device
,
const
D3D11_TEXTURE2D_DESC
*
desc
,
const
D3D11_
SUBRESOURCE_DATA
*
data
,
struct
d3d10_texture2d
**
texture
)
DECLSPEC_HIDDEN
;
struct
d3d10_texture2d
*
unsafe_impl_from_ID3D10Texture2D
(
ID3D10Texture2D
*
iface
)
DECLSPEC_HIDDEN
;
/* ID3D10Texture3D */
...
...
dlls/d3d11/device.c
View file @
e0e72d28
...
...
@@ -75,9 +75,18 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture1D(ID3D11Device *ifac
static
HRESULT
STDMETHODCALLTYPE
d3d11_device_CreateTexture2D
(
ID3D11Device
*
iface
,
const
D3D11_TEXTURE2D_DESC
*
desc
,
const
D3D11_SUBRESOURCE_DATA
*
data
,
ID3D11Texture2D
**
texture
)
{
FIXME
(
"iface %p, desc %p, data %p, texture %p stub!
\n
"
,
iface
,
desc
,
data
,
texture
);
struct
d3d_device
*
device
=
impl_from_ID3D11Device
(
iface
);
struct
d3d10_texture2d
*
object
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"iface %p, desc %p, data %p, texture %p.
\n
"
,
iface
,
desc
,
data
,
texture
);
if
(
FAILED
(
hr
=
d3d_texture2d_create
(
device
,
desc
,
data
,
&
object
)))
return
hr
;
*
texture
=
&
object
->
ID3D11Texture2D_iface
;
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_device_CreateTexture3D
(
ID3D11Device
*
iface
,
...
...
@@ -2011,10 +2020,6 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device1 *ifa
TRACE
(
"iface %p, desc %p, data %p, texture %p.
\n
"
,
iface
,
desc
,
data
,
texture
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
d3d11_desc
.
Width
=
desc
->
Width
;
d3d11_desc
.
Height
=
desc
->
Height
;
d3d11_desc
.
MipLevels
=
desc
->
MipLevels
;
...
...
@@ -2026,17 +2031,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device1 *ifa
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
=
d3d10_texture2d_init
(
object
,
device
,
&
d3d11_desc
,
data
)))
{
WARN
(
"Failed to initialize texture, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
if
(
FAILED
(
hr
=
d3d_texture2d_create
(
device
,
&
d3d11_desc
,
(
const
D3D11_SUBRESOURCE_DATA
*
)
data
,
&
object
)))
return
hr
;
}
*
texture
=
&
object
->
ID3D10Texture2D_iface
;
TRACE
(
"Created ID3D10Texture2D %p
\n
"
,
object
);
return
S_OK
;
}
...
...
dlls/d3d11/texture.c
View file @
e0e72d28
...
...
@@ -444,8 +444,8 @@ static const struct wined3d_parent_ops d3d10_texture2d_wined3d_parent_ops =
d3d10_texture2d_wined3d_object_released
,
};
HRESULT
d3d10
_texture2d_init
(
struct
d3d10_texture2d
*
texture
,
struct
d3d_device
*
device
,
const
D3D11_TEXTURE2D_DESC
*
desc
,
const
D3D1
0
_SUBRESOURCE_DATA
*
data
)
static
HRESULT
d3d
_texture2d_init
(
struct
d3d10_texture2d
*
texture
,
struct
d3d_device
*
device
,
const
D3D11_TEXTURE2D_DESC
*
desc
,
const
D3D1
1
_SUBRESOURCE_DATA
*
data
)
{
struct
wined3d_resource_desc
wined3d_desc
;
unsigned
int
levels
;
...
...
@@ -520,6 +520,28 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d_device
return
S_OK
;
}
HRESULT
d3d_texture2d_create
(
struct
d3d_device
*
device
,
const
D3D11_TEXTURE2D_DESC
*
desc
,
const
D3D11_SUBRESOURCE_DATA
*
data
,
struct
d3d10_texture2d
**
texture
)
{
struct
d3d10_texture2d
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_texture2d_init
(
object
,
device
,
desc
,
data
)))
{
WARN
(
"Failed to initialize texture, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created texture %p.
\n
"
,
object
);
*
texture
=
object
;
return
S_OK
;
}
static
inline
struct
d3d10_texture3d
*
impl_from_ID3D10Texture3D
(
ID3D10Texture3D
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d3d10_texture3d
,
ID3D10Texture3D_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