mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-14 01:59:34 +01:00
Add a name tag for all render steps (GL/Vulkan). Helps with debugging and should be cheap enough (a single pointer per "step").
This commit is contained in:
1 parent
e8b7372263
commit
fabe987c8f
30 files changed
+152
-137
No files matched your search
@@ -260,7 +260,7 @@ void GLRenderManager::StopThread() {
|
||||
}
|
||||
}
|
||||
|
||||
void GLRenderManager::BindFramebufferAsRenderTarget(GLRFramebuffer *fb, GLRRenderPassAction color, GLRRenderPassAction depth, GLRRenderPassAction stencil, uint32_t clearColor, float clearDepth, uint8_t clearStencil) {
|
||||
void GLRenderManager::BindFramebufferAsRenderTarget(GLRFramebuffer *fb, GLRRenderPassAction color, GLRRenderPassAction depth, GLRRenderPassAction stencil, uint32_t clearColor, float clearDepth, uint8_t clearStencil, const char *tag) {
|
||||
assert(insideFrame_);
|
||||
#ifdef _DEBUG
|
||||
curProgram_ = nullptr;
|
||||
@@ -284,6 +284,7 @@ void GLRenderManager::BindFramebufferAsRenderTarget(GLRFramebuffer *fb, GLRRende
|
||||
step->render.depth = depth;
|
||||
step->render.stencil = stencil;
|
||||
step->render.numDraws = 0;
|
||||
step->tag = tag;
|
||||
steps_.push_back(step);
|
||||
|
||||
GLuint clearMask = 0;
|
||||
@@ -332,7 +333,7 @@ void GLRenderManager::BindFramebufferAsTexture(GLRFramebuffer *fb, int binding,
|
||||
curRenderStep_->dependencies.insert(fb);
|
||||
}
|
||||
|
||||
void GLRenderManager::CopyFramebuffer(GLRFramebuffer *src, GLRect2D srcRect, GLRFramebuffer *dst, GLOffset2D dstPos, int aspectMask) {
|
||||
void GLRenderManager::CopyFramebuffer(GLRFramebuffer *src, GLRect2D srcRect, GLRFramebuffer *dst, GLOffset2D dstPos, int aspectMask, const char *tag) {
|
||||
GLRStep *step = new GLRStep{ GLRStepType::COPY };
|
||||
step->copy.srcRect = srcRect;
|
||||
step->copy.dstPos = dstPos;
|
||||
@@ -340,6 +341,7 @@ void GLRenderManager::CopyFramebuffer(GLRFramebuffer *src, GLRect2D srcRect, GLR
|
||||
step->copy.dst = dst;
|
||||
step->copy.aspectMask = aspectMask;
|
||||
step->dependencies.insert(src);
|
||||
step->tag = tag;
|
||||
bool fillsDst = dst && srcRect.x == 0 && srcRect.y == 0 && srcRect.w == dst->width && srcRect.h == dst->height;
|
||||
if (dstPos.x != 0 || dstPos.y != 0 || !fillsDst)
|
||||
step->dependencies.insert(dst);
|
||||
@@ -349,7 +351,7 @@ void GLRenderManager::CopyFramebuffer(GLRFramebuffer *src, GLRect2D srcRect, GLR
|
||||
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) {
|
||||
void GLRenderManager::BlitFramebuffer(GLRFramebuffer *src, GLRect2D srcRect, GLRFramebuffer *dst, GLRect2D dstRect, int aspectMask, bool filter, const char *tag) {
|
||||
GLRStep *step = new GLRStep{ GLRStepType::BLIT };
|
||||
step->blit.srcRect = srcRect;
|
||||
step->blit.dstRect = dstRect;
|
||||
@@ -358,6 +360,7 @@ void GLRenderManager::BlitFramebuffer(GLRFramebuffer *src, GLRect2D srcRect, GLR
|
||||
step->blit.aspectMask = aspectMask;
|
||||
step->blit.filter = filter;
|
||||
step->dependencies.insert(src);
|
||||
step->tag = tag;
|
||||
bool fillsDst = dst && dstRect.x == 0 && dstRect.y == 0 && dstRect.w == dst->width && dstRect.h == dst->height;
|
||||
if (!fillsDst)
|
||||
step->dependencies.insert(dst);
|
||||
@@ -367,7 +370,7 @@ void GLRenderManager::BlitFramebuffer(GLRFramebuffer *src, GLRect2D srcRect, GLR
|
||||
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) {
|
||||
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) {
|
||||
_assert_(pixels);
|
||||
|
||||
GLRStep *step = new GLRStep{ GLRStepType::READBACK };
|
||||
@@ -376,6 +379,7 @@ bool GLRenderManager::CopyFramebufferToMemorySync(GLRFramebuffer *src, int aspec
|
||||
step->readback.aspectMask = aspectBits;
|
||||
step->readback.dstFormat = destFormat;
|
||||
step->dependencies.insert(src);
|
||||
step->tag = tag;
|
||||
steps_.push_back(step);
|
||||
|
||||
// Every step clears this state.
|
||||
@@ -400,13 +404,14 @@ bool GLRenderManager::CopyFramebufferToMemorySync(GLRFramebuffer *src, int aspec
|
||||
return true;
|
||||
}
|
||||
|
||||
void GLRenderManager::CopyImageToMemorySync(GLRTexture *texture, int mipLevel, int x, int y, int w, int h, Draw::DataFormat destFormat, uint8_t *pixels, int pixelStride) {
|
||||
void GLRenderManager::CopyImageToMemorySync(GLRTexture *texture, int mipLevel, int x, int y, int w, int h, Draw::DataFormat destFormat, uint8_t *pixels, int pixelStride, const char *tag) {
|
||||
_assert_(texture);
|
||||
_assert_(pixels);
|
||||
GLRStep *step = new GLRStep{ GLRStepType::READBACK_IMAGE };
|
||||
step->readback_image.texture = texture;
|
||||
step->readback_image.mipLevel = mipLevel;
|
||||
step->readback_image.srcRect = { x, y, w, h };
|
||||
step->tag = tag;
|
||||
steps_.push_back(step);
|
||||
|
||||
// Every step clears this state.
|
||||
|
||||
Reference in new issue
Block a user