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
9bac6f15
Commit
9bac6f15
authored
Nov 18, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Disallow dynamic rendertarget and depth/stencil resources.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0bae2bed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
12 deletions
+26
-12
device.c
dlls/d3d8/tests/device.c
+4
-3
device.c
dlls/d3d9/tests/device.c
+4
-3
surface.c
dlls/ddraw/surface.c
+3
-1
resource.c
dlls/wined3d/resource.c
+15
-5
No files found.
dlls/d3d8/tests/device.c
View file @
9bac6f15
...
...
@@ -8944,7 +8944,7 @@ static void test_resource_access(void)
case
SURFACE_2D
:
hr
=
IDirect3DDevice8_CreateTexture
(
device
,
16
,
16
,
1
,
tests
[
j
].
usage
,
format
,
tests
[
j
].
pool
,
&
texture_2d
);
todo_wine_if
(
j
==
10
||
j
==
13
||
j
==
16
||
j
==
23
||
j
==
30
)
todo_wine_if
(
!
tests
[
j
].
valid
&&
tests
[
j
].
format
==
FORMAT_DEPTH
&&
!
tests
[
j
].
usage
)
ok
(
hr
==
(
tests
[
j
].
valid
&&
(
tests
[
j
].
format
!=
FORMAT_DEPTH
||
depth_2d
)
?
D3D_OK
:
D3DERR_INVALIDCALL
),
"Test %s %u: Got unexpected hr %#x.
\n
"
,
surface_types
[
i
].
name
,
j
,
hr
);
...
...
@@ -8959,7 +8959,7 @@ static void test_resource_access(void)
case
SURFACE_CUBE
:
hr
=
IDirect3DDevice8_CreateCubeTexture
(
device
,
16
,
1
,
tests
[
j
].
usage
,
format
,
tests
[
j
].
pool
,
&
texture_cube
);
todo_wine_if
(
j
==
10
||
j
==
13
||
j
==
16
||
j
==
23
||
j
==
30
)
todo_wine_if
(
!
tests
[
j
].
valid
&&
tests
[
j
].
format
==
FORMAT_DEPTH
&&
!
tests
[
j
].
usage
)
ok
(
hr
==
(
tests
[
j
].
valid
&&
(
tests
[
j
].
format
!=
FORMAT_DEPTH
||
depth_cube
)
?
D3D_OK
:
D3DERR_INVALIDCALL
),
"Test %s %u: Got unexpected hr %#x.
\n
"
,
surface_types
[
i
].
name
,
j
,
hr
);
...
...
@@ -9091,7 +9091,8 @@ static void test_resource_access(void)
hr
=
IDirect3DDevice8_CreateVolumeTexture
(
device
,
16
,
16
,
1
,
1
,
tests
[
i
].
usage
,
format
,
tests
[
i
].
pool
,
&
texture
);
todo_wine_if
(
tests
[
i
].
usage
&
D3DUSAGE_RENDERTARGET
&&
tests
[
i
].
pool
==
D3DPOOL_DEFAULT
)
todo_wine_if
(
tests
[
i
].
usage
&
D3DUSAGE_RENDERTARGET
&&
!
(
tests
[
i
].
usage
&
D3DUSAGE_DYNAMIC
)
&&
tests
[
i
].
pool
==
D3DPOOL_DEFAULT
)
ok
(
hr
==
(
!
(
tests
[
i
].
usage
&
~
D3DUSAGE_DYNAMIC
)
?
D3D_OK
:
D3DERR_INVALIDCALL
),
"Test %u: Got unexpected hr %#x.
\n
"
,
i
,
hr
);
if
(
FAILED
(
hr
))
...
...
dlls/d3d9/tests/device.c
View file @
9bac6f15
...
...
@@ -12774,7 +12774,7 @@ static void test_resource_access(void)
case
SURFACE_2D
:
hr
=
IDirect3DDevice9_CreateTexture
(
device
,
16
,
16
,
1
,
tests
[
j
].
usage
,
format
,
tests
[
j
].
pool
,
&
texture_2d
,
NULL
);
todo_wine_if
(
j
==
10
||
j
==
13
||
j
==
16
||
j
==
23
||
j
==
30
)
todo_wine_if
(
!
tests
[
j
].
valid
&&
tests
[
j
].
format
==
FORMAT_DEPTH
&&
!
tests
[
j
].
usage
)
ok
(
hr
==
(
tests
[
j
].
valid
&&
(
tests
[
j
].
format
!=
FORMAT_DEPTH
||
depth_2d
)
?
D3D_OK
:
D3DERR_INVALIDCALL
),
"Test %s %u: Got unexpected hr %#x.
\n
"
,
surface_types
[
i
].
name
,
j
,
hr
);
...
...
@@ -12789,7 +12789,7 @@ static void test_resource_access(void)
case
SURFACE_CUBE
:
hr
=
IDirect3DDevice9_CreateCubeTexture
(
device
,
16
,
1
,
tests
[
j
].
usage
,
format
,
tests
[
j
].
pool
,
&
texture_cube
,
NULL
);
todo_wine_if
(
j
==
10
||
j
==
13
||
j
==
16
||
j
==
23
||
j
==
30
)
todo_wine_if
(
!
tests
[
j
].
valid
&&
tests
[
j
].
format
==
FORMAT_DEPTH
&&
!
tests
[
j
].
usage
)
ok
(
hr
==
(
tests
[
j
].
valid
&&
(
tests
[
j
].
format
!=
FORMAT_DEPTH
||
depth_cube
)
?
D3D_OK
:
D3DERR_INVALIDCALL
),
"Test %s %u: Got unexpected hr %#x.
\n
"
,
surface_types
[
i
].
name
,
j
,
hr
);
...
...
@@ -12926,7 +12926,8 @@ static void test_resource_access(void)
hr
=
IDirect3DDevice9_CreateVolumeTexture
(
device
,
16
,
16
,
1
,
1
,
tests
[
i
].
usage
,
format
,
tests
[
i
].
pool
,
&
texture
,
NULL
);
todo_wine_if
(
tests
[
i
].
usage
&
D3DUSAGE_RENDERTARGET
&&
tests
[
i
].
pool
==
D3DPOOL_DEFAULT
)
todo_wine_if
(
tests
[
i
].
usage
&
D3DUSAGE_RENDERTARGET
&&
!
(
tests
[
i
].
usage
&
D3DUSAGE_DYNAMIC
)
&&
tests
[
i
].
pool
==
D3DPOOL_DEFAULT
)
ok
(
hr
==
(
!
(
tests
[
i
].
usage
&
~
D3DUSAGE_DYNAMIC
)
?
D3D_OK
:
D3DERR_INVALIDCALL
),
"Test %u: Got unexpected hr %#x.
\n
"
,
i
,
hr
);
if
(
FAILED
(
hr
))
...
...
dlls/ddraw/surface.c
View file @
9bac6f15
...
...
@@ -6189,7 +6189,9 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
/* Videomemory adds localvidmem. This is mutually exclusive with
* systemmemory and texturemanage. */
desc
->
ddsCaps
.
dwCaps
|=
DDSCAPS_LOCALVIDMEM
;
wined3d_desc
.
usage
|=
WINED3DUSAGE_DYNAMIC
;
/* Dynamic resources can't be written by the GPU. */
if
(
!
(
wined3d_desc
.
bind_flags
&
(
WINED3D_BIND_RENDER_TARGET
|
WINED3D_BIND_DEPTH_STENCIL
)))
wined3d_desc
.
usage
|=
WINED3DUSAGE_DYNAMIC
;
}
}
...
...
dlls/wined3d/resource.c
View file @
9bac6f15
...
...
@@ -91,12 +91,22 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
return
WINED3DERR_INVALIDCALL
;
}
if
((
access
&
(
WINED3D_RESOURCE_ACCESS_CPU
|
WINED3D_RESOURCE_ACCESS_GPU
))
!=
WINED3D_RESOURCE_ACCESS_GPU
&&
bind_flags
&
(
WINED3D_BIND_RENDER_TARGET
|
WINED3D_BIND_DEPTH_STENCIL
))
if
(
bind_flags
&
(
WINED3D_BIND_RENDER_TARGET
|
WINED3D_BIND_DEPTH_STENCIL
))
{
WARN
(
"Bind flags %s are incompatible with resource access %s.
\n
"
,
wined3d_debug_bind_flags
(
bind_flags
),
wined3d_debug_resource_access
(
access
));
return
WINED3DERR_INVALIDCALL
;
if
((
access
&
(
WINED3D_RESOURCE_ACCESS_CPU
|
WINED3D_RESOURCE_ACCESS_GPU
))
!=
WINED3D_RESOURCE_ACCESS_GPU
)
{
WARN
(
"Bind flags %s are incompatible with resource access %s.
\n
"
,
wined3d_debug_bind_flags
(
bind_flags
),
wined3d_debug_resource_access
(
access
));
return
WINED3DERR_INVALIDCALL
;
}
/* Dynamic usage is incompatible with GPU writes. */
if
(
usage
&
WINED3DUSAGE_DYNAMIC
)
{
WARN
(
"Bind flags %s are incompatible with resource usage %s.
\n
"
,
wined3d_debug_bind_flags
(
bind_flags
),
debug_d3dusage
(
usage
));
return
WINED3DERR_INVALIDCALL
;
}
}
if
(
!
size
)
...
...
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