Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
angle
Commits
ef21ab29
Commit
ef21ab29
authored
Oct 31, 2012
by
daniel@transgaming.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move query and sync support to Renderer
Trac #21727 git-svn-id:
https://angleproject.googlecode.com/svn/branches/dx11proto@1331
736b8ea6-26fd-11df-bfd4-992fa37f6226
parent
313e3924
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
137 additions
and
122 deletions
+137
-122
Display.cpp
src/libEGL/Display.cpp
+1
-87
Display.h
src/libEGL/Display.h
+0
-6
Context.cpp
src/libGLESv2/Context.cpp
+5
-5
Context.h
src/libGLESv2/Context.h
+1
-1
Fence.cpp
src/libGLESv2/Fence.cpp
+7
-5
Fence.h
src/libGLESv2/Fence.h
+4
-8
Query.cpp
src/libGLESv2/Query.cpp
+5
-4
Query.h
src/libGLESv2/Query.h
+5
-2
Renderer.cpp
src/libGLESv2/renderer/Renderer.cpp
+91
-3
Renderer.h
src/libGLESv2/renderer/Renderer.h
+18
-1
No files found.
src/libEGL/Display.cpp
View file @
ef21ab29
...
@@ -101,7 +101,7 @@ bool Display::initialize()
...
@@ -101,7 +101,7 @@ bool Display::initialize()
return
false
;
return
false
;
}
}
mRenderer
=
glCreateRenderer
(
hModule
,
mDc
);
mRenderer
=
glCreateRenderer
(
this
,
hModule
,
mDc
);
EGLint
status
=
EGL_BAD_ALLOC
;
EGLint
status
=
EGL_BAD_ALLOC
;
if
(
mRenderer
)
if
(
mRenderer
)
status
=
mRenderer
->
initialize
();
status
=
mRenderer
->
initialize
();
...
@@ -230,12 +230,6 @@ void Display::terminate()
...
@@ -230,12 +230,6 @@ void Display::terminate()
destroyContext
(
*
mContextSet
.
begin
());
destroyContext
(
*
mContextSet
.
begin
());
}
}
while
(
!
mEventQueryPool
.
empty
())
{
mEventQueryPool
.
back
()
->
Release
();
mEventQueryPool
.
pop_back
();
}
mVertexShaderCache
.
clear
();
mVertexShaderCache
.
clear
();
mPixelShaderCache
.
clear
();
mPixelShaderCache
.
clear
();
...
@@ -503,12 +497,6 @@ bool Display::restoreLostDevice()
...
@@ -503,12 +497,6 @@ bool Display::restoreLostDevice()
(
*
surface
)
->
release
();
(
*
surface
)
->
release
();
}
}
while
(
!
mEventQueryPool
.
empty
())
{
mEventQueryPool
.
back
()
->
Release
();
mEventQueryPool
.
pop_back
();
}
mVertexShaderCache
.
clear
();
mVertexShaderCache
.
clear
();
mPixelShaderCache
.
clear
();
mPixelShaderCache
.
clear
();
...
@@ -592,80 +580,6 @@ EGLint Display::getMaxSwapInterval()
...
@@ -592,80 +580,6 @@ EGLint Display::getMaxSwapInterval()
return
mMaxSwapInterval
;
return
mMaxSwapInterval
;
}
}
// D3D9_REPLACE
void
Display
::
sync
(
bool
block
)
{
HRESULT
result
;
IDirect3DQuery9
*
query
=
allocateEventQuery
();
if
(
!
query
)
{
return
;
}
result
=
query
->
Issue
(
D3DISSUE_END
);
ASSERT
(
SUCCEEDED
(
result
));
do
{
result
=
query
->
GetData
(
NULL
,
0
,
D3DGETDATA_FLUSH
);
if
(
block
&&
result
==
S_FALSE
)
{
// Keep polling, but allow other threads to do something useful first
Sleep
(
0
);
// explicitly check for device loss
// some drivers seem to return S_FALSE even if the device is lost
// instead of D3DERR_DEVICELOST like they should
if
(
mRenderer
->
testDeviceLost
())
{
result
=
D3DERR_DEVICELOST
;
}
}
}
while
(
block
&&
result
==
S_FALSE
);
freeEventQuery
(
query
);
if
(
isDeviceLostError
(
result
))
{
notifyDeviceLost
();
}
}
// D3D9_REPLACE
IDirect3DQuery9
*
Display
::
allocateEventQuery
()
{
IDirect3DQuery9
*
query
=
NULL
;
if
(
mEventQueryPool
.
empty
())
{
HRESULT
result
=
mRenderer
->
getDevice
()
->
CreateQuery
(
D3DQUERYTYPE_EVENT
,
&
query
);
ASSERT
(
SUCCEEDED
(
result
));
}
else
{
query
=
mEventQueryPool
.
back
();
mEventQueryPool
.
pop_back
();
}
return
query
;
}
// D3D9_REPLACE
void
Display
::
freeEventQuery
(
IDirect3DQuery9
*
query
)
{
if
(
mEventQueryPool
.
size
()
>
1000
)
{
query
->
Release
();
}
else
{
mEventQueryPool
.
push_back
(
query
);
}
}
void
Display
::
initExtensionString
()
void
Display
::
initExtensionString
()
{
{
HMODULE
swiftShader
=
GetModuleHandle
(
TEXT
(
"swiftshader_d3d9.dll"
));
HMODULE
swiftShader
=
GetModuleHandle
(
TEXT
(
"swiftshader_d3d9.dll"
));
...
...
src/libEGL/Display.h
View file @
ef21ab29
...
@@ -59,9 +59,6 @@ class Display
...
@@ -59,9 +59,6 @@ class Display
EGLint
getMaxSwapInterval
();
EGLint
getMaxSwapInterval
();
renderer
::
Renderer
*
getRenderer
()
{
return
mRenderer
;
};
renderer
::
Renderer
*
getRenderer
()
{
return
mRenderer
;
};
virtual
void
sync
(
bool
block
);
virtual
IDirect3DQuery9
*
allocateEventQuery
();
virtual
void
freeEventQuery
(
IDirect3DQuery9
*
query
);
virtual
void
notifyDeviceLost
();
virtual
void
notifyDeviceLost
();
...
@@ -80,9 +77,6 @@ class Display
...
@@ -80,9 +77,6 @@ class Display
EGLNativeDisplayType
mDisplayId
;
EGLNativeDisplayType
mDisplayId
;
const
HDC
mDc
;
const
HDC
mDc
;
// A pool of event queries that are currently unused.
std
::
vector
<
IDirect3DQuery9
*>
mEventQueryPool
;
VertexShaderCache
mVertexShaderCache
;
VertexShaderCache
mVertexShaderCache
;
PixelShaderCache
mPixelShaderCache
;
PixelShaderCache
mPixelShaderCache
;
...
...
src/libGLESv2/Context.cpp
View file @
ef21ab29
...
@@ -956,7 +956,7 @@ GLuint Context::createFence()
...
@@ -956,7 +956,7 @@ GLuint Context::createFence()
{
{
GLuint
handle
=
mFenceHandleAllocator
.
allocate
();
GLuint
handle
=
mFenceHandleAllocator
.
allocate
();
mFenceMap
[
handle
]
=
new
Fence
(
m
Display
);
mFenceMap
[
handle
]
=
new
Fence
(
m
Renderer
);
return
handle
;
return
handle
;
}
}
...
@@ -1344,7 +1344,7 @@ Query *Context::getQuery(unsigned int handle, bool create, GLenum type)
...
@@ -1344,7 +1344,7 @@ Query *Context::getQuery(unsigned int handle, bool create, GLenum type)
{
{
if
(
!
query
->
second
&&
create
)
if
(
!
query
->
second
&&
create
)
{
{
query
->
second
=
new
Query
(
handle
,
type
);
query
->
second
=
new
Query
(
mRenderer
,
handle
,
type
);
query
->
second
->
addRef
();
query
->
second
->
addRef
();
}
}
return
query
->
second
;
return
query
->
second
;
...
@@ -3212,7 +3212,7 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid
...
@@ -3212,7 +3212,7 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid
// Implements glFlush when block is false, glFinish when block is true
// Implements glFlush when block is false, glFinish when block is true
void
Context
::
sync
(
bool
block
)
void
Context
::
sync
(
bool
block
)
{
{
m
Display
->
sync
(
block
);
m
Renderer
->
sync
(
block
);
}
}
void
Context
::
drawLineLoop
(
GLsizei
count
,
GLenum
type
,
const
GLvoid
*
indices
,
int
minIndex
)
void
Context
::
drawLineLoop
(
GLsizei
count
,
GLenum
type
,
const
GLvoid
*
indices
,
int
minIndex
)
...
@@ -4500,9 +4500,9 @@ gl::Context *glGetCurrentContext()
...
@@ -4500,9 +4500,9 @@ gl::Context *glGetCurrentContext()
return
gl
::
getContext
();
return
gl
::
getContext
();
}
}
renderer
::
Renderer
*
glCreateRenderer
(
HMODULE
hModule
,
HDC
hDc
)
renderer
::
Renderer
*
glCreateRenderer
(
egl
::
Display
*
display
,
HMODULE
hModule
,
HDC
hDc
)
{
{
return
new
renderer
::
Renderer
(
hModule
,
hDc
);
return
new
renderer
::
Renderer
(
display
,
hModule
,
hDc
);
}
}
void
glDestroyRenderer
(
renderer
::
Renderer
*
renderer
)
void
glDestroyRenderer
(
renderer
::
Renderer
*
renderer
)
...
...
src/libGLESv2/Context.h
View file @
ef21ab29
...
@@ -680,7 +680,7 @@ gl::Context *glCreateContext(const egl::Config *config, const gl::Context *share
...
@@ -680,7 +680,7 @@ gl::Context *glCreateContext(const egl::Config *config, const gl::Context *share
void
glDestroyContext
(
gl
::
Context
*
context
);
void
glDestroyContext
(
gl
::
Context
*
context
);
void
glMakeCurrent
(
gl
::
Context
*
context
,
egl
::
Display
*
display
,
egl
::
Surface
*
surface
);
void
glMakeCurrent
(
gl
::
Context
*
context
,
egl
::
Display
*
display
,
egl
::
Surface
*
surface
);
gl
::
Context
*
glGetCurrentContext
();
gl
::
Context
*
glGetCurrentContext
();
renderer
::
Renderer
*
glCreateRenderer
(
HMODULE
hModule
,
HDC
hDc
);
renderer
::
Renderer
*
glCreateRenderer
(
egl
::
Display
*
display
,
HMODULE
hModule
,
HDC
hDc
);
void
glDestroyRenderer
(
renderer
::
Renderer
*
renderer
);
void
glDestroyRenderer
(
renderer
::
Renderer
*
renderer
);
__eglMustCastToProperFunctionPointerType
__stdcall
glGetProcAddress
(
const
char
*
procname
);
__eglMustCastToProperFunctionPointerType
__stdcall
glGetProcAddress
(
const
char
*
procname
);
...
...
src/libGLESv2/Fence.cpp
View file @
ef21ab29
...
@@ -13,9 +13,9 @@
...
@@ -13,9 +13,9 @@
namespace
gl
namespace
gl
{
{
Fence
::
Fence
(
egl
::
Display
*
display
)
Fence
::
Fence
(
renderer
::
Renderer
*
renderer
)
{
{
m
Display
=
display
;
m
Renderer
=
renderer
;
mQuery
=
NULL
;
mQuery
=
NULL
;
mCondition
=
GL_NONE
;
mCondition
=
GL_NONE
;
mStatus
=
GL_FALSE
;
mStatus
=
GL_FALSE
;
...
@@ -25,7 +25,7 @@ Fence::~Fence()
...
@@ -25,7 +25,7 @@ Fence::~Fence()
{
{
if
(
mQuery
!=
NULL
)
if
(
mQuery
!=
NULL
)
{
{
m
Display
->
freeEventQuery
(
mQuery
);
m
Renderer
->
freeEventQuery
(
mQuery
);
}
}
}
}
...
@@ -36,11 +36,12 @@ GLboolean Fence::isFence()
...
@@ -36,11 +36,12 @@ GLboolean Fence::isFence()
return
mQuery
!=
NULL
;
return
mQuery
!=
NULL
;
}
}
// D3D9_REPLACE
void
Fence
::
setFence
(
GLenum
condition
)
void
Fence
::
setFence
(
GLenum
condition
)
{
{
if
(
!
mQuery
)
if
(
!
mQuery
)
{
{
mQuery
=
m
Display
->
allocateEventQuery
();
mQuery
=
m
Renderer
->
allocateEventQuery
();
if
(
!
mQuery
)
if
(
!
mQuery
)
{
{
return
error
(
GL_OUT_OF_MEMORY
);
return
error
(
GL_OUT_OF_MEMORY
);
...
@@ -54,6 +55,7 @@ void Fence::setFence(GLenum condition)
...
@@ -54,6 +55,7 @@ void Fence::setFence(GLenum condition)
mStatus
=
GL_FALSE
;
mStatus
=
GL_FALSE
;
}
}
// D3D9_REPLACE
GLboolean
Fence
::
testFence
()
GLboolean
Fence
::
testFence
()
{
{
if
(
mQuery
==
NULL
)
if
(
mQuery
==
NULL
)
...
@@ -106,7 +108,7 @@ void Fence::getFenceiv(GLenum pname, GLint *params)
...
@@ -106,7 +108,7 @@ void Fence::getFenceiv(GLenum pname, GLint *params)
return
;
return
;
}
}
HRESULT
result
=
mQuery
->
GetData
(
NULL
,
0
,
0
);
HRESULT
result
=
mQuery
->
GetData
(
NULL
,
0
,
0
);
// D3D9_REPLACE
if
(
checkDeviceLost
(
result
))
if
(
checkDeviceLost
(
result
))
{
{
...
...
src/libGLESv2/Fence.h
View file @
ef21ab29
...
@@ -14,11 +14,7 @@
...
@@ -14,11 +14,7 @@
#include <d3d9.h>
#include <d3d9.h>
#include "common/angleutils.h"
#include "common/angleutils.h"
#include "libGLESv2/renderer/Renderer.h"
namespace
egl
{
class
Display
;
}
namespace
gl
namespace
gl
{
{
...
@@ -26,7 +22,7 @@ namespace gl
...
@@ -26,7 +22,7 @@ namespace gl
class
Fence
class
Fence
{
{
public
:
public
:
explicit
Fence
(
egl
::
Display
*
display
);
explicit
Fence
(
renderer
::
Renderer
*
renderer
);
virtual
~
Fence
();
virtual
~
Fence
();
GLboolean
isFence
();
GLboolean
isFence
();
...
@@ -38,8 +34,8 @@ class Fence
...
@@ -38,8 +34,8 @@ class Fence
private
:
private
:
DISALLOW_COPY_AND_ASSIGN
(
Fence
);
DISALLOW_COPY_AND_ASSIGN
(
Fence
);
egl
::
Display
*
mDisplay
;
renderer
::
Renderer
*
mRenderer
;
IDirect3DQuery9
*
mQuery
;
IDirect3DQuery9
*
mQuery
;
// D3D9_REPLACE
GLenum
mCondition
;
GLenum
mCondition
;
GLboolean
mStatus
;
GLboolean
mStatus
;
};
};
...
...
src/libGLESv2/Query.cpp
View file @
ef21ab29
...
@@ -13,8 +13,9 @@
...
@@ -13,8 +13,9 @@
namespace
gl
namespace
gl
{
{
Query
::
Query
(
GLuint
id
,
GLenum
type
)
:
RefCountObject
(
id
)
Query
::
Query
(
renderer
::
Renderer
*
renderer
,
GLuint
id
,
GLenum
type
)
:
RefCountObject
(
id
)
{
{
mRenderer
=
renderer
;
mQuery
=
NULL
;
mQuery
=
NULL
;
mStatus
=
GL_FALSE
;
mStatus
=
GL_FALSE
;
mResult
=
GL_FALSE
;
mResult
=
GL_FALSE
;
...
@@ -35,7 +36,7 @@ void Query::begin()
...
@@ -35,7 +36,7 @@ void Query::begin()
if
(
mQuery
==
NULL
)
if
(
mQuery
==
NULL
)
{
{
// D3D9_REPLACE
// D3D9_REPLACE
if
(
FAILED
(
getDevice
()
->
CreateQuery
(
D3DQUERYTYPE_OCCLUSION
,
&
mQuery
)))
if
(
FAILED
(
mRenderer
->
getDevice
()
->
CreateQuery
(
D3DQUERYTYPE_OCCLUSION
,
&
mQuery
)))
{
{
return
error
(
GL_OUT_OF_MEMORY
);
return
error
(
GL_OUT_OF_MEMORY
);
}
}
...
@@ -69,9 +70,9 @@ GLuint Query::getResult()
...
@@ -69,9 +70,9 @@ GLuint Query::getResult()
// explicitly check for device loss
// explicitly check for device loss
// some drivers seem to return S_FALSE even if the device is lost
// some drivers seem to return S_FALSE even if the device is lost
// instead of D3DERR_DEVICELOST like they should
// instead of D3DERR_DEVICELOST like they should
if
(
gl
::
getDisplay
()
->
getRenderer
()
->
testDeviceLost
())
// D3D9_REPLACE
if
(
mRenderer
->
testDeviceLost
())
{
{
gl
::
getDisplay
()
->
notifyDeviceLost
();
gl
::
getDisplay
()
->
notifyDeviceLost
();
// D3D9_REPLACE
return
error
(
GL_OUT_OF_MEMORY
,
0
);
return
error
(
GL_OUT_OF_MEMORY
,
0
);
}
}
}
}
...
...
src/libGLESv2/Query.h
View file @
ef21ab29
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include "common/angleutils.h"
#include "common/angleutils.h"
#include "common/RefCountObject.h"
#include "common/RefCountObject.h"
#include "libGLESv2/renderer/Renderer.h"
namespace
gl
namespace
gl
{
{
...
@@ -22,7 +23,7 @@ namespace gl
...
@@ -22,7 +23,7 @@ namespace gl
class
Query
:
public
RefCountObject
class
Query
:
public
RefCountObject
{
{
public
:
public
:
Query
(
GLuint
id
,
GLenum
type
);
Query
(
renderer
::
Renderer
*
renderer
,
GLuint
id
,
GLenum
type
);
virtual
~
Query
();
virtual
~
Query
();
void
begin
();
void
begin
();
...
@@ -35,9 +36,11 @@ class Query : public RefCountObject
...
@@ -35,9 +36,11 @@ class Query : public RefCountObject
private
:
private
:
DISALLOW_COPY_AND_ASSIGN
(
Query
);
DISALLOW_COPY_AND_ASSIGN
(
Query
);
renderer
::
Renderer
*
mRenderer
;
GLboolean
testQuery
();
GLboolean
testQuery
();
IDirect3DQuery9
*
mQuery
;
IDirect3DQuery9
*
mQuery
;
// D3D9_REPLACE
GLenum
mType
;
GLenum
mType
;
GLboolean
mStatus
;
GLboolean
mStatus
;
GLint
mResult
;
GLint
mResult
;
...
...
src/libGLESv2/renderer/Renderer.cpp
View file @
ef21ab29
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
#include "common/debug.h"
#include "common/debug.h"
#include "libGLESv2/utilities.h"
#include "libGLESv2/utilities.h"
#include "libEGL/Display.h"
// Can also be enabled by defining FORCE_REF_RAST in the project's predefined macros
// Can also be enabled by defining FORCE_REF_RAST in the project's predefined macros
#define REF_RAST 0
#define REF_RAST 0
...
@@ -25,8 +27,9 @@
...
@@ -25,8 +27,9 @@
namespace
renderer
namespace
renderer
{
{
Renderer
::
Renderer
(
HMODULE
hModule
,
HDC
hDc
)
:
mDc
(
hDc
)
Renderer
::
Renderer
(
egl
::
Display
*
display
,
HMODULE
hModule
,
HDC
hDc
)
:
mDc
(
hDc
)
{
{
mDisplay
=
display
;
mD3d9Module
=
hModule
;
mD3d9Module
=
hModule
;
mD3d9
=
NULL
;
mD3d9
=
NULL
;
...
@@ -48,6 +51,8 @@ Renderer::Renderer(HMODULE hModule, HDC hDc): mDc(hDc)
...
@@ -48,6 +51,8 @@ Renderer::Renderer(HMODULE hModule, HDC hDc): mDc(hDc)
Renderer
::~
Renderer
()
Renderer
::~
Renderer
()
{
{
releaseDeviceResources
();
if
(
mDevice
)
if
(
mDevice
)
{
{
// If the device is lost, reset it first to prevent leaving the driver in an unstable state
// If the device is lost, reset it first to prevent leaving the driver in an unstable state
...
@@ -266,6 +271,89 @@ void Renderer::endScene()
...
@@ -266,6 +271,89 @@ void Renderer::endScene()
}
}
}
}
// D3D9_REPLACE
void
Renderer
::
sync
(
bool
block
)
{
HRESULT
result
;
IDirect3DQuery9
*
query
=
allocateEventQuery
();
if
(
!
query
)
{
return
;
}
result
=
query
->
Issue
(
D3DISSUE_END
);
ASSERT
(
SUCCEEDED
(
result
));
do
{
result
=
query
->
GetData
(
NULL
,
0
,
D3DGETDATA_FLUSH
);
if
(
block
&&
result
==
S_FALSE
)
{
// Keep polling, but allow other threads to do something useful first
Sleep
(
0
);
// explicitly check for device loss
// some drivers seem to return S_FALSE even if the device is lost
// instead of D3DERR_DEVICELOST like they should
if
(
testDeviceLost
())
{
result
=
D3DERR_DEVICELOST
;
}
}
}
while
(
block
&&
result
==
S_FALSE
);
freeEventQuery
(
query
);
if
(
isDeviceLostError
(
result
))
{
mDisplay
->
notifyDeviceLost
();
}
}
// D3D9_REPLACE
IDirect3DQuery9
*
Renderer
::
allocateEventQuery
()
{
IDirect3DQuery9
*
query
=
NULL
;
if
(
mEventQueryPool
.
empty
())
{
HRESULT
result
=
mDevice
->
CreateQuery
(
D3DQUERYTYPE_EVENT
,
&
query
);
ASSERT
(
SUCCEEDED
(
result
));
}
else
{
query
=
mEventQueryPool
.
back
();
mEventQueryPool
.
pop_back
();
}
return
query
;
}
// D3D9_REPLACE
void
Renderer
::
freeEventQuery
(
IDirect3DQuery9
*
query
)
{
if
(
mEventQueryPool
.
size
()
>
1000
)
{
query
->
Release
();
}
else
{
mEventQueryPool
.
push_back
(
query
);
}
}
void
Renderer
::
releaseDeviceResources
()
{
while
(
!
mEventQueryPool
.
empty
())
{
mEventQueryPool
.
back
()
->
Release
();
mEventQueryPool
.
pop_back
();
}
}
void
Renderer
::
markDeviceLost
()
void
Renderer
::
markDeviceLost
()
{
{
mDeviceLost
=
true
;
mDeviceLost
=
true
;
...
@@ -331,6 +419,8 @@ bool Renderer::testDeviceResettable()
...
@@ -331,6 +419,8 @@ bool Renderer::testDeviceResettable()
bool
Renderer
::
resetDevice
()
bool
Renderer
::
resetDevice
()
{
{
releaseDeviceResources
();
D3DPRESENT_PARAMETERS
presentParameters
=
getDefaultPresentParameters
();
D3DPRESENT_PARAMETERS
presentParameters
=
getDefaultPresentParameters
();
HRESULT
result
=
D3D_OK
;
HRESULT
result
=
D3D_OK
;
...
@@ -511,7 +601,6 @@ float Renderer::getTextureFilterAnisotropySupport() const
...
@@ -511,7 +601,6 @@ float Renderer::getTextureFilterAnisotropySupport() const
bool
Renderer
::
getEventQuerySupport
()
bool
Renderer
::
getEventQuerySupport
()
{
{
#if 0 // D3D9_REPLACE
IDirect3DQuery9
*
query
=
allocateEventQuery
();
IDirect3DQuery9
*
query
=
allocateEventQuery
();
if
(
query
)
if
(
query
)
{
{
...
@@ -522,7 +611,6 @@ bool Renderer::getEventQuerySupport()
...
@@ -522,7 +611,6 @@ bool Renderer::getEventQuerySupport()
{
{
return
false
;
return
false
;
}
}
#endif
return
true
;
return
true
;
}
}
...
...
src/libGLESv2/renderer/Renderer.h
View file @
ef21ab29
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
#ifndef LIBGLESV2_RENDERER_RENDERER_H_
#ifndef LIBGLESV2_RENDERER_RENDERER_H_
#define LIBGLESV2_RENDERER_RENDERER_H_
#define LIBGLESV2_RENDERER_RENDERER_H_
#include <set>
#include <vector>
#include "common/angleutils.h"
#include "common/angleutils.h"
#define GL_APICALL
#define GL_APICALL
#include <GLES2/gl2.h>
#include <GLES2/gl2.h>
...
@@ -32,13 +35,18 @@ inline int getComparableOSVersion()
...
@@ -32,13 +35,18 @@ inline int getComparableOSVersion()
return
MAKEWORD
(
minorVersion
,
majorVersion
);
return
MAKEWORD
(
minorVersion
,
majorVersion
);
}
}
namespace
egl
{
class
Display
;
}
namespace
renderer
namespace
renderer
{
{
class
Renderer
class
Renderer
{
{
public
:
public
:
Renderer
(
HMODULE
hModule
,
HDC
hDc
);
Renderer
(
egl
::
Display
*
display
,
HMODULE
hModule
,
HDC
hDc
);
virtual
~
Renderer
();
virtual
~
Renderer
();
virtual
EGLint
initialize
();
virtual
EGLint
initialize
();
...
@@ -47,6 +55,10 @@ class Renderer
...
@@ -47,6 +55,10 @@ class Renderer
virtual
void
startScene
();
virtual
void
startScene
();
virtual
void
endScene
();
virtual
void
endScene
();
virtual
void
sync
(
bool
block
);
virtual
IDirect3DQuery9
*
allocateEventQuery
();
virtual
void
freeEventQuery
(
IDirect3DQuery9
*
query
);
#if 0
#if 0
// resource creation
// resource creation
virtual void *createVertexShader(const DWORD *function, size_t length);
virtual void *createVertexShader(const DWORD *function, size_t length);
...
@@ -103,11 +115,13 @@ class Renderer
...
@@ -103,11 +115,13 @@ class Renderer
private
:
private
:
DISALLOW_COPY_AND_ASSIGN
(
Renderer
);
DISALLOW_COPY_AND_ASSIGN
(
Renderer
);
egl
::
Display
*
mDisplay
;
const
HDC
mDc
;
const
HDC
mDc
;
HMODULE
mD3d9Module
;
HMODULE
mD3d9Module
;
void
initializeDevice
();
void
initializeDevice
();
D3DPRESENT_PARAMETERS
getDefaultPresentParameters
();
D3DPRESENT_PARAMETERS
getDefaultPresentParameters
();
void
releaseDeviceResources
();
UINT
mAdapter
;
UINT
mAdapter
;
D3DDEVTYPE
mDeviceType
;
D3DDEVTYPE
mDeviceType
;
...
@@ -124,6 +138,9 @@ class Renderer
...
@@ -124,6 +138,9 @@ class Renderer
bool
mSceneStarted
;
bool
mSceneStarted
;
bool
mSupportsNonPower2Textures
;
bool
mSupportsNonPower2Textures
;
// A pool of event queries that are currently unused.
std
::
vector
<
IDirect3DQuery9
*>
mEventQueryPool
;
};
};
}
}
...
...
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