video_core: move buffer resize before GLES check
preventing the assert in FlushGLBuffer
This commit is contained in:
parent
c76da1b975
commit
015ec0f33a
@ -886,6 +886,12 @@ void CachedSurface::DownloadGLTexture(const Common::Rectangle<u32>& rect, GLuint
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MICROPROFILE_SCOPE(OpenGL_TextureDL);
|
||||||
|
|
||||||
|
if (gl_buffer.empty()) {
|
||||||
|
gl_buffer.resize(width * height * GetGLBytesPerPixel(pixel_format));
|
||||||
|
}
|
||||||
|
|
||||||
if (GLES) {
|
if (GLES) {
|
||||||
if (type == SurfaceType::Depth || type == SurfaceType::DepthStencil) {
|
if (type == SurfaceType::Depth || type == SurfaceType::DepthStencil) {
|
||||||
// TODO(bunnei): This is unsupported on GLES right now, fixme
|
// TODO(bunnei): This is unsupported on GLES right now, fixme
|
||||||
@ -894,12 +900,6 @@ void CachedSurface::DownloadGLTexture(const Common::Rectangle<u32>& rect, GLuint
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MICROPROFILE_SCOPE(OpenGL_TextureDL);
|
|
||||||
|
|
||||||
if (gl_buffer.empty()) {
|
|
||||||
gl_buffer.resize(width * height * GetGLBytesPerPixel(pixel_format));
|
|
||||||
}
|
|
||||||
|
|
||||||
OpenGLState state = OpenGLState::GetCurState();
|
OpenGLState state = OpenGLState::GetCurState();
|
||||||
OpenGLState prev_state = state;
|
OpenGLState prev_state = state;
|
||||||
SCOPE_EXIT({ prev_state.Apply(); });
|
SCOPE_EXIT({ prev_state.Apply(); });
|
||||||
@ -1925,7 +1925,6 @@ Surface RasterizerCacheOpenGL::CreateSurface(const SurfaceParams& params) {
|
|||||||
|
|
||||||
surface->texture.Create();
|
surface->texture.Create();
|
||||||
|
|
||||||
surface->gl_buffer.resize(0);
|
|
||||||
surface->invalid_regions.insert(surface->GetInterval());
|
surface->invalid_regions.insert(surface->GetInterval());
|
||||||
AllocateSurfaceTexture(surface->texture.handle, GetFormatTuple(surface->pixel_format),
|
AllocateSurfaceTexture(surface->texture.handle, GetFormatTuple(surface->pixel_format),
|
||||||
surface->GetScaledWidth(), surface->GetScaledHeight());
|
surface->GetScaledWidth(), surface->GetScaledHeight());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user