mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Minor cleanups
This commit is contained in:
parent
85446d6c51
commit
99386da01e
5 changed files with 22 additions and 13 deletions
|
@ -126,3 +126,17 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int mode, std:
|
|||
window_ = window;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SDLGLGraphicsContext::Shutdown() {
|
||||
}
|
||||
|
||||
void SDLGLGraphicsContext::ShutdownFromRenderThread() {
|
||||
delete draw_;
|
||||
draw_ = nullptr;
|
||||
|
||||
#ifdef USING_EGL
|
||||
EGL_Close();
|
||||
#else
|
||||
SDL_GL_DeleteContext(glContext);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -11,20 +11,12 @@ class SDLGLGraphicsContext : public DummyGraphicsContext {
|
|||
public:
|
||||
SDLGLGraphicsContext() {
|
||||
}
|
||||
~SDLGLGraphicsContext() {
|
||||
delete draw_;
|
||||
}
|
||||
|
||||
// Returns 0 on success.
|
||||
int Init(SDL_Window *&window, int x, int y, int mode, std::string *error_message);
|
||||
|
||||
void Shutdown() override {
|
||||
#ifdef USING_EGL
|
||||
EGL_Close();
|
||||
#else
|
||||
SDL_GL_DeleteContext(glContext);
|
||||
#endif
|
||||
}
|
||||
void Shutdown() override;
|
||||
void ShutdownFromRenderThread() override;
|
||||
|
||||
void SwapBuffers() override {
|
||||
renderManager_->Swap();
|
||||
|
|
|
@ -54,7 +54,7 @@ GLRenderManager::GLRenderManager() {
|
|||
|
||||
GLRenderManager::~GLRenderManager() {
|
||||
for (int i = 0; i < MAX_INFLIGHT_FRAMES; i++) {
|
||||
|
||||
// _assert_(frameData_[i].deleter.IsEmpty());
|
||||
}
|
||||
|
||||
if (!useThread_) {
|
||||
|
|
|
@ -194,6 +194,9 @@ public:
|
|||
int semanticsMask_ = 0;
|
||||
};
|
||||
|
||||
// Note: The GLRenderManager is created and destroyed on the render thread, and the latter
|
||||
// happens after the emu thread has been destroyed. Therefore, it's safe to run wild deleting stuff
|
||||
// directly in the destructor.
|
||||
class GLRenderManager {
|
||||
public:
|
||||
GLRenderManager();
|
||||
|
|
|
@ -477,7 +477,7 @@ private:
|
|||
OpenGLTexture *boundTextures_[8]{};
|
||||
int maxTextures_ = 0;
|
||||
DeviceCaps caps_{};
|
||||
|
||||
|
||||
// Bound state
|
||||
OpenGLPipeline *curPipeline_ = nullptr;
|
||||
OpenGLBuffer *curVBuffers_[4]{};
|
||||
|
@ -519,7 +519,7 @@ OpenGLContext::OpenGLContext() {
|
|||
default:
|
||||
caps_.vendor = GPUVendor::VENDOR_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < GLRenderManager::MAX_INFLIGHT_FRAMES; i++) {
|
||||
frameData_[i].push = new GLPushBuffer(&renderManager_, GL_ARRAY_BUFFER, 64 * 1024);
|
||||
renderManager_.RegisterPushBuffer(i, frameData_[i].push);
|
||||
|
|
Loading…
Add table
Reference in a new issue