mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-05 20:24:01 +01:00
GLRenderManager: Removes some redundant dirtying. Preserves blend state (color mask) across clears.
This commit is contained in:
1 parent
1ba7e01548
commit
bef078a3bd
3 files changed
+5
-18
No files matched your search
@@ -796,7 +796,6 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) {
|
||||
}
|
||||
if (c.clear.colorMask != colorMask) {
|
||||
glColorMask(c.clear.colorMask & 1, (c.clear.colorMask >> 1) & 1, (c.clear.colorMask >> 2) & 1, (c.clear.colorMask >> 3) & 1);
|
||||
colorMask = c.clear.colorMask;
|
||||
}
|
||||
if (c.clear.clearMask & GL_COLOR_BUFFER_BIT) {
|
||||
float color[4];
|
||||
@@ -818,6 +817,10 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) {
|
||||
glClearStencil(c.clear.clearStencil);
|
||||
}
|
||||
glClear(c.clear.clearMask);
|
||||
// Restore the color mask if it was different.
|
||||
if (c.clear.colorMask != colorMask) {
|
||||
glColorMask(colorMask & 1, (colorMask >> 1) & 1, (colorMask >> 2) & 1, (colorMask >> 3) & 1);
|
||||
}
|
||||
if (c.clear.scissorW == 0) {
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "thin3d/thin3d.h"
|
||||
#include "thread/threadutil.h"
|
||||
#include "base/logging.h"
|
||||
#include "GPU/GPUState.h"
|
||||
#include "Common/MemoryUtil.h"
|
||||
|
||||
#if 0 // def _DEBUG
|
||||
@@ -318,9 +317,6 @@ void GLRenderManager::BindFramebufferAsRenderTarget(GLRFramebuffer *fb, GLRRende
|
||||
step->dependencies.insert(fb);
|
||||
}
|
||||
}
|
||||
|
||||
// Every step clears this state.
|
||||
gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_RASTER_STATE);
|
||||
}
|
||||
|
||||
void GLRenderManager::BindFramebufferAsTexture(GLRFramebuffer *fb, int binding, int aspectBit, int attachment) {
|
||||
@@ -346,9 +342,6 @@ void GLRenderManager::CopyFramebuffer(GLRFramebuffer *src, GLRect2D srcRect, GLR
|
||||
if (dstPos.x != 0 || dstPos.y != 0 || !fillsDst)
|
||||
step->dependencies.insert(dst);
|
||||
steps_.push_back(step);
|
||||
|
||||
// Every step clears this state.
|
||||
gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_RASTER_STATE);
|
||||
}
|
||||
|
||||
void GLRenderManager::BlitFramebuffer(GLRFramebuffer *src, GLRect2D srcRect, GLRFramebuffer *dst, GLRect2D dstRect, int aspectMask, bool filter, const char *tag) {
|
||||
@@ -365,9 +358,6 @@ void GLRenderManager::BlitFramebuffer(GLRFramebuffer *src, GLRect2D srcRect, GLR
|
||||
if (!fillsDst)
|
||||
step->dependencies.insert(dst);
|
||||
steps_.push_back(step);
|
||||
|
||||
// Every step clears this state.
|
||||
gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_RASTER_STATE);
|
||||
}
|
||||
|
||||
bool GLRenderManager::CopyFramebufferToMemorySync(GLRFramebuffer *src, int aspectBits, int x, int y, int w, int h, Draw::DataFormat destFormat, uint8_t *pixels, int pixelStride, const char *tag) {
|
||||
@@ -382,9 +372,6 @@ bool GLRenderManager::CopyFramebufferToMemorySync(GLRFramebuffer *src, int aspec
|
||||
step->tag = tag;
|
||||
steps_.push_back(step);
|
||||
|
||||
// Every step clears this state.
|
||||
gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_RASTER_STATE);
|
||||
|
||||
curRenderStep_ = nullptr;
|
||||
FlushSync();
|
||||
|
||||
@@ -414,9 +401,6 @@ void GLRenderManager::CopyImageToMemorySync(GLRTexture *texture, int mipLevel, i
|
||||
step->tag = tag;
|
||||
steps_.push_back(step);
|
||||
|
||||
// Every step clears this state.
|
||||
gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_RASTER_STATE);
|
||||
|
||||
curRenderStep_ = nullptr;
|
||||
FlushSync();
|
||||
|
||||
|
||||
@@ -812,7 +812,7 @@ public:
|
||||
curRenderStep_->commands.push_back(data);
|
||||
}
|
||||
|
||||
// If scissorW == 0, no scissor is applied.
|
||||
// If scissorW == 0, no scissor is applied (the whole render target is cleared).
|
||||
void Clear(uint32_t clearColor, float clearZ, int clearStencil, int clearMask, int colorMask, int scissorX, int scissorY, int scissorW, int scissorH) {
|
||||
_dbg_assert_(G3D, curRenderStep_ && curRenderStep_->stepType == GLRStepType::RENDER);
|
||||
if (!clearMask)
|
||||
|
||||
Reference in new issue
Block a user