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
f688c0d1
Commit
f688c0d1
authored
Oct 31, 2012
by
daniel@transgaming.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make testDeviceLoss able to perform the notifications
Trac #21727 git-svn-id:
https://angleproject.googlecode.com/svn/branches/dx11proto@1332
736b8ea6-26fd-11df-bfd4-992fa37f6226
parent
ef21ab29
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
19 deletions
+20
-19
Display.cpp
src/libEGL/Display.cpp
+3
-3
libEGL.cpp
src/libEGL/libEGL.cpp
+1
-2
Context.cpp
src/libGLESv2/Context.cpp
+4
-6
Query.cpp
src/libGLESv2/Query.cpp
+1
-2
Renderer.cpp
src/libGLESv2/renderer/Renderer.cpp
+10
-5
Renderer.h
src/libGLESv2/renderer/Renderer.h
+1
-1
No files found.
src/libEGL/Display.cpp
View file @
f688c0d1
...
@@ -331,7 +331,7 @@ EGLSurface Display::createWindowSurface(HWND window, EGLConfig config, const EGL
...
@@ -331,7 +331,7 @@ EGLSurface Display::createWindowSurface(HWND window, EGLConfig config, const EGL
return
error
(
EGL_BAD_ALLOC
,
EGL_NO_SURFACE
);
return
error
(
EGL_BAD_ALLOC
,
EGL_NO_SURFACE
);
}
}
if
(
mRenderer
->
testDeviceLost
())
if
(
mRenderer
->
testDeviceLost
(
false
))
{
{
if
(
!
restoreLostDevice
())
if
(
!
restoreLostDevice
())
return
EGL_NO_SURFACE
;
return
EGL_NO_SURFACE
;
...
@@ -444,7 +444,7 @@ EGLSurface Display::createOffscreenSurface(EGLConfig config, HANDLE shareHandle,
...
@@ -444,7 +444,7 @@ EGLSurface Display::createOffscreenSurface(EGLConfig config, HANDLE shareHandle,
return
error
(
EGL_BAD_ATTRIBUTE
,
EGL_NO_SURFACE
);
return
error
(
EGL_BAD_ATTRIBUTE
,
EGL_NO_SURFACE
);
}
}
if
(
mRenderer
->
testDeviceLost
())
if
(
mRenderer
->
testDeviceLost
(
false
))
{
{
if
(
!
restoreLostDevice
())
if
(
!
restoreLostDevice
())
return
EGL_NO_SURFACE
;
return
EGL_NO_SURFACE
;
...
@@ -469,7 +469,7 @@ EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *sha
...
@@ -469,7 +469,7 @@ EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *sha
{
{
return
NULL
;
return
NULL
;
}
}
else
if
(
mRenderer
->
testDeviceLost
())
// Lost device
else
if
(
mRenderer
->
testDeviceLost
(
false
))
// Lost device
{
{
if
(
!
restoreLostDevice
())
if
(
!
restoreLostDevice
())
return
NULL
;
return
NULL
;
...
...
src/libEGL/libEGL.cpp
View file @
f688c0d1
...
@@ -884,9 +884,8 @@ EGLBoolean __stdcall eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface
...
@@ -884,9 +884,8 @@ EGLBoolean __stdcall eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface
}
}
renderer
::
Renderer
*
renderer
=
display
->
getRenderer
();
renderer
::
Renderer
*
renderer
=
display
->
getRenderer
();
if
(
renderer
->
testDeviceLost
())
if
(
renderer
->
testDeviceLost
(
true
))
{
{
display
->
notifyDeviceLost
();
return
EGL_FALSE
;
return
EGL_FALSE
;
}
}
...
...
src/libGLESv2/Context.cpp
View file @
f688c0d1
...
@@ -421,6 +421,7 @@ void Context::markDxUniformsDirty()
...
@@ -421,6 +421,7 @@ void Context::markDxUniformsDirty()
mDxUniformsDirty
=
true
;
mDxUniformsDirty
=
true
;
}
}
// NOTE: this function should not assume that this context is current!
void
Context
::
markContextLost
()
void
Context
::
markContextLost
()
{
{
if
(
mResetStrategy
==
GL_LOSE_CONTEXT_ON_RESET_EXT
)
if
(
mResetStrategy
==
GL_LOSE_CONTEXT_ON_RESET_EXT
)
...
@@ -3431,12 +3432,9 @@ GLenum Context::getResetStatus()
...
@@ -3431,12 +3432,9 @@ GLenum Context::getResetStatus()
{
{
if
(
mResetStatus
==
GL_NO_ERROR
)
if
(
mResetStatus
==
GL_NO_ERROR
)
{
{
bool
lost
=
mRenderer
->
testDeviceLost
();
// mResetStatus will be set by the markContextLost callback
// in the case a notification is sent
if
(
lost
)
mRenderer
->
testDeviceLost
(
true
);
{
mDisplay
->
notifyDeviceLost
();
// Sets mResetStatus
}
}
}
GLenum
status
=
mResetStatus
;
GLenum
status
=
mResetStatus
;
...
...
src/libGLESv2/Query.cpp
View file @
f688c0d1
...
@@ -70,9 +70,8 @@ GLuint Query::getResult()
...
@@ -70,9 +70,8 @@ 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
(
mRenderer
->
testDeviceLost
())
if
(
mRenderer
->
testDeviceLost
(
true
))
{
{
gl
::
getDisplay
()
->
notifyDeviceLost
();
// D3D9_REPLACE
return
error
(
GL_OUT_OF_MEMORY
,
0
);
return
error
(
GL_OUT_OF_MEMORY
,
0
);
}
}
}
}
...
...
src/libGLESv2/renderer/Renderer.cpp
View file @
f688c0d1
...
@@ -56,7 +56,7 @@ Renderer::~Renderer()
...
@@ -56,7 +56,7 @@ Renderer::~Renderer()
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
if
(
testDeviceLost
())
if
(
testDeviceLost
(
false
))
{
{
resetDevice
();
resetDevice
();
}
}
...
@@ -296,7 +296,7 @@ void Renderer::sync(bool block)
...
@@ -296,7 +296,7 @@ void Renderer::sync(bool block)
// 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
(
testDeviceLost
())
if
(
testDeviceLost
(
false
))
{
{
result
=
D3DERR_DEVICELOST
;
result
=
D3DERR_DEVICELOST
;
}
}
...
@@ -364,7 +364,8 @@ bool Renderer::isDeviceLost()
...
@@ -364,7 +364,8 @@ bool Renderer::isDeviceLost()
return
mDeviceLost
;
return
mDeviceLost
;
}
}
bool
Renderer
::
testDeviceLost
()
// set notify to true to broadcast a message to all contexts of the device loss
bool
Renderer
::
testDeviceLost
(
bool
notify
)
{
{
bool
isLost
=
false
;
bool
isLost
=
false
;
...
@@ -389,6 +390,10 @@ bool Renderer::testDeviceLost()
...
@@ -389,6 +390,10 @@ bool Renderer::testDeviceLost()
// Note that we don't want to clear the device loss status here
// Note that we don't want to clear the device loss status here
// -- this needs to be done by resetDevice
// -- this needs to be done by resetDevice
mDeviceLost
=
true
;
mDeviceLost
=
true
;
if
(
notify
)
{
mDisplay
->
notifyDeviceLost
();
}
}
}
return
isLost
;
return
isLost
;
...
@@ -424,7 +429,7 @@ bool Renderer::resetDevice()
...
@@ -424,7 +429,7 @@ bool Renderer::resetDevice()
D3DPRESENT_PARAMETERS
presentParameters
=
getDefaultPresentParameters
();
D3DPRESENT_PARAMETERS
presentParameters
=
getDefaultPresentParameters
();
HRESULT
result
=
D3D_OK
;
HRESULT
result
=
D3D_OK
;
bool
lost
=
testDeviceLost
();
bool
lost
=
testDeviceLost
(
false
);
int
attempts
=
3
;
int
attempts
=
3
;
while
(
lost
&&
attempts
>
0
)
while
(
lost
&&
attempts
>
0
)
...
@@ -449,7 +454,7 @@ bool Renderer::resetDevice()
...
@@ -449,7 +454,7 @@ bool Renderer::resetDevice()
}
}
}
}
lost
=
testDeviceLost
();
lost
=
testDeviceLost
(
false
);
attempts
--
;
attempts
--
;
}
}
...
...
src/libGLESv2/renderer/Renderer.h
View file @
f688c0d1
...
@@ -80,7 +80,7 @@ class Renderer
...
@@ -80,7 +80,7 @@ class Renderer
// lost device
// lost device
virtual
void
markDeviceLost
();
virtual
void
markDeviceLost
();
virtual
bool
isDeviceLost
();
virtual
bool
isDeviceLost
();
virtual
bool
testDeviceLost
();
virtual
bool
testDeviceLost
(
bool
notify
);
virtual
bool
testDeviceResettable
();
virtual
bool
testDeviceResettable
();
// Renderer capabilities
// Renderer capabilities
...
...
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