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
95efeb7e
Commit
95efeb7e
authored
Mar 01, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Support GL_APPLE_fence for event queries.
parent
76b60b05
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
13 deletions
+65
-13
device.c
dlls/wined3d/device.c
+6
-2
directx.c
dlls/wined3d/directx.c
+14
-2
query.c
dlls/wined3d/query.c
+21
-9
wined3d_gl.h
include/wine/wined3d_gl.h
+24
-0
No files found.
dlls/wined3d/device.c
View file @
95efeb7e
...
...
@@ -1075,7 +1075,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
break
;
case
WINED3DQUERYTYPE_EVENT
:
if
(
!
GL_SUPPORT
(
NV_FENCE
))
{
if
(
!
(
GL_SUPPORT
(
NV_FENCE
)
||
GL_SUPPORT
(
APPLE_FENCE
)
))
{
/* Half-Life 2 needs this query. It does not render the main menu correctly otherwise
* Pretend to support it, faking this query does not do much harm except potentially lowering performance
*/
...
...
@@ -1116,7 +1116,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
}
case
WINED3DQUERYTYPE_EVENT
:
/* TODO: GL_APPLE_fence */
if
(
GL_SUPPORT
(
NV_FENCE
))
{
if
(
GL_SUPPORT
(
APPLE_FENCE
))
{
object
->
extendedData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
WineQueryEventData
));
GL_EXTCALL
(
glGenFencesAPPLE
(
1
,
&
((
WineQueryEventData
*
)(
object
->
extendedData
))
->
fenceId
));
checkGLcall
(
"glGenFencesAPPLE"
);
}
else
if
(
GL_SUPPORT
(
NV_FENCE
))
{
object
->
extendedData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
WineQueryEventData
));
GL_EXTCALL
(
glGenFencesNV
(
1
,
&
((
WineQueryEventData
*
)(
object
->
extendedData
))
->
fenceId
));
checkGLcall
(
"glGenFencesNV"
);
...
...
dlls/wined3d/directx.c
View file @
95efeb7e
...
...
@@ -788,7 +788,9 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display) {
TRACE_
(
d3d_caps
)(
" FOUND: NVIDIA (NV) Vertex Shader support - version=%02x
\n
"
,
gl_info
->
vs_nv_version
);
gl_info
->
supported
[
NV_VERTEX_PROGRAM
]
=
TRUE
;
}
else
if
(
strstr
(
ThisExtn
,
"GL_NV_fence"
))
{
gl_info
->
supported
[
NV_FENCE
]
=
TRUE
;
if
(
!
gl_info
->
supported
[
APPLE_FENCE
])
{
gl_info
->
supported
[
NV_FENCE
]
=
TRUE
;
}
/**
* ATI
...
...
@@ -807,9 +809,19 @@ BOOL IWineD3DImpl_FillGLCaps(IWineD3D *iface, Display* display) {
gl_info
->
vs_ati_version
=
VS_VERSION_11
;
TRACE_
(
d3d_caps
)(
" FOUND: ATI (EXT) Vertex Shader support - version=%02x
\n
"
,
gl_info
->
vs_ati_version
);
gl_info
->
supported
[
EXT_VERTEX_SHADER
]
=
TRUE
;
/**
* Apple
*/
}
else
if
(
strstr
(
ThisExtn
,
"GL_APPLE_fence"
))
{
/* GL_NV_fence and GL_APPLE_fence provide the same functionality basically.
* The apple extension interacts with some other apple exts. Disable the NV
* extension if the apple one is support to prevent confusion in other parts
* of the code
*/
gl_info
->
supported
[
NV_FENCE
]
=
FALSE
;
gl_info
->
supported
[
APPLE_FENCE
]
=
TRUE
;
}
if
(
*
GL_Extensions
==
' '
)
GL_Extensions
++
;
}
}
...
...
dlls/wined3d/query.c
View file @
95efeb7e
...
...
@@ -65,9 +65,14 @@ static ULONG WINAPI IWineD3DQueryImpl_Release(IWineD3DQuery *iface) {
TRACE
(
"(%p) : Releasing from %d
\n
"
,
This
,
This
->
ref
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
if
(
This
->
type
==
WINED3DQUERYTYPE_EVENT
&&
GL_SUPPORT
(
NV_FENCE
))
{
GL_EXTCALL
(
glDeleteFencesNV
(
1
,
&
((
WineQueryEventData
*
)(
This
->
extendedData
))
->
fenceId
));
checkGLcall
(
"glDeleteFencesNV"
);
if
(
This
->
type
==
WINED3DQUERYTYPE_EVENT
)
{
if
(
GL_SUPPORT
(
APPLE_FENCE
))
{
GL_EXTCALL
(
glDeleteFencesAPPLE
(
1
,
&
((
WineQueryEventData
*
)(
This
->
extendedData
))
->
fenceId
));
checkGLcall
(
"glDeleteFencesAPPLE"
);
}
else
if
(
GL_SUPPORT
(
NV_FENCE
))
{
GL_EXTCALL
(
glDeleteFencesNV
(
1
,
&
((
WineQueryEventData
*
)(
This
->
extendedData
))
->
fenceId
));
checkGLcall
(
"glDeleteFencesNV"
);
}
}
else
if
(
This
->
type
==
WINED3DQUERYTYPE_OCCLUSION
&&
GL_SUPPORT
(
ARB_OCCLUSION_QUERY
))
{
GL_EXTCALL
(
glDeleteQueriesARB
(
1
,
&
((
WineQueryOcclusionData
*
)(
This
->
extendedData
))
->
queryId
));
checkGLcall
(
"glDeleteQueriesARB"
);
...
...
@@ -162,7 +167,10 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa
case
WINED3DQUERYTYPE_EVENT
:
{
BOOL
*
data
=
pData
;
if
(
GL_SUPPORT
(
NV_FENCE
))
{
if
(
GL_SUPPORT
(
APPLE_FENCE
))
{
*
data
=
GL_EXTCALL
(
glTestFenceAPPLE
(((
WineQueryEventData
*
)
This
->
extendedData
)
->
fenceId
));
checkGLcall
(
"glTestFenceAPPLE"
);
}
else
if
(
GL_SUPPORT
(
NV_FENCE
))
{
*
data
=
GL_EXTCALL
(
glTestFenceNV
(((
WineQueryEventData
*
)
This
->
extendedData
)
->
fenceId
));
checkGLcall
(
"glTestFenceNV"
);
}
else
{
...
...
@@ -381,13 +389,17 @@ static HRESULT WINAPI IWineD3DQueryImpl_Issue(IWineD3DQuery* iface, DWORD dwIs
break
;
case
WINED3DQUERYTYPE_EVENT
:
{
if
(
GL_SUPPORT
(
GL_NV_fence
))
{
if
(
dwIssueFlags
&
WINED3DISSUE_END
)
{
if
(
dwIssueFlags
&
WINED3DISSUE_END
)
{
if
(
GL_SUPPORT
(
APPLE_FENCE
))
{
GL_EXTCALL
(
glSetFenceAPPLE
(((
WineQueryEventData
*
)
This
->
extendedData
)
->
fenceId
));
checkGLcall
(
"glSetFenceAPPLE"
);
}
else
if
(
GL_SUPPORT
(
NV_FENCE
))
{
GL_EXTCALL
(
glSetFenceNV
(((
WineQueryEventData
*
)
This
->
extendedData
)
->
fenceId
,
GL_ALL_COMPLETED_NV
));
}
else
if
(
dwIssueFlags
&
WINED3DISSUE_BEGIN
)
{
/* Started implicitly at device creation */
ERR
(
"Event query issued with START flag - what to do?
\n
"
);
checkGLcall
(
"glSetFenceNV"
);
}
}
else
if
(
dwIssueFlags
&
WINED3DISSUE_BEGIN
)
{
/* Started implicitly at device creation */
ERR
(
"Event query issued with START flag - what to do?
\n
"
);
}
}
...
...
include/wine/wined3d_gl.h
View file @
95efeb7e
...
...
@@ -1146,6 +1146,19 @@ typedef GLboolean (APIENTRY * PGLFNTESTFENCENVPROC) (GLuint);
typedef
void
(
APIENTRY
*
PGLFNFINISHFENCENVPROC
)
(
GLuint
);
typedef
GLboolean
(
APIENTRY
*
PGLFNISFENCENVPROC
)
(
GLuint
);
typedef
void
(
APIENTRY
*
PGLFNGETFENCEIVNVPROC
)
(
GLuint
,
GLenum
,
GLint
*
);
/* GL_APPLE_fence */
#ifndef GL_NV_fence
#define GL_DRAW_PIXELS_APPLE 0x8A0A
#define GL_FENCE_APPLE 0x84F3
#endif
typedef
void
(
APIENTRY
*
PGLFNGENFENCESAPPLEPROC
)
(
GLsizei
,
GLuint
*
);
typedef
void
(
APIENTRY
*
PGLFNDELETEFENCESAPPLEPROC
)
(
GLuint
,
const
GLuint
*
);
typedef
void
(
APIENTRY
*
PGLFNSETFENCEAPPLEPROC
)
(
GLuint
);
typedef
GLboolean
(
APIENTRY
*
PGLFNTESTFENCEAPPLEPROC
)
(
GLuint
);
typedef
void
(
APIENTRY
*
PGLFNFINISHFENCEAPPLEPROC
)
(
GLuint
);
typedef
GLboolean
(
APIENTRY
*
PGLFNISFENCEAPPLEPROC
)
(
GLuint
);
typedef
GLboolean
(
APIENTRY
*
PGLFNTESTOBJECTAPPLEPROC
)
(
GLenum
,
GLuint
);
typedef
void
(
APIENTRY
*
PGLFNFINISHOBJECTAPPLEPROC
)
(
GLenum
,
GLuint
);
/* GL_VERSION_2_0 */
#ifndef GL_VERSION_2_0
...
...
@@ -1509,6 +1522,8 @@ typedef enum _GL_SupportedExt {
ATI_TEXTURE_ENV_COMBINE3
,
ATI_TEXTURE_MIRROR_ONCE
,
EXT_VERTEX_SHADER
,
/* APPLE */
APPLE_FENCE
,
OPENGL_SUPPORTED_EXT_END
}
GL_SupportedExt
;
...
...
@@ -1708,6 +1723,15 @@ typedef enum _GL_SupportedExt {
USE_GL_FUNC(PGLFNFINISHFENCENVPROC, glFinishFenceNV); \
USE_GL_FUNC(PGLFNISFENCENVPROC, glIsFenceNV); \
USE_GL_FUNC(PGLFNGETFENCEIVNVPROC, glGetFenceivNV); \
/* GL_APPLE_fence */
\
USE_GL_FUNC(PGLFNGENFENCESAPPLEPROC, glGenFencesAPPLE); \
USE_GL_FUNC(PGLFNDELETEFENCESAPPLEPROC, glDeleteFencesAPPLE); \
USE_GL_FUNC(PGLFNSETFENCEAPPLEPROC, glSetFenceAPPLE); \
USE_GL_FUNC(PGLFNTESTFENCEAPPLEPROC, glTestFenceAPPLE); \
USE_GL_FUNC(PGLFNFINISHFENCEAPPLEPROC, glFinishFenceAPPLE); \
USE_GL_FUNC(PGLFNISFENCEAPPLEPROC, glIsFenceAPPLE); \
USE_GL_FUNC(PGLFNTESTOBJECTAPPLEPROC, glTestObjectAPPLE); \
USE_GL_FUNC(PGLFNFINISHOBJECTAPPLEPROC, glFinishObjectAPPLE); \
/* OpenGL 2.0 functions */
#define GL2_FUNCS_GEN \
...
...
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