mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
More removing redundant stuff
This commit is contained in:
1 parent
35a1ca064a
commit
cdb4124bc1
10 files changed
+26
-79
No files matched your search
@@ -223,9 +223,6 @@ namespace DX9 {
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManagerDX9::EndFrame() {
|
||||
}
|
||||
|
||||
void FramebufferManagerDX9::DecimateFBOs() {
|
||||
FramebufferManagerCommon::DecimateFBOs();
|
||||
for (auto it = offscreenSurfaces_.begin(); it != offscreenSurfaces_.end(); ) {
|
||||
|
||||
@@ -41,8 +41,6 @@ public:
|
||||
|
||||
void DestroyAllFBOs() override;
|
||||
|
||||
void EndFrame();
|
||||
|
||||
bool GetFramebuffer(u32 fb_address, int fb_stride, GEBufferFormat format, GPUDebugBuffer &buffer, int maxRes) override;
|
||||
bool GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_address, int z_stride, GPUDebugBuffer &buffer) override;
|
||||
bool GetStencilbuffer(u32 fb_address, int fb_stride, GPUDebugBuffer &buffer) override;
|
||||
@@ -70,4 +68,4 @@ private:
|
||||
std::unordered_map<u64, OffscreenSurface> offscreenSurfaces_;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace
|
||||
@@ -299,9 +299,7 @@ void GPU_DX9::CopyDisplayToOutput(bool reallyDirty) {
|
||||
drawEngine_.Flush();
|
||||
|
||||
framebufferManagerDX9_->CopyDisplayToOutput(reallyDirty);
|
||||
framebufferManagerDX9_->EndFrame();
|
||||
|
||||
// shaderManager_->EndFrame();
|
||||
shaderManagerDX9_->DirtyLastShader();
|
||||
|
||||
gstate_c.Dirty(DIRTY_TEXTURE_IMAGE);
|
||||
|
||||
@@ -97,6 +97,8 @@ void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int
|
||||
const bool useColorPath = gl_extensions.IsGLES;
|
||||
bool format16Bit = false;
|
||||
|
||||
GLRenderManager *render = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
|
||||
if (useColorPath) {
|
||||
if (!depthDownloadProgram_) {
|
||||
std::string errorString;
|
||||
@@ -104,8 +106,8 @@ void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int
|
||||
vs_code = ApplyGLSLPrelude(depth_vs, GL_VERTEX_SHADER);
|
||||
fs_code = ApplyGLSLPrelude(depth_dl_fs, GL_FRAGMENT_SHADER);
|
||||
std::vector<GLRShader *> shaders;
|
||||
shaders.push_back(render_->CreateShader(GL_VERTEX_SHADER, vs_code, "depth_dl"));
|
||||
shaders.push_back(render_->CreateShader(GL_FRAGMENT_SHADER, fs_code, "depth_dl"));
|
||||
shaders.push_back(render->CreateShader(GL_VERTEX_SHADER, vs_code, "depth_dl"));
|
||||
shaders.push_back(render->CreateShader(GL_FRAGMENT_SHADER, fs_code, "depth_dl"));
|
||||
std::vector<GLRProgram::Semantic> semantics;
|
||||
semantics.push_back({ 0, "a_position" });
|
||||
semantics.push_back({ 1, "a_texcoord0" });
|
||||
@@ -116,9 +118,9 @@ void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int
|
||||
queries.push_back({ &u_depthDownloadTo8, "u_depthTo8" });
|
||||
std::vector<GLRProgram::Initializer> inits;
|
||||
inits.push_back({ &u_depthDownloadTex, 0, TEX_SLOT_PSP_TEXTURE });
|
||||
depthDownloadProgram_ = render_->CreateProgram(shaders, semantics, queries, inits, false, false);
|
||||
depthDownloadProgram_ = render->CreateProgram(shaders, semantics, queries, inits, false, false);
|
||||
for (auto iter : shaders) {
|
||||
render_->DeleteShader(iter);
|
||||
render->DeleteShader(iter);
|
||||
}
|
||||
if (!depthDownloadProgram_) {
|
||||
ERROR_LOG_REPORT(G3D, "Failed to compile depthDownloadProgram! This shouldn't happen.\n%s", errorString.c_str());
|
||||
@@ -128,26 +130,26 @@ void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int
|
||||
shaderManager_->DirtyLastShader();
|
||||
auto *blitFBO = GetTempFBO(TempFBO::COPY, vfb->renderWidth, vfb->renderHeight);
|
||||
draw_->BindFramebufferAsRenderTarget(blitFBO, { Draw::RPAction::CLEAR, Draw::RPAction::DONT_CARE, Draw::RPAction::DONT_CARE }, "PackDepthbuffer");
|
||||
render_->SetViewport({ 0, 0, (float)vfb->renderWidth, (float)vfb->renderHeight, 0.0f, 1.0f });
|
||||
render->SetViewport({ 0, 0, (float)vfb->renderWidth, (float)vfb->renderHeight, 0.0f, 1.0f });
|
||||
|
||||
// We must bind the program after starting the render pass, and set the color mask after clearing.
|
||||
render_->SetScissor({ 0, 0, vfb->renderWidth, vfb->renderHeight });
|
||||
render_->SetDepth(false, false, GL_ALWAYS);
|
||||
render_->SetRaster(false, GL_CCW, GL_FRONT, GL_FALSE, GL_FALSE);
|
||||
render_->BindProgram(depthDownloadProgram_);
|
||||
render->SetScissor({ 0, 0, vfb->renderWidth, vfb->renderHeight });
|
||||
render->SetDepth(false, false, GL_ALWAYS);
|
||||
render->SetRaster(false, GL_CCW, GL_FRONT, GL_FALSE, GL_FALSE);
|
||||
render->BindProgram(depthDownloadProgram_);
|
||||
|
||||
if (!gstate_c.Supports(GPU_SUPPORTS_ACCURATE_DEPTH)) {
|
||||
float factors[] = { 0.0f, 1.0f };
|
||||
render_->SetUniformF(&u_depthDownloadFactor, 2, factors);
|
||||
render->SetUniformF(&u_depthDownloadFactor, 2, factors);
|
||||
} else {
|
||||
const float factor = DepthSliceFactor();
|
||||
float factors[] = { -0.5f * (factor - 1.0f) * (1.0f / factor), factor };
|
||||
render_->SetUniformF(&u_depthDownloadFactor, 2, factors);
|
||||
render->SetUniformF(&u_depthDownloadFactor, 2, factors);
|
||||
}
|
||||
float shifts[] = { 16777215.0f, 16777215.0f / 256.0f, 16777215.0f / 65536.0f, 16777215.0f / 16777216.0f };
|
||||
render_->SetUniformF(&u_depthDownloadShift, 4, shifts);
|
||||
render->SetUniformF(&u_depthDownloadShift, 4, shifts);
|
||||
float to8[] = { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f };
|
||||
render_->SetUniformF(&u_depthDownloadTo8, 4, to8);
|
||||
render->SetUniformF(&u_depthDownloadTo8, 4, to8);
|
||||
|
||||
draw_->BindFramebufferAsTexture(vfb->fbo, TEX_SLOT_PSP_TEXTURE, Draw::FB_DEPTH_BIT, 0);
|
||||
float u1 = 1.0f;
|
||||
|
||||
@@ -38,9 +38,8 @@
|
||||
#include "GPU/GLES/TextureCacheGLES.h"
|
||||
#include "GPU/GLES/ShaderManagerGLES.h"
|
||||
|
||||
FramebufferManagerGLES::FramebufferManagerGLES(Draw::DrawContext *draw, GLRenderManager *render) :
|
||||
FramebufferManagerCommon(draw),
|
||||
render_(render)
|
||||
FramebufferManagerGLES::FramebufferManagerGLES(Draw::DrawContext *draw) :
|
||||
FramebufferManagerCommon(draw)
|
||||
{
|
||||
needBackBufferYSwap_ = true;
|
||||
presentation_->SetLanguage(draw_->GetShaderLanguageDesc().shaderLanguage);
|
||||
@@ -50,10 +49,6 @@ FramebufferManagerGLES::~FramebufferManagerGLES() {
|
||||
delete[] convBuf_;
|
||||
}
|
||||
|
||||
void FramebufferManagerGLES::Init() {
|
||||
FramebufferManagerCommon::Init();
|
||||
}
|
||||
|
||||
void FramebufferManagerGLES::UpdateDownloadTempBuffer(VirtualFramebuffer *nvfb) {
|
||||
_assert_msg_(nvfb->fbo, "Expecting a valid nvfb in UpdateDownloadTempBuffer");
|
||||
|
||||
@@ -66,26 +61,19 @@ void FramebufferManagerGLES::UpdateDownloadTempBuffer(VirtualFramebuffer *nvfb)
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManagerGLES::EndFrame() {
|
||||
}
|
||||
|
||||
void FramebufferManagerGLES::DeviceLost() {
|
||||
FramebufferManagerCommon::DeviceLost();
|
||||
if (depthDownloadProgram_) {
|
||||
render_->DeleteProgram(depthDownloadProgram_);
|
||||
GLRenderManager *render = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
render->DeleteProgram(depthDownloadProgram_);
|
||||
depthDownloadProgram_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManagerGLES::DeviceRestore(Draw::DrawContext *draw) {
|
||||
FramebufferManagerCommon::DeviceRestore(draw);
|
||||
render_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
}
|
||||
|
||||
void FramebufferManagerGLES::Resized() {
|
||||
FramebufferManagerCommon::Resized();
|
||||
|
||||
render_->Resize(PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight);
|
||||
GLRenderManager *render = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
render->Resize(PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight);
|
||||
}
|
||||
|
||||
bool FramebufferManagerGLES::GetOutputFramebuffer(GPUDebugBuffer &buffer) {
|
||||
|
||||
@@ -18,30 +18,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common/GPU/thin3d.h"
|
||||
// Keeps track of allocated FBOs.
|
||||
// Also provides facilities for drawing and later converting raw
|
||||
// pixel data.
|
||||
|
||||
#include "GPU/GPUCommon.h"
|
||||
#include "GPU/Common/FramebufferManagerCommon.h"
|
||||
#include "Common/GPU/OpenGL/GLRenderManager.h"
|
||||
|
||||
struct GLSLProgram;
|
||||
class TextureCacheGLES;
|
||||
class DrawEngineGLES;
|
||||
class ShaderManagerGLES;
|
||||
class GLRProgram;
|
||||
|
||||
class FramebufferManagerGLES : public FramebufferManagerCommon {
|
||||
public:
|
||||
FramebufferManagerGLES(Draw::DrawContext *draw, GLRenderManager *render);
|
||||
FramebufferManagerGLES(Draw::DrawContext *draw);
|
||||
~FramebufferManagerGLES();
|
||||
|
||||
virtual void Init() override;
|
||||
void EndFrame();
|
||||
void Resized() override;
|
||||
|
||||
void DeviceLost() override;
|
||||
void DeviceRestore(Draw::DrawContext *draw) override;
|
||||
|
||||
bool GetOutputFramebuffer(GPUDebugBuffer &buffer) override;
|
||||
|
||||
@@ -51,8 +42,6 @@ protected:
|
||||
private:
|
||||
void PackDepthbuffer(VirtualFramebuffer *vfb, int x, int y, int w, int h);
|
||||
|
||||
GLRenderManager *render_;
|
||||
|
||||
u8 *convBuf_ = nullptr;
|
||||
u32 convBufSize_ = 0;
|
||||
|
||||
|
||||
@@ -57,10 +57,8 @@ GPU_GLES::GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
||||
UpdateVsyncInterval(true);
|
||||
CheckGPUFeatures();
|
||||
|
||||
GLRenderManager *render = (GLRenderManager *)draw->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
|
||||
shaderManagerGL_ = new ShaderManagerGLES(draw);
|
||||
framebufferManagerGL_ = new FramebufferManagerGLES(draw, render);
|
||||
framebufferManagerGL_ = new FramebufferManagerGLES(draw);
|
||||
framebufferManager_ = framebufferManagerGL_;
|
||||
textureCacheGL_ = new TextureCacheGLES(draw);
|
||||
textureCache_ = textureCacheGL_;
|
||||
@@ -375,7 +373,6 @@ void GPU_GLES::CopyDisplayToOutput(bool reallyDirty) {
|
||||
shaderManagerGL_->DirtyLastShader();
|
||||
|
||||
framebufferManagerGL_->CopyDisplayToOutput(reallyDirty);
|
||||
framebufferManagerGL_->EndFrame();
|
||||
}
|
||||
|
||||
void GPU_GLES::FinishDeferred() {
|
||||
|
||||
@@ -79,18 +79,3 @@ void FramebufferManagerVulkan::NotifyClear(bool clearColor, bool clearAlpha, boo
|
||||
SetDepthUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
void FramebufferManagerVulkan::BeginFrameVulkan() {
|
||||
BeginFrame();
|
||||
}
|
||||
|
||||
void FramebufferManagerVulkan::EndFrame() {
|
||||
}
|
||||
|
||||
void FramebufferManagerVulkan::DeviceLost() {
|
||||
FramebufferManagerCommon::DeviceLost();
|
||||
}
|
||||
|
||||
void FramebufferManagerVulkan::DeviceRestore(Draw::DrawContext *draw) {
|
||||
FramebufferManagerCommon::DeviceRestore(draw);
|
||||
}
|
||||
@@ -36,12 +36,6 @@ public:
|
||||
FramebufferManagerVulkan(Draw::DrawContext *draw);
|
||||
~FramebufferManagerVulkan();
|
||||
|
||||
void BeginFrameVulkan(); // there's a BeginFrame in the base class, which this calls
|
||||
void EndFrame();
|
||||
|
||||
void DeviceLost() override;
|
||||
void DeviceRestore(Draw::DrawContext *draw) override;
|
||||
|
||||
// If within a render pass, this will just issue a regular clear. If beginning a new render pass,
|
||||
// do that.
|
||||
void NotifyClear(bool clearColor, bool clearAlpha, bool clearDepth, uint32_t color, float depth);
|
||||
|
||||
@@ -317,7 +317,7 @@ void GPU_Vulkan::BeginHostFrame() {
|
||||
frame.push_->Reset();
|
||||
frame.push_->Begin(vulkan);
|
||||
|
||||
framebufferManagerVulkan_->BeginFrameVulkan();
|
||||
framebufferManagerVulkan_->BeginFrame();
|
||||
textureCacheVulkan_->SetPushBuffer(frameData_[curFrame].push_);
|
||||
|
||||
shaderManagerVulkan_->DirtyShader();
|
||||
@@ -339,7 +339,6 @@ void GPU_Vulkan::EndHostFrame() {
|
||||
frame.push_->End();
|
||||
|
||||
drawEngine_.EndFrame();
|
||||
framebufferManagerVulkan_->EndFrame();
|
||||
textureCacheVulkan_->EndFrame();
|
||||
|
||||
draw_->InvalidateCachedState();
|
||||
|
||||
Reference in new issue
Block a user