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
133bfe29
Commit
133bfe29
authored
Aug 20, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Always create textures for surfaces.
parent
d0c9dbe7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
23 deletions
+49
-23
device.c
dlls/d3d8/device.c
+49
-23
No files found.
dlls/d3d8/device.c
View file @
133bfe29
...
...
@@ -36,6 +36,13 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d8
);
static
void
STDMETHODCALLTYPE
d3d8_null_wined3d_object_destroyed
(
void
*
parent
)
{}
static
const
struct
wined3d_parent_ops
d3d8_null_wined3d_parent_ops
=
{
d3d8_null_wined3d_object_destroyed
,
};
D3DFORMAT
d3dformat_from_wined3dformat
(
enum
wined3d_format_id
format
)
{
BYTE
*
c
=
(
BYTE
*
)
&
format
;
...
...
@@ -871,7 +878,10 @@ static HRESULT d3d8_device_create_surface(struct d3d8_device *device, UINT width
D3DFORMAT
format
,
DWORD
flags
,
IDirect3DSurface8
**
surface
,
UINT
usage
,
D3DPOOL
pool
,
D3DMULTISAMPLE_TYPE
multisample_type
,
DWORD
multisample_quality
)
{
struct
d3d8_surface
*
object
;
struct
wined3d_resource
*
sub_resource
;
struct
wined3d_resource_desc
desc
;
struct
d3d8_surface
*
surface_impl
;
struct
wined3d_texture
*
texture
;
HRESULT
hr
;
TRACE
(
"device %p, width %u, height %u, format %#x, flags %#x, surface %p,
\n
"
...
...
@@ -879,22 +889,36 @@ static HRESULT d3d8_device_create_surface(struct d3d8_device *device, UINT width
device
,
width
,
height
,
format
,
flags
,
surface
,
usage
,
pool
,
multisample_type
,
multisample_quality
);
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
{
FIXME
(
"Failed to allocate surface memory.
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
}
desc
.
resource_type
=
WINED3D_RTYPE_TEXTURE
;
desc
.
format
=
wined3dformat_from_d3dformat
(
format
);
desc
.
multisample_type
=
multisample_type
;
desc
.
multisample_quality
=
multisample_quality
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
desc
.
pool
=
pool
;
desc
.
width
=
width
;
desc
.
height
=
height
;
desc
.
depth
=
1
;
desc
.
size
=
0
;
if
(
FAILED
(
hr
=
surface_init
(
object
,
device
,
width
,
height
,
format
,
flags
,
usage
,
pool
,
multisample_type
,
multisample_quality
)))
wined3d_mutex_lock
();
if
(
FAILED
(
hr
=
wined3d_texture_create_2d
(
device
->
wined3d_device
,
&
desc
,
1
,
flags
,
NULL
,
&
d3d8_null_wined3d_parent_ops
,
&
texture
)))
{
WARN
(
"Failed to initialize surface, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
wined3d_mutex_unlock
(
);
WARN
(
"Failed to create texture, hr %#x.
\n
"
,
hr
);
return
hr
;
}
TRACE
(
"Created surface %p.
\n
"
,
object
);
*
surface
=
&
object
->
IDirect3DSurface8_iface
;
sub_resource
=
wined3d_texture_get_sub_resource
(
texture
,
0
);
surface_impl
=
wined3d_resource_get_parent
(
sub_resource
);
surface_impl
->
forwardReference
=
NULL
;
surface_impl
->
parent_device
=
&
device
->
IDirect3DDevice8_iface
;
*
surface
=
&
surface_impl
->
IDirect3DSurface8_iface
;
IDirect3DSurface8_AddRef
(
*
surface
);
wined3d_texture_decref
(
texture
);
wined3d_mutex_unlock
();
return
D3D_OK
;
}
...
...
@@ -1910,13 +1934,6 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitive(IDirect3DDevice8 *iface,
return
hr
;
}
static
void
STDMETHODCALLTYPE
d3d8_null_wined3d_object_destroyed
(
void
*
parent
)
{}
static
const
struct
wined3d_parent_ops
d3d8_null_wined3d_parent_ops
=
{
d3d8_null_wined3d_object_destroyed
,
};
/* The caller is responsible for wined3d locking */
static
HRESULT
d3d8_device_prepare_vertex_buffer
(
struct
d3d8_device
*
device
,
UINT
min_size
)
{
...
...
@@ -2907,14 +2924,23 @@ static HRESULT CDECL device_parent_create_texture_surface(struct wined3d_device_
TRACE
(
"device_parent %p, container_parent %p, desc %p, sub_resource_idx %u, flags %#x, surface %p.
\n
"
,
device_parent
,
container_parent
,
desc
,
sub_resource_idx
,
flags
,
surface
);
if
(
FAILED
(
hr
=
d3d8_device_create_surface
(
device
,
desc
->
width
,
desc
->
height
,
d3dformat_from_wined3dformat
(
desc
->
format
),
flags
,
(
IDirect3DSurface8
**
)
&
d3d_surface
,
desc
->
usage
,
desc
->
pool
,
desc
->
multisample_type
,
desc
->
multisample_quality
)))
if
(
!
(
d3d_surface
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
d3d_surface
))))
{
WARN
(
"Failed to create surface, hr %#x.
\n
"
,
hr
);
FIXME
(
"Failed to allocate surface memory.
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
}
if
(
FAILED
(
hr
=
surface_init
(
d3d_surface
,
device
,
desc
->
width
,
desc
->
height
,
d3dformat_from_wined3dformat
(
desc
->
format
),
flags
,
desc
->
usage
,
desc
->
pool
,
desc
->
multisample_type
,
desc
->
multisample_quality
)))
{
WARN
(
"Failed to initialize surface, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
d3d_surface
);
return
hr
;
}
TRACE
(
"Created surface %p.
\n
"
,
d3d_surface
);
*
surface
=
d3d_surface
->
wined3d_surface
;
wined3d_surface_incref
(
*
surface
);
...
...
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