GLES device lost/store fixes

This commit is contained in:
Henrik Rydgård 2017-12-09 23:58:08 +01:00
parent e07861991b
commit b10b24feea
3 changed files with 16 additions and 3 deletions

View File

@ -156,6 +156,14 @@ void DrawEngineGLES::RestoreVAO() {
}
}
void DrawEngineGLES::DeviceLost() {
DestroyDeviceObjects();
}
void DrawEngineGLES::DeviceRestore() {
InitDeviceObjects();
}
void DrawEngineGLES::InitDeviceObjects() {
if (bufferNameCache_.empty()) {
bufferNameCache_.resize(VERTEXCACHE_NAME_CACHE_SIZE);

View File

@ -119,8 +119,9 @@ public:
fragmentTestCache_ = testCache;
}
void RestoreVAO();
void InitDeviceObjects();
void DestroyDeviceObjects();
void DeviceLost();
void DeviceRestore();
void ClearTrackedVertexArrays() override;
void DecimateTrackedVertexArrays();
@ -151,6 +152,9 @@ public:
void DecimateBuffers();
private:
void InitDeviceObjects();
void DestroyDeviceObjects();
void DoFlush();
void ApplyDrawState(int prim);
void ApplyDrawStateLate();

View File

@ -391,7 +391,7 @@ void GPU_GLES::DeviceLost() {
textureCacheGL_->Clear(false);
fragmentTestCache_.Clear(false);
depalShaderCache_.Clear();
drawEngine_.ClearTrackedVertexArrays();
drawEngine_.DeviceLost();
framebufferManagerGL_->DeviceLost();
}
@ -404,6 +404,7 @@ void GPU_GLES::DeviceRestore() {
textureCacheGL_->DeviceRestore(draw_);
framebufferManagerGL_->DeviceRestore(draw_);
drawEngine_.DeviceRestore();
}
void GPU_GLES::Reinitialize() {