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
c0cb4331
Commit
c0cb4331
authored
Dec 10, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Calculate the texture level count before texture creation.
parent
3b3b7451
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
texture.c
dlls/d3d10core/texture.c
+10
-4
No files found.
dlls/d3d10core/texture.c
View file @
c0cb4331
...
...
@@ -251,6 +251,7 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
const
D3D10_TEXTURE2D_DESC
*
desc
)
{
struct
wined3d_resource_desc
wined3d_desc
;
unsigned
int
levels
;
HRESULT
hr
;
texture
->
ID3D10Texture2D_iface
.
lpVtbl
=
&
d3d10_texture2d_vtbl
;
...
...
@@ -300,7 +301,9 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
wined3d_desc
.
depth
=
1
;
wined3d_desc
.
size
=
0
;
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
->
wined3d_device
,
&
wined3d_desc
,
desc
->
MipLevels
,
levels
=
desc
->
MipLevels
?
desc
->
MipLevels
:
wined3d_log2i
(
max
(
desc
->
Width
,
desc
->
Height
))
+
1
;
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
->
wined3d_device
,
&
wined3d_desc
,
levels
,
0
,
texture
,
&
d3d10_texture2d_wined3d_parent_ops
,
&
texture
->
wined3d_texture
)))
{
WARN
(
"Failed to create wined3d texture, hr %#x.
\n
"
,
hr
);
...
...
@@ -308,7 +311,7 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
IUnknown_Release
(
texture
->
dxgi_surface
);
return
hr
;
}
texture
->
desc
.
MipLevels
=
wined3d_texture_get_level_count
(
texture
->
wined3d_texture
)
;
texture
->
desc
.
MipLevels
=
levels
;
texture
->
device
=
&
device
->
ID3D10Device1_iface
;
ID3D10Device1_AddRef
(
texture
->
device
);
...
...
@@ -517,6 +520,7 @@ HRESULT d3d10_texture3d_init(struct d3d10_texture3d *texture, struct d3d10_devic
const
D3D10_TEXTURE3D_DESC
*
desc
)
{
struct
wined3d_resource_desc
wined3d_desc
;
unsigned
int
levels
;
HRESULT
hr
;
texture
->
ID3D10Texture3D_iface
.
lpVtbl
=
&
d3d10_texture3d_vtbl
;
...
...
@@ -534,13 +538,15 @@ HRESULT d3d10_texture3d_init(struct d3d10_texture3d *texture, struct d3d10_devic
wined3d_desc
.
depth
=
desc
->
Depth
;
wined3d_desc
.
size
=
0
;
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
->
wined3d_device
,
&
wined3d_desc
,
desc
->
MipLevels
,
levels
=
desc
->
MipLevels
?
desc
->
MipLevels
:
wined3d_log2i
(
max
(
max
(
desc
->
Width
,
desc
->
Height
),
desc
->
Depth
))
+
1
;
if
(
FAILED
(
hr
=
wined3d_texture_create
(
device
->
wined3d_device
,
&
wined3d_desc
,
levels
,
0
,
texture
,
&
d3d10_texture3d_wined3d_parent_ops
,
&
texture
->
wined3d_texture
)))
{
WARN
(
"Failed to create wined3d texture, hr %#x.
\n
"
,
hr
);
return
hr
;
}
texture
->
desc
.
MipLevels
=
wined3d_texture_get_level_count
(
texture
->
wined3d_texture
)
;
texture
->
desc
.
MipLevels
=
levels
;
texture
->
device
=
&
device
->
ID3D10Device1_iface
;
ID3D10Device1_AddRef
(
texture
->
device
);
...
...
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