mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-28 16:53:40 +01:00
GPU: Clarify new framebuf stencil upload.
Actually, this doesn't need alpha either.
This commit is contained in:
1 parent
71d66ae1ec
commit
c212bd0fec
3 files changed
+10
-7
No files matched your search
@@ -471,7 +471,8 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(const Frame
|
||||
|
||||
if (useBufferedRendering_ && !g_Config.bDisableSlowFramebufEffects) {
|
||||
gpu->PerformMemoryUpload(params.fb_address, byteSize);
|
||||
PerformStencilUpload(params.fb_address, byteSize, StencilUpload::STENCIL_IS_ZERO);
|
||||
// Alpha was already done by PerformMemoryUpload.
|
||||
PerformStencilUpload(params.fb_address, byteSize, StencilUpload::STENCIL_IS_ZERO | StencilUpload::IGNORE_ALPHA);
|
||||
// TODO: Is it worth trying to upload the depth buffer (only if it wasn't copied above..?)
|
||||
}
|
||||
|
||||
|
||||
@@ -176,14 +176,14 @@ bool FramebufferManagerCommon::PerformStencilUpload(u32 addr, int size, StencilU
|
||||
}
|
||||
|
||||
if (usedBits == 0) {
|
||||
if (flags == StencilUpload::STENCIL_IS_ZERO) {
|
||||
if (flags & StencilUpload::STENCIL_IS_ZERO) {
|
||||
// Common when creating buffers, it's already 0.
|
||||
// We're done.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Otherwise, we can skip alpha in many cases, in which case we don't even use a shader.
|
||||
if (flags == StencilUpload::IGNORE_ALPHA) {
|
||||
if (flags & StencilUpload::IGNORE_ALPHA) {
|
||||
shaderManager_->DirtyLastShader();
|
||||
|
||||
if (dstBuffer->fbo) {
|
||||
@@ -267,7 +267,7 @@ bool FramebufferManagerCommon::PerformStencilUpload(u32 addr, int size, StencilU
|
||||
useBlit = false;
|
||||
}
|
||||
// The blit path doesn't set alpha, so we can't use it if that's needed.
|
||||
if (flags != StencilUpload::IGNORE_ALPHA) {
|
||||
if (!(flags & StencilUpload::IGNORE_ALPHA)) {
|
||||
useBlit = false;
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -21,6 +21,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/Swap.h"
|
||||
#include "GPU/GPU.h"
|
||||
#include "Core/MemMap.h"
|
||||
@@ -107,10 +108,11 @@ enum GPUSyncType {
|
||||
};
|
||||
|
||||
enum class StencilUpload {
|
||||
NEEDS_CLEAR,
|
||||
STENCIL_IS_ZERO,
|
||||
IGNORE_ALPHA,
|
||||
NEEDS_CLEAR = 1,
|
||||
STENCIL_IS_ZERO = 2,
|
||||
IGNORE_ALPHA = 4,
|
||||
};
|
||||
ENUM_CLASS_BITOPS(StencilUpload);
|
||||
|
||||
// Used for debug
|
||||
struct FramebufferInfo {
|
||||
|
||||
Reference in new issue
Block a user