mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-24 22:10:01 +00:00
Merge pull request #8413 from hrydgard/framebuffer-remove-unused
Remove some unused functionality from the framebuffer managers
This commit is contained in:
commit
d479990595
@ -225,7 +225,6 @@ protected:
|
||||
|
||||
virtual void DisableState() = 0;
|
||||
virtual void ClearBuffer(bool keepState = false) = 0;
|
||||
virtual void ClearDepthBuffer() = 0;
|
||||
virtual void FlushBeforeCopy() = 0;
|
||||
virtual void DecimateFBOs() = 0;
|
||||
|
||||
|
@ -68,14 +68,6 @@ namespace DX9 {
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManagerDX9::ClearDepthBuffer() {
|
||||
dxstate.scissorTest.disable();
|
||||
dxstate.depthWrite.set(TRUE);
|
||||
dxstate.colorMask.set(false, false, false, false);
|
||||
dxstate.stencilFunc.set(D3DCMP_NEVER, 0, 0);
|
||||
pD3Ddevice->Clear(0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(0, 0, 0, 0), 0, 0);
|
||||
}
|
||||
|
||||
void FramebufferManagerDX9::DisableState() {
|
||||
dxstate.blend.disable();
|
||||
dxstate.cullMode.set(false, false);
|
||||
|
@ -96,7 +96,6 @@ public:
|
||||
protected:
|
||||
virtual void DisableState() override;
|
||||
virtual void ClearBuffer(bool keepState = false) override;
|
||||
virtual void ClearDepthBuffer() override;
|
||||
virtual void FlushBeforeCopy() override;
|
||||
virtual void DecimateFBOs() override;
|
||||
|
||||
|
@ -71,21 +71,6 @@ static const char basic_vs[] =
|
||||
" gl_Position = a_position;\n"
|
||||
"}\n";
|
||||
|
||||
static const char color_fs[] =
|
||||
#ifdef USING_GLES2
|
||||
"precision mediump float;\n"
|
||||
#endif
|
||||
"uniform vec4 u_color;\n"
|
||||
"void main() {\n"
|
||||
" gl_FragColor.rgba = u_color;\n"
|
||||
"}\n";
|
||||
|
||||
static const char color_vs[] =
|
||||
"attribute vec4 a_position;\n"
|
||||
"void main() {\n"
|
||||
" gl_Position = a_position;\n"
|
||||
"}\n";
|
||||
|
||||
void ConvertFromRGBA8888(u8 *dst, const u8 *src, u32 dstStride, u32 srcStride, u32 width, u32 height, GEBufferFormat format);
|
||||
|
||||
void FramebufferManager::ClearBuffer(bool keepState) {
|
||||
@ -119,17 +104,6 @@ void FramebufferManager::ClearBuffer(bool keepState) {
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManager::ClearDepthBuffer() {
|
||||
glstate.scissorTest.disable();
|
||||
glstate.depthWrite.set(GL_TRUE);
|
||||
#ifdef USING_GLES2
|
||||
glClearDepthf(0.0f);
|
||||
#else
|
||||
glClearDepth(0.0);
|
||||
#endif
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void FramebufferManager::DisableState() {
|
||||
glstate.blend.disable();
|
||||
glstate.cullFace.disable();
|
||||
@ -173,14 +147,6 @@ void FramebufferManager::CompileDraw2DProgram() {
|
||||
glUniform1i(draw2dprogram_->sampler0, 0);
|
||||
}
|
||||
|
||||
plainColorProgram_ = glsl_create_source(color_vs, color_fs, &errorString);
|
||||
if (!plainColorProgram_) {
|
||||
ERROR_LOG_REPORT(G3D, "Failed to compile plainColorProgram! This shouldn't happen.\n%s", errorString.c_str());
|
||||
} else {
|
||||
glsl_bind(plainColorProgram_);
|
||||
plainColorLoc_ = glsl_uniform_loc(plainColorProgram_, "u_color");
|
||||
}
|
||||
|
||||
SetNumExtraFBOs(0);
|
||||
const ShaderInfo *shaderInfo = 0;
|
||||
if (g_Config.sPostShaderName != "Off") {
|
||||
@ -267,10 +233,6 @@ void FramebufferManager::DestroyDraw2DProgram() {
|
||||
glsl_destroy(draw2dprogram_);
|
||||
draw2dprogram_ = nullptr;
|
||||
}
|
||||
if (plainColorProgram_) {
|
||||
glsl_destroy(plainColorProgram_);
|
||||
plainColorProgram_ = nullptr;
|
||||
}
|
||||
if (postShaderProgram_) {
|
||||
glsl_destroy(postShaderProgram_);
|
||||
postShaderProgram_ = nullptr;
|
||||
@ -284,7 +246,6 @@ FramebufferManager::FramebufferManager() :
|
||||
draw2dprogram_(nullptr),
|
||||
postShaderProgram_(nullptr),
|
||||
stencilUploadProgram_(nullptr),
|
||||
plainColorLoc_(-1),
|
||||
timeLoc_(-1),
|
||||
deltaLoc_(-1),
|
||||
pixelDeltaLoc_(-1),
|
||||
@ -481,51 +442,6 @@ void FramebufferManager::DrawFramebufferToOutput(const u8 *srcPixels, GEBufferFo
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManager::DrawPlainColor(u32 color) {
|
||||
// Cannot take advantage of scissor + clear here - this has to be a regular draw so that
|
||||
// stencil can be used and abused, as that's what we're gonna use this for.
|
||||
static const float pos[12] = {
|
||||
-1,-1,-1,
|
||||
1,-1,-1,
|
||||
1,1,-1,
|
||||
-1,1,-1
|
||||
};
|
||||
static const GLubyte indices[4] = {0,1,3,2};
|
||||
|
||||
GLSLProgram *program = 0;
|
||||
if (!draw2dprogram_) {
|
||||
CompileDraw2DProgram();
|
||||
}
|
||||
program = plainColorProgram_;
|
||||
|
||||
const float col[4] = {
|
||||
((color & 0xFF)) / 255.0f,
|
||||
((color & 0xFF00) >> 8) / 255.0f,
|
||||
((color & 0xFF0000) >> 16) / 255.0f,
|
||||
((color & 0xFF000000) >> 24) / 255.0f,
|
||||
};
|
||||
|
||||
shaderManager_->DirtyLastShader();
|
||||
|
||||
glsl_bind(program);
|
||||
glUniform4fv(plainColorLoc_, 1, col);
|
||||
glEnableVertexAttribArray(program->a_position);
|
||||
if (gstate_c.Supports(GPU_SUPPORTS_VAO)) {
|
||||
transformDraw_->BindBuffer(pos, sizeof(pos));
|
||||
transformDraw_->BindElementBuffer(indices, sizeof(indices));
|
||||
glVertexAttribPointer(program->a_position, 3, GL_FLOAT, GL_FALSE, 12, 0);
|
||||
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, 0);
|
||||
} else {
|
||||
glstate.arrayBuffer.unbind();
|
||||
glstate.elementArrayBuffer.unbind();
|
||||
glVertexAttribPointer(program->a_position, 3, GL_FLOAT, GL_FALSE, 12, pos);
|
||||
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, indices);
|
||||
}
|
||||
glDisableVertexAttribArray(program->a_position);
|
||||
|
||||
glsl_unbind();
|
||||
}
|
||||
|
||||
// x, y, w, h are relative coordinates against destW/destH, which is not very intuitive.
|
||||
void FramebufferManager::DrawActiveTexture(GLuint texture, float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, GLSLProgram *program, int uvRotation) {
|
||||
float texCoords[8] = {
|
||||
|
@ -83,8 +83,6 @@ public:
|
||||
// x,y,w,h are relative to destW, destH which fill out the target completely.
|
||||
void DrawActiveTexture(GLuint texture, float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, GLSLProgram *program, int uvRotation);
|
||||
|
||||
void DrawPlainColor(u32 color);
|
||||
|
||||
void DestroyAllFBOs();
|
||||
|
||||
virtual void Init() override;
|
||||
@ -126,7 +124,6 @@ public:
|
||||
protected:
|
||||
virtual void DisableState() override;
|
||||
virtual void ClearBuffer(bool keepState = false) override;
|
||||
virtual void ClearDepthBuffer() override;
|
||||
virtual void FlushBeforeCopy() override;
|
||||
virtual void DecimateFBOs() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user