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
25338601
Commit
25338601
authored
Mar 30, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Initialization functions don't allocate.
parent
a9e43cad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
26 deletions
+19
-26
buffer.c
dlls/wined3d/buffer.c
+10
-4
query.c
dlls/wined3d/query.c
+8
-21
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/buffer.c
View file @
25338601
...
@@ -798,15 +798,21 @@ static void buffer_sync_apple(struct wined3d_buffer *This, DWORD flags, const st
...
@@ -798,15 +798,21 @@ static void buffer_sync_apple(struct wined3d_buffer *This, DWORD flags, const st
if
(
!
This
->
query
)
if
(
!
This
->
query
)
{
{
HRESULT
hr
;
TRACE
(
"Creating event query for buffer %p
\n
"
,
This
);
TRACE
(
"Creating event query for buffer %p
\n
"
,
This
);
hr
=
wined3d_event_query_init
(
gl_info
,
&
This
->
query
);
if
(
!
wined3d_event_query_supported
(
gl_info
))
if
(
FAILED
(
hr
))
{
{
ERR
(
"Failed to create an event query, dropping async buffer locks
\n
"
);
FIXME
(
"Event queries not supported, dropping async buffer locks.
\n
"
);
goto
drop_query
;
goto
drop_query
;
}
}
This
->
query
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
This
->
query
));
if
(
!
This
->
query
)
{
ERR
(
"Failed to allocate event query memory, dropping async buffer locks.
\n
"
);
goto
drop_query
;
}
/* Since we don't know about old draws a glFinish is needed once */
/* Since we don't know about old draws a glFinish is needed once */
wglFinish
();
wglFinish
();
return
;
return
;
...
...
dlls/wined3d/query.c
View file @
25338601
...
@@ -27,22 +27,9 @@
...
@@ -27,22 +27,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
#define GLINFO_LOCATION (*gl_info)
#define GLINFO_LOCATION (*gl_info)
HRESULT
wined3d_event_query_init
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
wined3d_event_query
**
query
)
BOOL
wined3d_event_query_supported
(
const
struct
wined3d_gl_info
*
gl_info
)
{
{
struct
wined3d_event_query
*
ret
;
return
gl_info
->
supported
[
ARB_SYNC
]
||
gl_info
->
supported
[
NV_FENCE
]
||
gl_info
->
supported
[
APPLE_FENCE
];
*
query
=
NULL
;
if
(
!
gl_info
->
supported
[
ARB_SYNC
]
&&
!
gl_info
->
supported
[
NV_FENCE
]
&&
!
gl_info
->
supported
[
APPLE_FENCE
])
return
E_NOTIMPL
;
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
ret
));
if
(
!
ret
)
{
ERR
(
"Failed to allocate a wined3d event query structure.
\n
"
);
return
E_OUTOFMEMORY
;
}
ret
->
context
=
NULL
;
*
query
=
ret
;
return
WINED3D_OK
;
}
}
void
wined3d_event_query_destroy
(
struct
wined3d_event_query
*
query
)
void
wined3d_event_query_destroy
(
struct
wined3d_event_query
*
query
)
...
@@ -593,7 +580,6 @@ HRESULT query_init(IWineD3DQueryImpl *query, IWineD3DDeviceImpl *device,
...
@@ -593,7 +580,6 @@ HRESULT query_init(IWineD3DQueryImpl *query, IWineD3DDeviceImpl *device,
WINED3DQUERYTYPE
type
,
IUnknown
*
parent
)
WINED3DQUERYTYPE
type
,
IUnknown
*
parent
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
HRESULT
hr
;
switch
(
type
)
switch
(
type
)
{
{
...
@@ -616,9 +602,7 @@ HRESULT query_init(IWineD3DQueryImpl *query, IWineD3DDeviceImpl *device,
...
@@ -616,9 +602,7 @@ HRESULT query_init(IWineD3DQueryImpl *query, IWineD3DDeviceImpl *device,
case
WINED3DQUERYTYPE_EVENT
:
case
WINED3DQUERYTYPE_EVENT
:
TRACE
(
"Event query.
\n
"
);
TRACE
(
"Event query.
\n
"
);
query
->
lpVtbl
=
&
IWineD3DEventQuery_Vtbl
;
if
(
!
wined3d_event_query_supported
(
gl_info
))
hr
=
wined3d_event_query_init
(
gl_info
,
(
struct
wined3d_event_query
**
)
&
query
->
extendedData
);
if
(
hr
==
E_NOTIMPL
)
{
{
/* Half-Life 2 needs this query. It does not render the main
/* Half-Life 2 needs this query. It does not render the main
* menu correctly otherwise. Pretend to support it, faking
* menu correctly otherwise. Pretend to support it, faking
...
@@ -626,9 +610,12 @@ HRESULT query_init(IWineD3DQueryImpl *query, IWineD3DDeviceImpl *device,
...
@@ -626,9 +610,12 @@ HRESULT query_init(IWineD3DQueryImpl *query, IWineD3DDeviceImpl *device,
* lowering performance. */
* lowering performance. */
FIXME
(
"Event query: Unimplemented, but pretending to be supported.
\n
"
);
FIXME
(
"Event query: Unimplemented, but pretending to be supported.
\n
"
);
}
}
else
if
(
FAILED
(
hr
))
query
->
lpVtbl
=
&
IWineD3DEventQuery_Vtbl
;
query
->
extendedData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
wined3d_event_query
));
if
(
!
query
->
extendedData
)
{
{
return
hr
;
ERR
(
"Failed to allocate event query memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
}
break
;
break
;
...
...
dlls/wined3d/wined3d_private.h
View file @
25338601
...
@@ -1033,11 +1033,11 @@ enum wined3d_event_query_result
...
@@ -1033,11 +1033,11 @@ enum wined3d_event_query_result
WINED3D_EVENT_QUERY_ERROR
WINED3D_EVENT_QUERY_ERROR
};
};
HRESULT
wined3d_event_query_init
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
wined3d_event_query
**
query
)
DECLSPEC_HIDDEN
;
void
wined3d_event_query_destroy
(
struct
wined3d_event_query
*
query
)
DECLSPEC_HIDDEN
;
void
wined3d_event_query_destroy
(
struct
wined3d_event_query
*
query
)
DECLSPEC_HIDDEN
;
enum
wined3d_event_query_result
wined3d_event_query_test
(
struct
wined3d_event_query
*
query
,
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
enum
wined3d_event_query_result
wined3d_event_query_test
(
struct
wined3d_event_query
*
query
,
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
enum
wined3d_event_query_result
wined3d_event_query_finish
(
struct
wined3d_event_query
*
query
,
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
enum
wined3d_event_query_result
wined3d_event_query_finish
(
struct
wined3d_event_query
*
query
,
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
void
wined3d_event_query_issue
(
struct
wined3d_event_query
*
query
,
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
void
wined3d_event_query_issue
(
struct
wined3d_event_query
*
query
,
IWineD3DDeviceImpl
*
device
)
DECLSPEC_HIDDEN
;
HRESULT
wined3d_event_query_supported
(
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
struct
wined3d_context
struct
wined3d_context
{
{
...
...
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