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
5a7ff3b4
Commit
5a7ff3b4
authored
Mar 15, 2024
by
Paul Gofman
Committed by
Alexandre Julliard
Mar 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Store surface handles in the global table.
parent
b9eb9a74
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
16 deletions
+9
-16
device.c
dlls/ddraw/device.c
+1
-9
executebuffer.c
dlls/ddraw/executebuffer.c
+2
-4
main.c
dlls/ddraw/main.c
+4
-0
surface.c
dlls/ddraw/surface.c
+2
-3
No files found.
dlls/ddraw/device.c
View file @
5a7ff3b4
...
...
@@ -319,14 +319,6 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
break
;
}
case
DDRAW_HANDLE_SURFACE
:
{
struct
ddraw_surface
*
surf
=
entry
->
object
;
FIXME
(
"Texture handle %#lx (%p) not unset properly.
\n
"
,
i
+
1
,
surf
);
surf
->
Handle
=
0
;
break
;
}
default:
FIXME
(
"Handle %#lx (%p) has unknown type %#x.
\n
"
,
i
+
1
,
entry
->
object
,
entry
->
type
);
break
;
...
...
@@ -2760,7 +2752,7 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface,
break
;
}
surf
=
ddraw_get_object
(
&
device
->
handle_table
,
value
-
1
,
DDRAW_HANDLE_SURFACE
);
surf
=
ddraw_get_object
(
NULL
,
value
-
1
,
DDRAW_HANDLE_SURFACE
);
if
(
!
surf
)
{
WARN
(
"Invalid texture handle.
\n
"
);
...
...
dlls/ddraw/executebuffer.c
View file @
5a7ff3b4
...
...
@@ -347,14 +347,12 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d
instr
+=
size
;
if
(
!
(
dst
=
ddraw_get_object
(
&
device
->
handle_table
,
ci
->
hDestTexture
-
1
,
DDRAW_HANDLE_SURFACE
)))
if
(
!
(
dst
=
ddraw_get_object
(
NULL
,
ci
->
hDestTexture
-
1
,
DDRAW_HANDLE_SURFACE
)))
{
WARN
(
"Invalid destination texture handle %#lx.
\n
"
,
ci
->
hDestTexture
);
continue
;
}
if
(
!
(
src
=
ddraw_get_object
(
&
device
->
handle_table
,
ci
->
hSrcTexture
-
1
,
DDRAW_HANDLE_SURFACE
)))
if
(
!
(
src
=
ddraw_get_object
(
NULL
,
ci
->
hSrcTexture
-
1
,
DDRAW_HANDLE_SURFACE
)))
{
WARN
(
"Invalid source texture handle %#lx.
\n
"
,
ci
->
hSrcTexture
);
continue
;
...
...
dlls/ddraw/main.c
View file @
5a7ff3b4
...
...
@@ -916,6 +916,10 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
WARN
(
"Material handle %#x (%p) not unset properly.
\n
"
,
i
+
1
,
entry
->
object
);
break
;
case
DDRAW_HANDLE_SURFACE
:
WARN
(
"Texture handle %#x (%p) not unset properly.
\n
"
,
i
+
1
,
entry
->
object
);
break
;
default:
WARN
(
"Handle %#x (%p) has unknown type %#x.
\n
"
,
i
+
1
,
entry
->
object
,
entry
->
type
);
break
;
...
...
dlls/ddraw/surface.c
View file @
5a7ff3b4
...
...
@@ -5441,7 +5441,6 @@ static HRESULT WINAPI d3d_texture2_GetHandle(IDirect3DTexture2 *iface,
IDirect3DDevice2
*
device
,
D3DTEXTUREHANDLE
*
handle
)
{
struct
ddraw_surface
*
surface
=
impl_from_IDirect3DTexture2
(
iface
);
struct
d3d_device
*
device_impl
=
unsafe_impl_from_IDirect3DDevice2
(
device
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
device
,
handle
);
...
...
@@ -5449,7 +5448,7 @@ static HRESULT WINAPI d3d_texture2_GetHandle(IDirect3DTexture2 *iface,
if
(
!
surface
->
Handle
)
{
DWORD
h
=
ddraw_allocate_handle
(
&
device_impl
->
handle_table
,
surface
,
DDRAW_HANDLE_SURFACE
);
DWORD
h
=
ddraw_allocate_handle
(
NULL
,
surface
,
DDRAW_HANDLE_SURFACE
);
if
(
h
==
DDRAW_INVALID_HANDLE
)
{
ERR
(
"Failed to allocate a texture handle.
\n
"
);
...
...
@@ -6060,7 +6059,7 @@ static void STDMETHODCALLTYPE ddraw_surface_wined3d_object_destroyed(void *paren
/* Having a texture handle set implies that the device still exists. */
if
(
surface
->
Handle
)
ddraw_free_handle
(
&
surface
->
ddraw
->
d3ddevice
->
handle_table
,
surface
->
Handle
-
1
,
DDRAW_HANDLE_SURFACE
);
ddraw_free_handle
(
NULL
,
surface
->
Handle
-
1
,
DDRAW_HANDLE_SURFACE
);
/* Reduce the ddraw surface count. */
list_remove
(
&
surface
->
surface_list_entry
);
...
...
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