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
80638b6d
Commit
80638b6d
authored
Sep 06, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Enforce texturing capability format restrictions on resource creation.
parent
b4640673
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
2 deletions
+23
-2
texture.c
dlls/d3d8/texture.c
+3
-0
texture.c
dlls/d3d9/texture.c
+3
-0
surface.c
dlls/ddraw/surface.c
+12
-1
resource.c
dlls/wined3d/resource.c
+4
-1
wined3d.h
include/wine/wined3d.h
+1
-0
No files found.
dlls/d3d8/texture.c
View file @
80638b6d
...
...
@@ -1197,6 +1197,7 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device,
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
desc
.
usage
|=
WINED3DUSAGE_TEXTURE
;
desc
.
pool
=
pool
;
desc
.
width
=
width
;
desc
.
height
=
height
;
...
...
@@ -1237,6 +1238,7 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
desc
.
usage
|=
WINED3DUSAGE_TEXTURE
;
desc
.
pool
=
pool
;
desc
.
width
=
edge_length
;
desc
.
height
=
edge_length
;
...
...
@@ -1276,6 +1278,7 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
desc
.
usage
|=
WINED3DUSAGE_TEXTURE
;
desc
.
pool
=
pool
;
desc
.
width
=
width
;
desc
.
height
=
height
;
...
...
dlls/d3d9/texture.c
View file @
80638b6d
...
...
@@ -1321,6 +1321,7 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device,
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
desc
.
usage
|=
WINED3DUSAGE_TEXTURE
;
desc
.
pool
=
pool
;
desc
.
width
=
width
;
desc
.
height
=
height
;
...
...
@@ -1361,6 +1362,7 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
desc
.
usage
|=
WINED3DUSAGE_TEXTURE
;
desc
.
pool
=
pool
;
desc
.
width
=
edge_length
;
desc
.
height
=
edge_length
;
...
...
@@ -1400,6 +1402,7 @@ HRESULT volumetexture_init(struct d3d9_texture *texture, struct d3d9_device *dev
desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
desc
.
multisample_quality
=
0
;
desc
.
usage
=
usage
&
WINED3DUSAGE_MASK
;
desc
.
usage
|=
WINED3DUSAGE_TEXTURE
;
desc
.
pool
=
pool
;
desc
.
width
=
width
;
desc
.
height
=
height
;
...
...
dlls/ddraw/surface.c
View file @
80638b6d
...
...
@@ -5608,16 +5608,27 @@ HRESULT ddraw_surface_create_texture(struct ddraw_surface *surface, DWORD surfac
layers
=
1
;
if
(
desc
->
ddsCaps
.
dwCaps2
&
DDSCAPS2_TEXTUREMANAGE
)
{
wined3d_desc
.
usage
=
WINED3DUSAGE_TEXTURE
;
pool
=
WINED3D_POOL_MANAGED
;
}
else
if
(
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_SYSTEMMEMORY
)
{
/* ddraw does not enforce format support restrictions on system memory
* textures. Don't set the texture flag, the texture can't be used for
* texturing anyway. */
wined3d_desc
.
usage
=
0
;
pool
=
WINED3D_POOL_SYSTEM_MEM
;
}
else
{
wined3d_desc
.
usage
=
WINED3DUSAGE_TEXTURE
;
pool
=
WINED3D_POOL_DEFAULT
;
}
wined3d_desc
.
format
=
wined3dformat_from_ddrawformat
(
&
surface
->
surface_desc
.
u4
.
ddpfPixelFormat
);
wined3d_desc
.
multisample_type
=
WINED3D_MULTISAMPLE_NONE
;
wined3d_desc
.
multisample_quality
=
0
;
wined3d_desc
.
usage
=
0
;
wined3d_desc
.
pool
=
pool
;
wined3d_desc
.
width
=
desc
->
dwWidth
;
wined3d_desc
.
height
=
desc
->
dwHeight
;
...
...
dlls/wined3d/resource.c
View file @
80638b6d
...
...
@@ -70,7 +70,8 @@ static void resource_check_usage(DWORD usage)
|
WINED3DUSAGE_DYNAMIC
|
WINED3DUSAGE_AUTOGENMIPMAP
|
WINED3DUSAGE_STATICDECL
|
WINED3DUSAGE_OVERLAY
;
|
WINED3DUSAGE_OVERLAY
|
WINED3DUSAGE_TEXTURE
;
if
(
usage
&
~
handled
)
FIXME
(
"Unhandled usage flags %#x.
\n
"
,
usage
&
~
handled
);
...
...
@@ -92,6 +93,8 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
return
WINED3DERR_INVALIDCALL
;
if
((
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
&&
!
(
format
->
flags
&
(
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
)))
return
WINED3DERR_INVALIDCALL
;
if
((
usage
&
WINED3DUSAGE_TEXTURE
)
&&
!
(
format
->
flags
&
WINED3DFMT_FLAG_TEXTURE
))
return
WINED3DERR_INVALIDCALL
;
}
resource
->
ref
=
1
;
...
...
include/wine/wined3d.h
View file @
80638b6d
...
...
@@ -824,6 +824,7 @@ enum wined3d_display_rotation
#define WINED3DUSAGE_AUTOGENMIPMAP 0x00000400
#define WINED3DUSAGE_DMAP 0x00004000
#define WINED3DUSAGE_MASK 0x00004fff
#define WINED3DUSAGE_TEXTURE 0x10000000
#define WINED3DUSAGE_OWNDC 0x20000000
#define WINED3DUSAGE_STATICDECL 0x40000000
#define WINED3DUSAGE_OVERLAY 0x80000000
...
...
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