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
36dbac6c
Commit
36dbac6c
authored
Dec 06, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Set the volume container in volume_init().
parent
5db26f7b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
14 deletions
+17
-14
texture.c
dlls/wined3d/texture.c
+1
-3
volume.c
dlls/wined3d/volume.c
+14
-9
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-2
No files found.
dlls/wined3d/texture.c
View file @
36dbac6c
...
...
@@ -1110,15 +1110,13 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
{
struct
wined3d_volume
*
volume
;
if
(
FAILED
(
hr
=
wined3d_volume_create
(
device
,
parent
,
&
volume_desc
,
i
,
&
volume
)))
if
(
FAILED
(
hr
=
wined3d_volume_create
(
texture
,
&
volume_desc
,
i
,
&
volume
)))
{
ERR
(
"Creating a volume for the volume texture failed, hr %#x.
\n
"
,
hr
);
wined3d_texture_cleanup
(
texture
);
return
hr
;
}
/* Set its container to this texture. */
volume_set_container
(
volume
,
texture
);
texture
->
sub_resources
[
i
]
=
&
volume
->
resource
;
/* Calculate the next mipmap level. */
...
...
dlls/wined3d/volume.c
View file @
36dbac6c
...
...
@@ -812,9 +812,10 @@ static const struct wined3d_resource_ops volume_resource_ops =
volume_unload
,
};
static
HRESULT
volume_init
(
struct
wined3d_volume
*
volume
,
const
struct
wined3d_resource_desc
*
desc
,
struct
wined3d_device
*
device
,
UINT
level
)
static
HRESULT
volume_init
(
struct
wined3d_volume
*
volume
,
struct
wined3d_texture
*
container
,
const
struct
wined3d_resource_desc
*
desc
,
UINT
level
)
{
struct
wined3d_device
*
device
=
container
->
resource
.
device
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
const
struct
wined3d_format
*
format
=
wined3d_get_format
(
gl_info
,
desc
->
format
);
HRESULT
hr
;
...
...
@@ -855,36 +856,40 @@ static HRESULT volume_init(struct wined3d_volume *volume, const struct wined3d_r
volume
->
flags
|=
WINED3D_VFLAG_PBO
;
}
volume_set_container
(
volume
,
container
);
return
WINED3D_OK
;
}
HRESULT
wined3d_volume_create
(
struct
wined3d_
device
*
device
,
void
*
container_parent
,
const
struct
wined3d_resource_desc
*
desc
,
unsigned
int
level
,
struct
wined3d_volume
**
volume
)
HRESULT
wined3d_volume_create
(
struct
wined3d_
texture
*
container
,
const
struct
wined3d_resource_desc
*
desc
,
unsigned
int
level
,
struct
wined3d_volume
**
volume
)
{
struct
wined3d_device_parent
*
device_parent
=
container
->
resource
.
device
->
device_parent
;
const
struct
wined3d_parent_ops
*
parent_ops
;
struct
wined3d_volume
*
object
;
void
*
parent
;
HRESULT
hr
;
TRACE
(
"
device %p, container_parent
%p, width %u, height %u, depth %u, level %u, format %s, "
TRACE
(
"
container
%p, width %u, height %u, depth %u, level %u, format %s, "
"usage %#x, pool %s, volume %p.
\n
"
,
device
,
container_parent
,
desc
->
width
,
desc
->
height
,
desc
->
depth
,
level
,
debug_d3dformat
(
desc
->
format
),
container
,
desc
->
width
,
desc
->
height
,
desc
->
depth
,
level
,
debug_d3dformat
(
desc
->
format
),
desc
->
usage
,
debug_d3dpool
(
desc
->
pool
),
volume
);
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
volume_init
(
object
,
desc
,
device
,
level
)))
if
(
FAILED
(
hr
=
volume_init
(
object
,
container
,
desc
,
level
)))
{
WARN
(
"Failed to initialize volume, returning %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
if
(
FAILED
(
hr
=
device
->
device_parent
->
ops
->
volume_created
(
device
->
device_parent
,
container_parent
,
object
,
&
parent
,
&
parent_ops
)))
if
(
FAILED
(
hr
=
device
_parent
->
ops
->
volume_created
(
device_parent
,
wined3d_texture_get_parent
(
container
)
,
object
,
&
parent
,
&
parent_ops
)))
{
WARN
(
"Failed to create volume parent, hr %#x.
\n
"
,
hr
);
volume_set_container
(
object
,
NULL
);
wined3d_volume_decref
(
object
);
return
hr
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
36dbac6c
...
...
@@ -2133,8 +2133,8 @@ static inline struct wined3d_volume *volume_from_resource(struct wined3d_resourc
return
CONTAINING_RECORD
(
resource
,
struct
wined3d_volume
,
resource
);
}
HRESULT
wined3d_volume_create
(
struct
wined3d_
device
*
device
,
void
*
container_parent
,
const
struct
wined3d_resource_desc
*
desc
,
unsigned
int
level
,
struct
wined3d_volume
**
volume
)
DECLSPEC_HIDDEN
;
HRESULT
wined3d_volume_create
(
struct
wined3d_
texture
*
container
,
const
struct
wined3d_resource_desc
*
desc
,
unsigned
int
level
,
struct
wined3d_volume
**
volume
)
DECLSPEC_HIDDEN
;
void
wined3d_volume_load
(
struct
wined3d_volume
*
volume
,
struct
wined3d_context
*
context
,
BOOL
srgb_mode
)
DECLSPEC_HIDDEN
;
void
volume_set_container
(
struct
wined3d_volume
*
volume
,
struct
wined3d_texture
*
container
)
DECLSPEC_HIDDEN
;
...
...
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