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
53663891
Commit
53663891
authored
Jul 25, 2006
by
H. Verbeet
Committed by
Alexandre Julliard
Jul 25, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add real occlusion query support.
parent
8c981140
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
17 deletions
+51
-17
device.c
dlls/wined3d/device.c
+3
-2
query.c
dlls/wined3d/query.c
+41
-14
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
wined3d_gl.h
include/wine/wined3d_gl.h
+6
-0
No files found.
dlls/wined3d/device.c
View file @
53663891
...
...
@@ -1390,7 +1390,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
switch
(
Type
)
{
case
WINED3DQUERYTYPE_OCCLUSION
:
TRACE
(
"(%p) occlusion query
\n
"
,
This
);
if
(
GL_SUPPORT
(
ARB_OCCLUSION_QUERY
)
||
GL_SUPPORT
(
NV_OCCLUSION_QUERY
)
)
if
(
GL_SUPPORT
(
ARB_OCCLUSION_QUERY
))
hr
=
WINED3D_OK
;
else
WARN
(
"Unsupported in local OpenGL implementation: ARB_OCCLUSION_QUERY/NV_OCCLUSION_QUERY
\n
"
);
...
...
@@ -1419,9 +1419,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
/* allocated the 'extended' data based on the type of query requested */
switch
(
Type
){
case
D3DQUERYTYPE_OCCLUSION
:
if
(
GL_SUPPORT
(
ARB_OCCLUSION_QUERY
)
||
GL_SUPPORT
(
NV_OCCLUSION_QUERY
)
)
{
if
(
GL_SUPPORT
(
ARB_OCCLUSION_QUERY
))
{
TRACE
(
"(%p) Allocating data for an occlusion query
\n
"
,
This
);
object
->
extendedData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
WineQueryOcclusionData
));
GL_EXTCALL
(
glGenQueriesARB
(
1
,
&
((
WineQueryOcclusionData
*
)(
object
->
extendedData
))
->
queryId
));
break
;
}
case
D3DQUERYTYPE_VCACHE
:
...
...
dlls/wined3d/query.c
View file @
53663891
...
...
@@ -25,10 +25,15 @@
#include "wined3d_private.h"
/*
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/programmingguide/advancedtopics/Queries.asp
*/
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/programmingguide/advancedtopics/Queries.asp
*
* Occlusion Queries:
* http://www.gris.uni-tuebingen.de/~bartz/Publications/paper/hww98.pdf
* http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt
*/
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
#define GLINFO_LOCATION ((IWineD3DImpl *)(((IWineD3DDeviceImpl *)This->wineD3DDevice)->wineD3D))->gl_info
/* *******************************************
IWineD3DQuery IUnknown parts follow
...
...
@@ -89,6 +94,9 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetDevice(IWineD3DQuery* iface, IWineD3
static
HRESULT
WINAPI
IWineD3DQueryImpl_GetData
(
IWineD3DQuery
*
iface
,
void
*
pData
,
DWORD
dwSize
,
DWORD
dwGetDataFlags
){
IWineD3DQueryImpl
*
This
=
(
IWineD3DQueryImpl
*
)
iface
;
TRACE
(
"(%p) : type %#x, pData %p, dwSize %#lx, dwGetDataFlags %#lx
\n
"
,
This
,
This
->
type
,
pData
,
dwSize
,
dwGetDataFlags
);
if
(
dwSize
==
0
){
/*you can use this method to poll the resource for the query status*/
/*We return success(S_OK) if we support a feature, and faikure(S_FALSE) if we don't, just return success and fluff it for now*/
...
...
@@ -148,12 +156,15 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa
case
WINED3DQUERYTYPE_OCCLUSION
:
{
DWORD
*
data
=
pData
;
*
data
=
1
;
/* TODO: opengl occlusion queries
http://www.gris.uni-tuebingen.de/~bartz/Publications/paper/hww98.pdf
http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt
http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt
*/
if
(
GL_SUPPORT
(
ARB_OCCLUSION_QUERY
))
{
GLint
samples
;
GL_EXTCALL
(
glGetQueryObjectivARB
(((
WineQueryOcclusionData
*
)
This
->
extendedData
)
->
queryId
,
GL_QUERY_RESULT_ARB
,
&
samples
));
TRACE
(
"(%p) : Returning %d samples.
\n
"
,
This
,
samples
);
*
data
=
samples
;
}
else
{
FIXME
(
"(%p) : Occlusion queries not supported. Returning 1.
\n
"
,
This
);
*
data
=
1
;
}
}
break
;
case
WINED3DQUERYTYPE_TIMESTAMP
:
...
...
@@ -263,11 +274,6 @@ static DWORD WINAPI IWineD3DQueryImpl_GetDataSize(IWineD3DQuery* iface){
break
;
case
WINED3DQUERYTYPE_OCCLUSION
:
dataSize
=
sizeof
(
DWORD
);
/*
http://www.gris.uni-tuebingen.de/~bartz/Publications/paper/hww98.pdf
http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt
http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt
*/
break
;
case
WINED3DQUERYTYPE_TIMESTAMP
:
dataSize
=
sizeof
(
UINT64
);
...
...
@@ -312,7 +318,28 @@ static WINED3DQUERYTYPE WINAPI IWineD3DQueryImpl_GetType(IWineD3DQuery* iface){
static
HRESULT
WINAPI
IWineD3DQueryImpl_Issue
(
IWineD3DQuery
*
iface
,
DWORD
dwIssueFlags
){
IWineD3DQueryImpl
*
This
=
(
IWineD3DQueryImpl
*
)
iface
;
FIXME
(
"(%p) : stub
\n
"
,
This
);
TRACE
(
"(%p) : dwIssueFlags %#lx, type %#x
\n
"
,
This
,
dwIssueFlags
,
This
->
type
);
switch
(
This
->
type
)
{
case
WINED3DQUERYTYPE_OCCLUSION
:
if
(
GL_SUPPORT
(
ARB_OCCLUSION_QUERY
))
{
if
(
dwIssueFlags
&
D3DISSUE_BEGIN
)
{
GL_EXTCALL
(
glBeginQueryARB
(
GL_SAMPLES_PASSED_ARB
,
((
WineQueryOcclusionData
*
)
This
->
extendedData
)
->
queryId
));
}
if
(
dwIssueFlags
&
D3DISSUE_END
)
{
GL_EXTCALL
(
glEndQueryARB
(
GL_SAMPLES_PASSED_ARB
));
}
}
else
{
FIXME
(
"(%p) : Occlusion queries not supported
\n
"
,
This
);
}
break
;
default
:
FIXME
(
"(%p) : Unhandled query type %#x
\n
"
,
This
,
This
->
type
);
break
;
}
return
WINED3D_OK
;
/* can be WINED3DERR_INVALIDCALL. */
}
...
...
dlls/wined3d/wined3d_private.h
View file @
53663891
...
...
@@ -1160,7 +1160,7 @@ extern const IWineD3DQueryVtbl IWineD3DQuery_Vtbl;
/* Datastructures for IWineD3DQueryImpl.extendedData */
typedef
struct
WineQueryOcclusionData
{
unsigned
int
queryId
;
GLuint
queryId
;
}
WineQueryOcclusionData
;
...
...
include/wine/wined3d_gl.h
View file @
53663891
...
...
@@ -1417,6 +1417,12 @@ typedef enum _GL_SupportedExt {
USE_GL_FUNC(WINED3D_PFNGLMULTITEXCOORD2FARBPROC, glMultiTexCoord2fARB); \
USE_GL_FUNC(WINED3D_PFNGLMULTITEXCOORD3FARBPROC, glMultiTexCoord3fARB); \
USE_GL_FUNC(WINED3D_PFNGLMULTITEXCOORD4FARBPROC, glMultiTexCoord4fARB); \
/* GL_ARB_occlusion_query */
\
USE_GL_FUNC(PGLFNGENQUERIESARBPROC, glGenQueriesARB); \
USE_GL_FUNC(PGLFNDELETEQUERIESARBPROC, glDeleteQueriesARB); \
USE_GL_FUNC(PGLFNBEGINQUERYARBPROC, glBeginQueryARB); \
USE_GL_FUNC(PGLFNENDQUERYARBPROC, glEndQueryARB); \
USE_GL_FUNC(PGLFNGETQUERYOBJECTIVARBPROC, glGetQueryObjectivARB); \
/* GL_ARB_point_parameters */
\
USE_GL_FUNC(PGLFNGLPOINTPARAMETERFARBPROC, glPointParameterfARB); \
USE_GL_FUNC(PGLFNGLPOINTPARAMETERFVARBPROC, glPointParameterfvARB); \
...
...
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