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
57b196b2
Commit
57b196b2
authored
Sep 11, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Add a separate function for d3d10_texture2d initialization.
parent
9ed19bc6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
41 deletions
+56
-41
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+3
-1
device.c
dlls/d3d10core/device.c
+5
-39
texture2d.c
dlls/d3d10core/texture2d.c
+48
-1
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
57b196b2
...
...
@@ -82,7 +82,6 @@ struct d3d10_device
};
/* ID3D10Texture2D */
extern
const
struct
ID3D10Texture2DVtbl
d3d10_texture2d_vtbl
;
struct
d3d10_texture2d
{
const
struct
ID3D10Texture2DVtbl
*
vtbl
;
...
...
@@ -93,6 +92,9 @@ struct d3d10_texture2d
D3D10_TEXTURE2D_DESC
desc
;
};
HRESULT
d3d10_texture2d_init
(
struct
d3d10_texture2d
*
texture
,
struct
d3d10_device
*
device
,
const
D3D10_TEXTURE2D_DESC
*
desc
);
/* ID3D10Buffer */
extern
const
struct
ID3D10BufferVtbl
d3d10_buffer_vtbl
;
struct
d3d10_buffer
...
...
dlls/d3d10core/device.c
View file @
57b196b2
...
...
@@ -682,46 +682,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device *ifac
return
E_OUTOFMEMORY
;
}
object
->
vtbl
=
&
d3d10_texture2d_vtbl
;
object
->
refcount
=
1
;
object
->
desc
=
*
desc
;
if
(
desc
->
MipLevels
==
1
&&
desc
->
ArraySize
==
1
)
hr
=
d3d10_texture2d_init
(
object
,
This
,
desc
);
if
(
FAILED
(
hr
))
{
IWineDXGIDevice
*
wine_device
;
hr
=
ID3D10Device_QueryInterface
(
iface
,
&
IID_IWineDXGIDevice
,
(
void
**
)
&
wine_device
);
if
(
FAILED
(
hr
))
{
ERR
(
"Device should implement IWineDXGIDevice
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
E_FAIL
;
}
hr
=
IWineDXGIDevice_create_surface
(
wine_device
,
NULL
,
0
,
NULL
,
(
IUnknown
*
)
object
,
(
void
**
)
&
object
->
dxgi_surface
);
IWineDXGIDevice_Release
(
wine_device
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to create DXGI surface, returning %#x
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
FIXME
(
"Implement DXGI<->wined3d usage conversion
\n
"
);
hr
=
IWineD3DDevice_CreateSurface
(
This
->
wined3d_device
,
desc
->
Width
,
desc
->
Height
,
wined3dformat_from_dxgi_format
(
desc
->
Format
),
FALSE
,
FALSE
,
0
,
&
object
->
wined3d_surface
,
desc
->
Usage
,
WINED3DPOOL_DEFAULT
,
desc
->
SampleDesc
.
Count
>
1
?
desc
->
SampleDesc
.
Count
:
WINED3DMULTISAMPLE_NONE
,
desc
->
SampleDesc
.
Quality
,
SURFACE_OPENGL
,
(
IUnknown
*
)
object
);
if
(
FAILED
(
hr
))
{
ERR
(
"CreateSurface failed, returning %#x
\n
"
,
hr
);
IDXGISurface_Release
(
object
->
dxgi_surface
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
WARN
(
"Failed to initialize texture, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
*
texture
=
(
ID3D10Texture2D
*
)
object
;
...
...
dlls/d3d10core/texture2d.c
View file @
57b196b2
...
...
@@ -161,7 +161,7 @@ static void STDMETHODCALLTYPE d3d10_texture2d_GetDesc(ID3D10Texture2D *iface, D3
*
desc
=
This
->
desc
;
}
const
struct
ID3D10Texture2DVtbl
d3d10_texture2d_vtbl
=
static
const
struct
ID3D10Texture2DVtbl
d3d10_texture2d_vtbl
=
{
/* IUnknown methods */
d3d10_texture2d_QueryInterface
,
...
...
@@ -181,3 +181,50 @@ const struct ID3D10Texture2DVtbl d3d10_texture2d_vtbl =
d3d10_texture2d_Unmap
,
d3d10_texture2d_GetDesc
,
};
HRESULT
d3d10_texture2d_init
(
struct
d3d10_texture2d
*
texture
,
struct
d3d10_device
*
device
,
const
D3D10_TEXTURE2D_DESC
*
desc
)
{
HRESULT
hr
;
texture
->
vtbl
=
&
d3d10_texture2d_vtbl
;
texture
->
refcount
=
1
;
texture
->
desc
=
*
desc
;
if
(
desc
->
MipLevels
==
1
&&
desc
->
ArraySize
==
1
)
{
IWineDXGIDevice
*
wine_device
;
hr
=
ID3D10Device_QueryInterface
((
ID3D10Device
*
)
device
,
&
IID_IWineDXGIDevice
,
(
void
**
)
&
wine_device
);
if
(
FAILED
(
hr
))
{
ERR
(
"Device should implement IWineDXGIDevice
\n
"
);
return
E_FAIL
;
}
hr
=
IWineDXGIDevice_create_surface
(
wine_device
,
NULL
,
0
,
NULL
,
(
IUnknown
*
)
texture
,
(
void
**
)
&
texture
->
dxgi_surface
);
IWineDXGIDevice_Release
(
wine_device
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to create DXGI surface, returning %#x
\n
"
,
hr
);
return
hr
;
}
FIXME
(
"Implement DXGI<->wined3d usage conversion
\n
"
);
hr
=
IWineD3DDevice_CreateSurface
(
device
->
wined3d_device
,
desc
->
Width
,
desc
->
Height
,
wined3dformat_from_dxgi_format
(
desc
->
Format
),
FALSE
,
FALSE
,
0
,
&
texture
->
wined3d_surface
,
desc
->
Usage
,
WINED3DPOOL_DEFAULT
,
desc
->
SampleDesc
.
Count
>
1
?
desc
->
SampleDesc
.
Count
:
WINED3DMULTISAMPLE_NONE
,
desc
->
SampleDesc
.
Quality
,
SURFACE_OPENGL
,
(
IUnknown
*
)
texture
);
if
(
FAILED
(
hr
))
{
ERR
(
"CreateSurface failed, returning %#x
\n
"
,
hr
);
IDXGISurface_Release
(
texture
->
dxgi_surface
);
return
hr
;
}
}
return
S_OK
;
}
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