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
2b2d3de0
Commit
2b2d3de0
authored
Sep 16, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add a separate function for volume initialization.
parent
a5214c30
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
32 deletions
+47
-32
device.c
dlls/wined3d/device.c
+7
-29
volume.c
dlls/wined3d/volume.c
+38
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-2
No files found.
dlls/wined3d/device.c
View file @
2b2d3de0
...
...
@@ -1040,15 +1040,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface,
UINT
Width
,
UINT
Height
,
UINT
Depth
,
DWORD
Usage
,
WINED3DFORMAT
Format
,
WINED3DPOOL
Pool
,
IWineD3DVolume
**
ppVolume
,
IUnknown
*
parent
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DVolumeImpl
*
object
;
/** NOTE: impl ref allowed since this is a create function **/
const
struct
GlPixelFormatDesc
*
format_desc
=
getFormatDescEntry
(
Format
,
&
GLINFO_LOCATION
);
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DVolumeImpl
*
object
;
HRESULT
hr
;
if
(
!
GL_SUPPORT
(
EXT_TEXTURE3D
))
{
WARN
(
"(%p) : Volume cannot be created - no volume texture support
\n
"
,
This
);
return
WINED3DERR_INVALIDCALL
;
}
TRACE
(
"(%p) : W(%d) H(%d) D(%d), Usage(%d), Fmt(%u,%s), Pool(%s)
\n
"
,
This
,
Width
,
Height
,
Depth
,
Usage
,
Format
,
debug_d3dformat
(
Format
),
debug_d3dpool
(
Pool
));
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
...
...
@@ -1058,36 +1055,17 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface,
return
WINED3DERR_OUTOFVIDEOMEMORY
;
}
object
->
lpVtbl
=
&
IWineD3DVolume_Vtbl
;
hr
=
resource_init
((
IWineD3DResource
*
)
object
,
WINED3DRTYPE_VOLUME
,
This
,
Width
*
Height
*
Depth
*
format_desc
->
byte_count
,
Usage
,
format_desc
,
Pool
,
parent
);
hr
=
volume_init
(
object
,
This
,
Width
,
Height
,
Depth
,
Usage
,
Format
,
Pool
,
parent
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize
resource, returning %#x
\n
"
,
hr
);
WARN
(
"Failed to initialize
volume, returning %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppVolume
=
NULL
;
return
hr
;
}
TRACE
(
"(%p) : Created resource %p
\n
"
,
This
,
object
);
TRACE
(
"(%p) : Created volume %p.
\n
"
,
This
,
object
);
*
ppVolume
=
(
IWineD3DVolume
*
)
object
;
TRACE
(
"(%p) : W(%d) H(%d) D(%d), Usage(%d), Fmt(%u,%s), Pool(%s)
\n
"
,
This
,
Width
,
Height
,
Depth
,
Usage
,
Format
,
debug_d3dformat
(
Format
),
debug_d3dpool
(
Pool
));
object
->
currentDesc
.
Width
=
Width
;
object
->
currentDesc
.
Height
=
Height
;
object
->
currentDesc
.
Depth
=
Depth
;
/** Note: Volume textures cannot be dxtn, hence no need to check here **/
object
->
lockable
=
TRUE
;
object
->
locked
=
FALSE
;
memset
(
&
object
->
lockedBox
,
0
,
sizeof
(
WINED3DBOX
));
object
->
dirty
=
TRUE
;
volume_add_dirty_box
((
IWineD3DVolume
*
)
object
,
NULL
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/volume.c
View file @
2b2d3de0
...
...
@@ -4,6 +4,7 @@
* Copyright 2002-2005 Jason Edmeades
* Copyright 2002-2005 Raphael Junqueira
* Copyright 2005 Oliver Stieber
* Copyright 2009 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -346,7 +347,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int
}
const
IWineD3DVolumeVtbl
IWineD3DVolume_Vtbl
=
static
const
IWineD3DVolumeVtbl
IWineD3DVolume_Vtbl
=
{
/* IUnknown */
IWineD3DVolumeImpl_QueryInterface
,
...
...
@@ -372,3 +373,39 @@ const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
IWineD3DVolumeImpl_LoadTexture
,
IWineD3DVolumeImpl_SetContainer
};
HRESULT
volume_init
(
IWineD3DVolumeImpl
*
volume
,
IWineD3DDeviceImpl
*
device
,
UINT
width
,
UINT
height
,
UINT
depth
,
DWORD
usage
,
WINED3DFORMAT
format
,
WINED3DPOOL
pool
,
IUnknown
*
parent
)
{
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
const
struct
GlPixelFormatDesc
*
format_desc
=
getFormatDescEntry
(
format
,
gl_info
);
HRESULT
hr
;
if
(
!
gl_info
->
supported
[
EXT_TEXTURE3D
])
{
WARN
(
"Volume cannot be created - no volume texture support.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
volume
->
lpVtbl
=
&
IWineD3DVolume_Vtbl
;
hr
=
resource_init
((
IWineD3DResource
*
)
volume
,
WINED3DRTYPE_VOLUME
,
device
,
width
*
height
*
depth
*
format_desc
->
byte_count
,
usage
,
format_desc
,
pool
,
parent
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize resource, returning %#x.
\n
"
,
hr
);
return
hr
;
}
volume
->
currentDesc
.
Width
=
width
;
volume
->
currentDesc
.
Height
=
height
;
volume
->
currentDesc
.
Depth
=
depth
;
volume
->
lockable
=
TRUE
;
volume
->
locked
=
FALSE
;
memset
(
&
volume
->
lockedBox
,
0
,
sizeof
(
volume
->
lockedBox
));
volume
->
dirty
=
TRUE
;
volume_add_dirty_box
((
IWineD3DVolume
*
)
volume
,
NULL
);
return
WINED3D_OK
;
}
dlls/wined3d/wined3d_private.h
View file @
2b2d3de0
...
...
@@ -1875,9 +1875,9 @@ typedef struct IWineD3DVolumeImpl
BOOL
dirty
;
}
IWineD3DVolumeImpl
;
extern
const
IWineD3DVolumeVtbl
IWineD3DVolume_Vtbl
DECLSPEC_HIDDEN
;
void
volume_add_dirty_box
(
IWineD3DVolume
*
iface
,
const
WINED3DBOX
*
dirty_box
)
DECLSPEC_HIDDEN
;
HRESULT
volume_init
(
IWineD3DVolumeImpl
*
volume
,
IWineD3DDeviceImpl
*
device
,
UINT
width
,
UINT
height
,
UINT
depth
,
DWORD
usage
,
WINED3DFORMAT
format
,
WINED3DPOOL
pool
,
IUnknown
*
parent
)
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IWineD3DVolumeTexture implementation structure (extends IWineD3DBaseTextureImpl)
...
...
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