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
2b4c72b1
Commit
2b4c72b1
authored
Jul 12, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Always create a wined3d texture for d3d10core textures.
parent
4a013688
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
57 deletions
+45
-57
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+1
-1
device.c
dlls/d3d10core/device.c
+15
-33
texture.c
dlls/d3d10core/texture.c
+17
-19
view.c
dlls/d3d10core/view.c
+1
-1
device.c
dlls/dxgi/device.c
+4
-3
surface.c
dlls/wined3d/surface.c
+5
-0
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-0
wined3d.h
include/wine/wined3d.h
+1
-0
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
2b4c72b1
...
...
@@ -90,7 +90,7 @@ struct d3d10_texture2d
LONG
refcount
;
IUnknown
*
dxgi_surface
;
struct
wined3d_
surface
*
wined3d_surfac
e
;
struct
wined3d_
texture
*
wined3d_textur
e
;
D3D10_TEXTURE2D_DESC
desc
;
};
...
...
dlls/d3d10core/device.c
View file @
2b4c72b1
...
...
@@ -24,6 +24,13 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d10core
);
static
void
STDMETHODCALLTYPE
d3d10_null_wined3d_object_destroyed
(
void
*
parent
)
{}
const
struct
wined3d_parent_ops
d3d10_null_wined3d_parent_ops
=
{
d3d10_null_wined3d_object_destroyed
,
};
/* Inner IUnknown methods */
static
inline
struct
d3d10_device
*
impl_from_IUnknown
(
IUnknown
*
iface
)
...
...
@@ -1361,41 +1368,14 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
enum
wined3d_pool
pool
,
UINT
level
,
enum
wined3d_cubemap_face
face
,
struct
wined3d_surface
**
surface
)
{
struct
d3d10_device
*
device
=
device_from_wined3d_device_parent
(
device_parent
);
struct
d3d10_texture2d
*
texture
;
D3D10_TEXTURE2D_DESC
desc
;
HRESULT
hr
;
FIXM
E
(
"device_parent %p, container_parent %p, width %u, height %u, format %#x, usage %#x,
\n
"
"
\t
pool %#x, level %u, face %u, surface %p
partial stub!
\n
"
,
TRAC
E
(
"device_parent %p, container_parent %p, width %u, height %u, format %#x, usage %#x,
\n
"
"
\t
pool %#x, level %u, face %u, surface %p
.
\n
"
,
device_parent
,
container_parent
,
width
,
height
,
format
,
usage
,
pool
,
level
,
face
,
surface
);
FIXME
(
"Implement DXGI<->wined3d usage conversion
\n
"
);
desc
.
Width
=
width
;
desc
.
Height
=
height
;
desc
.
MipLevels
=
1
;
desc
.
ArraySize
=
1
;
desc
.
Format
=
dxgi_format_from_wined3dformat
(
format
);
desc
.
SampleDesc
.
Count
=
1
;
desc
.
SampleDesc
.
Quality
=
0
;
desc
.
Usage
=
usage
;
desc
.
BindFlags
=
0
;
desc
.
CPUAccessFlags
=
0
;
desc
.
MiscFlags
=
0
;
hr
=
d3d10_device_CreateTexture2D
(
&
device
->
ID3D10Device_iface
,
&
desc
,
NULL
,
(
ID3D10Texture2D
**
)
&
texture
);
if
(
FAILED
(
hr
))
{
ERR
(
"CreateTexture2D failed, returning %#x
\n
"
,
hr
);
return
hr
;
}
*
surface
=
texture
->
wined3d_surface
;
wined3d_surface_incref
(
*
surface
);
ID3D10Texture2D_Release
(
&
texture
->
ID3D10Texture2D_iface
);
return
S_OK
;
return
wined3d_surface_create
(
device
->
wined3d_device
,
width
,
height
,
format
,
level
,
usage
,
pool
,
WINED3D_MULTISAMPLE_NONE
,
0
,
WINED3D_SURFACE_TYPE_OPENGL
,
0
,
container_parent
,
&
d3d10_null_wined3d_parent_ops
,
surface
);
}
static
HRESULT
CDECL
device_parent_create_swapchain_surface
(
struct
wined3d_device_parent
*
device_parent
,
...
...
@@ -1403,6 +1383,7 @@ static HRESULT CDECL device_parent_create_swapchain_surface(struct wined3d_devic
enum
wined3d_multisample_type
multisample_type
,
DWORD
multisample_quality
,
struct
wined3d_surface
**
surface
)
{
struct
d3d10_device
*
device
=
device_from_wined3d_device_parent
(
device_parent
);
struct
wined3d_resource
*
sub_resource
;
struct
d3d10_texture2d
*
texture
;
D3D10_TEXTURE2D_DESC
desc
;
HRESULT
hr
;
...
...
@@ -1434,7 +1415,8 @@ static HRESULT CDECL device_parent_create_swapchain_surface(struct wined3d_devic
return
hr
;
}
*
surface
=
texture
->
wined3d_surface
;
sub_resource
=
wined3d_texture_get_sub_resource
(
texture
->
wined3d_texture
,
0
);
*
surface
=
wined3d_surface_from_resource
(
sub_resource
);
wined3d_surface_incref
(
*
surface
);
ID3D10Texture2D_Release
(
&
texture
->
ID3D10Texture2D_iface
);
...
...
dlls/d3d10core/texture.c
View file @
2b4c72b1
...
...
@@ -66,8 +66,8 @@ static ULONG STDMETHODCALLTYPE d3d10_texture2d_AddRef(ID3D10Texture2D *iface)
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
if
(
refcount
==
1
&&
This
->
wined3d_surface
)
wined3d_
surface_incref
(
This
->
wined3d_surfac
e
);
if
(
refcount
==
1
)
wined3d_
texture_incref
(
This
->
wined3d_textur
e
);
return
refcount
;
}
...
...
@@ -88,12 +88,7 @@ static ULONG STDMETHODCALLTYPE d3d10_texture2d_Release(ID3D10Texture2D *iface)
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
if
(
!
refcount
)
{
if
(
This
->
wined3d_surface
)
wined3d_surface_decref
(
This
->
wined3d_surface
);
else
d3d10_texture2d_wined3d_object_released
(
This
);
}
wined3d_texture_decref
(
This
->
wined3d_texture
);
return
refcount
;
}
...
...
@@ -233,20 +228,23 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
ERR
(
"Failed to create DXGI surface, returning %#x
\n
"
,
hr
);
return
hr
;
}
}
FIXME
(
"Implement DXGI<->wined3d usage conversion
\n
"
);
FIXME
(
"Implement DXGI<->wined3d usage conversion
\n
"
);
if
(
desc
->
ArraySize
!=
1
)
FIXME
(
"Array textures not implemented.
\n
"
);
if
(
desc
->
SampleDesc
.
Count
>
1
)
FIXME
(
"Multisampled textures not implemented.
\n
"
);
hr
=
wined3d_surface_create
(
device
->
wined3d_device
,
desc
->
Width
,
desc
->
Height
,
wined3dformat_from_dxgi_format
(
desc
->
Format
),
0
,
desc
->
Usage
,
WINED3D_POOL_DEFAULT
,
desc
->
SampleDesc
.
Count
>
1
?
desc
->
SampleDesc
.
Count
:
WINED3D_MULTISAMPLE_NONE
,
desc
->
SampleDesc
.
Quality
,
WINED3D_SURFACE_TYPE_OPENGL
,
0
,
texture
,
&
d3d10_texture2d_wined3d_parent_ops
,
&
texture
->
wined3d_surface
);
if
(
FAILED
(
hr
))
{
ERR
(
"CreateSurface failed, returning %#x
\n
"
,
hr
);
hr
=
wined3d_texture_create_2d
(
device
->
wined3d_device
,
desc
->
Width
,
desc
->
Height
,
desc
->
MipLevels
,
desc
->
Usage
,
wined3dformat_from_dxgi_format
(
desc
->
Format
),
WINED3D_POOL_DEFAULT
,
texture
,
&
d3d10_texture2d_wined3d_parent_ops
,
&
texture
->
wined3d_texture
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d texture, hr %#x.
\n
"
,
hr
);
if
(
texture
->
dxgi_surface
)
IDXGISurface_Release
(
texture
->
dxgi_surface
);
return
hr
;
}
return
hr
;
}
return
S_OK
;
...
...
dlls/d3d10core/view.c
View file @
2b4c72b1
...
...
@@ -37,7 +37,7 @@ static struct wined3d_resource *wined3d_resource_from_resource(ID3D10Resource *r
return
wined3d_buffer_get_resource
(((
struct
d3d10_buffer
*
)
resource
)
->
wined3d_buffer
);
case
D3D10_RESOURCE_DIMENSION_TEXTURE2D
:
return
wined3d_
surface_get_resource
(((
struct
d3d10_texture2d
*
)
resource
)
->
wined3d_surfac
e
);
return
wined3d_
texture_get_resource
(((
struct
d3d10_texture2d
*
)
resource
)
->
wined3d_textur
e
);
default:
FIXME
(
"Unhandled resource dimension %#x.
\n
"
,
dimension
);
...
...
dlls/dxgi/device.c
View file @
2b4c72b1
...
...
@@ -189,9 +189,10 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *ifac
struct
wined3d_surface
*
wined3d_surface
;
IUnknown
*
parent
;
hr
=
device_parent
->
ops
->
create_texture_surface
(
device_parent
,
NULL
,
desc
->
Width
,
desc
->
Height
,
wined3dformat_from_dxgi_format
(
desc
->
Format
),
usage
,
WINED3D_POOL_DEFAULT
,
0
,
WINED3D_CUBEMAP_FACE_POSITIVE_X
,
&
wined3d_surface
);
hr
=
device_parent
->
ops
->
create_swapchain_surface
(
device_parent
,
NULL
,
desc
->
Width
,
desc
->
Height
,
wined3dformat_from_dxgi_format
(
desc
->
Format
),
usage
,
desc
->
SampleDesc
.
Count
>
1
?
desc
->
SampleDesc
.
Count
:
WINED3D_MULTISAMPLE_NONE
,
desc
->
SampleDesc
.
Quality
,
&
wined3d_surface
);
if
(
FAILED
(
hr
))
{
ERR
(
"CreateSurface failed, returning %#x
\n
"
,
hr
);
...
...
dlls/wined3d/surface.c
View file @
2b4c72b1
...
...
@@ -3852,6 +3852,11 @@ do { \
return
WINED3D_OK
;
}
struct
wined3d_surface
*
CDECL
wined3d_surface_from_resource
(
struct
wined3d_resource
*
resource
)
{
return
surface_from_resource
(
resource
);
}
HRESULT
CDECL
wined3d_surface_unmap
(
struct
wined3d_surface
*
surface
)
{
TRACE
(
"surface %p.
\n
"
,
surface
);
...
...
dlls/wined3d/wined3d.spec
View file @
2b4c72b1
...
...
@@ -193,6 +193,7 @@
@ cdecl wined3d_surface_create(ptr long long long long long long long long long long ptr ptr ptr)
@ cdecl wined3d_surface_decref(ptr)
@ cdecl wined3d_surface_flip(ptr ptr long)
@ cdecl wined3d_surface_from_resource(ptr)
@ cdecl wined3d_surface_get_blt_status(ptr long)
@ cdecl wined3d_surface_get_flip_status(ptr long)
@ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr)
...
...
include/wine/wined3d.h
View file @
2b4c72b1
...
...
@@ -2325,6 +2325,7 @@ HRESULT __cdecl wined3d_surface_create(struct wined3d_device *device, UINT width
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_surface
**
surface
);
ULONG
__cdecl
wined3d_surface_decref
(
struct
wined3d_surface
*
surface
);
HRESULT
__cdecl
wined3d_surface_flip
(
struct
wined3d_surface
*
surface
,
struct
wined3d_surface
*
override
,
DWORD
flags
);
struct
wined3d_surface
*
__cdecl
wined3d_surface_from_resource
(
struct
wined3d_resource
*
resource
);
HRESULT
__cdecl
wined3d_surface_get_blt_status
(
const
struct
wined3d_surface
*
surface
,
DWORD
flags
);
HRESULT
__cdecl
wined3d_surface_get_flip_status
(
const
struct
wined3d_surface
*
surface
,
DWORD
flags
);
HRESULT
__cdecl
wined3d_surface_get_overlay_position
(
const
struct
wined3d_surface
*
surface
,
LONG
*
x
,
LONG
*
y
);
...
...
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