mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Update native with gl shutdown fix (helps orientation change).
This also adds some logging that helped me figure things out.
This commit is contained in:
parent
8489bd15db
commit
39d28c27e2
5 changed files with 21 additions and 11 deletions
|
@ -167,20 +167,25 @@ void FramebufferManager::SetNumExtraFBOs(int num) {
|
|||
|
||||
void FramebufferManager::CompileDraw2DProgram() {
|
||||
if (!draw2dprogram_) {
|
||||
SetNumExtraFBOs(0);
|
||||
draw2dprogram_ = glsl_create_source(basic_vs, tex_fs);
|
||||
glsl_bind(draw2dprogram_);
|
||||
glUniform1i(draw2dprogram_->sampler0, 0);
|
||||
|
||||
SetNumExtraFBOs(0);
|
||||
if (g_Config.bFXAA) {
|
||||
useFXAA_ = true;
|
||||
fxaaProgram_ = glsl_create("shaders/fxaa.vsh", "shaders/fxaa.fsh");
|
||||
glsl_bind(fxaaProgram_);
|
||||
glUniform1i(fxaaProgram_->sampler0, 0);
|
||||
SetNumExtraFBOs(1);
|
||||
float u_delta = 1.0f / PSP_CoreParameter().renderWidth;
|
||||
float v_delta = 1.0f / PSP_CoreParameter().renderHeight;
|
||||
glUniform2f(glsl_uniform_loc(fxaaProgram_, "u_texcoordDelta"), u_delta, v_delta);
|
||||
if (!fxaaProgram_) {
|
||||
ERROR_LOG(G3D, "Failed to build FXAA program");
|
||||
useFXAA_ = false;
|
||||
} else {
|
||||
glsl_bind(fxaaProgram_);
|
||||
glUniform1i(fxaaProgram_->sampler0, 0);
|
||||
SetNumExtraFBOs(1);
|
||||
float u_delta = 1.0f / PSP_CoreParameter().renderWidth;
|
||||
float v_delta = 1.0f / PSP_CoreParameter().renderHeight;
|
||||
glUniform2f(glsl_uniform_loc(fxaaProgram_, "u_texcoordDelta"), u_delta, v_delta);
|
||||
}
|
||||
} else {
|
||||
fxaaProgram_ = 0;
|
||||
useFXAA_ = false;
|
||||
|
@ -194,6 +199,8 @@ void FramebufferManager::DestroyDraw2DProgram() {
|
|||
if (draw2dprogram_) {
|
||||
glsl_destroy(draw2dprogram_);
|
||||
draw2dprogram_ = 0;
|
||||
}
|
||||
if (fxaaProgram_) {
|
||||
glsl_destroy(fxaaProgram_);
|
||||
fxaaProgram_ = 0;
|
||||
}
|
||||
|
|
|
@ -481,10 +481,12 @@ void GLES_GPU::BuildReportingInfo() {
|
|||
}
|
||||
|
||||
void GLES_GPU::DeviceLost() {
|
||||
ILOG("GLES_GPU: DeviceLost");
|
||||
// Should only be executed on the GL thread.
|
||||
|
||||
// Simply drop all caches and textures.
|
||||
// FBOs appear to survive? Or no?
|
||||
// TransformDraw has registered as a GfxResourceHolder.
|
||||
shaderManager_->ClearCache(false);
|
||||
textureCache_.Clear(false);
|
||||
framebufferManager_.DeviceLost();
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
class ShaderManager;
|
||||
class LinkedShader;
|
||||
|
||||
class GLES_GPU : public GPUCommon
|
||||
{
|
||||
class GLES_GPU : public GPUCommon {
|
||||
public:
|
||||
GLES_GPU();
|
||||
~GLES_GPU();
|
||||
|
@ -51,7 +50,7 @@ public:
|
|||
|
||||
virtual void DumpNextFrame();
|
||||
virtual void DoState(PointerWrap &p);
|
||||
|
||||
|
||||
// Called by the window system if the window size changed. This will be reflected in PSPCoreParam.pixel*.
|
||||
virtual void Resized();
|
||||
virtual bool DecodeTexture(u8* dest, GPUgstate state) {
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
// all at once, writing matrix indices into the vertices in addition to the weights, and then doing a single
|
||||
// draw call with specially generated shader to draw the whole mesh. This code will be seriously complex though.
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/timeutil.h"
|
||||
|
||||
#include "Common/MemoryUtil.h"
|
||||
|
@ -186,6 +187,7 @@ void TransformDrawEngine::DestroyDeviceObjects() {
|
|||
}
|
||||
|
||||
void TransformDrawEngine::GLLost() {
|
||||
ILOG("TransformDrawEngine::GLLost()");
|
||||
// The objects have already been deleted.
|
||||
memset(vbo_, 0, sizeof(vbo_));
|
||||
memset(ebo_, 0, sizeof(ebo_));
|
||||
|
|
2
native
2
native
|
@ -1 +1 @@
|
|||
Subproject commit 3778d8d8b1c3cc66470f1575b9959a04812b8f3f
|
||||
Subproject commit 67bea6c7ed9eba715d42164944c70ba5a2838223
|
Loading…
Add table
Reference in a new issue