gsdx-debug: compact the code

This commit is contained in:
Gregory Hainaut 2015-05-11 11:19:00 +02:00
parent 51ed3e63e9
commit 1523b9534f
5 changed files with 12 additions and 33 deletions

View File

@ -430,10 +430,7 @@ void GSDeviceOGL::DrawIndexedPrimitive(int offset, int count)
void GSDeviceOGL::ClearRenderTarget(GSTexture* t, const GSVector4& c)
{
#ifdef ENABLE_OGL_DEBUG
std::string help = format("Clear RT %d", static_cast<GSTextureOGL*>(t)->GetID());
GL_PUSH(help.c_str());
#endif
GL_PUSH(format("Clear RT %d", static_cast<GSTextureOGL*>(t)->GetID()).c_str());
// TODO: check size of scissor before toggling it
glDisable(GL_SCISSOR_TEST);
@ -462,10 +459,7 @@ void GSDeviceOGL::ClearRenderTarget(GSTexture* t, uint32 c)
void GSDeviceOGL::ClearRenderTarget_i(GSTexture* t, int32 c)
{
#ifdef ENABLE_OGL_DEBUG
std::string help = format("Clear RTi %d", static_cast<GSTextureOGL*>(t)->GetID());
GL_PUSH(help.c_str());
#endif
GL_PUSH(format("Clear RTi %d", static_cast<GSTextureOGL*>(t)->GetID()).c_str());
// Keep SCISSOR_TEST enabled on purpose to reduce the size
// of clean in DATE (impact big upscaling)
@ -481,10 +475,7 @@ void GSDeviceOGL::ClearRenderTarget_i(GSTexture* t, int32 c)
void GSDeviceOGL::ClearDepth(GSTexture* t, float c)
{
#ifdef ENABLE_OGL_DEBUG
std::string help = format("Clear Depth %d", static_cast<GSTextureOGL*>(t)->GetID());
GL_PUSH(help.c_str());
#endif
GL_PUSH(format("Clear Depth %d", static_cast<GSTextureOGL*>(t)->GetID()).c_str());
OMSetFBO(m_fbo);
OMAttachDs(static_cast<GSTextureOGL*>(t)->GetID());
@ -505,10 +496,7 @@ void GSDeviceOGL::ClearDepth(GSTexture* t, float c)
void GSDeviceOGL::ClearStencil(GSTexture* t, uint8 c)
{
#ifdef ENABLE_OGL_DEBUG
std::string help = format("Clear Stencil %d", static_cast<GSTextureOGL*>(t)->GetID());
GL_PUSH(help.c_str());
#endif
GL_PUSH(format("Clear Stencil %d", static_cast<GSTextureOGL*>(t)->GetID()).c_str());
// Keep SCISSOR_TEST enabled on purpose to reduce the size
// of clean in DATE (impact big upscaling)
@ -686,8 +674,7 @@ void GSDeviceOGL::CopyRect(GSTexture* st, GSTexture* dt, const GSVector4i& r)
const GLuint& did = static_cast<GSTextureOGL*>(dt)->GetID();
#ifdef ENABLE_OGL_DEBUG
string helper = format("CopyRect from %d to %d", sid, did);
GL_PUSH(helper.c_str());
GL_PUSH(format("CopyRect from %d to %d", sid, did).c_str());
#endif
if (GLLoader::found_GL_ARB_copy_image) {

View File

@ -92,9 +92,8 @@ public:
}
#ifdef ENABLE_OGL_DEBUG
if (m_bogus) {
GL_INS("!!! Bogus blending effect !!!");
fprintf(stderr, "Bogus blending effect used : %s (%d)\n", (m_bogus > 2) ? "impossible effect" : "clear effect", m_bogus);
if (m_bogus > 2) {
GL_INS(format("!!! Bogus blending effect used (%d) !!!", m_bogus).c_str());
}
#endif
if (m_enable) {

View File

@ -317,10 +317,7 @@ void GSRendererHW::Draw()
s_n += 3; // Keep it sync with SW renderer
return;
}
#ifdef ENABLE_OGL_DEBUG
std::string help = format("HW Draw %d", s_n);
GL_PUSH(help.c_str());
#endif
GL_PUSH(format("HW Draw %d", s_n).c_str());
GSDrawingEnvironment& env = m_env;
GSDrawingContext* context = m_context;

View File

@ -212,10 +212,8 @@ void GSRendererOGL::SendDraw(bool require_barrier)
void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* tex)
{
#ifdef ENABLE_OGL_DEBUG
std::string help = format("GL Draw in (%d/%d)", static_cast<GSTextureOGL*>(rt)->GetID(), static_cast<GSTextureOGL*>(ds)->GetID());
GL_PUSH(help.c_str());
#endif
GL_PUSH(format("GL Draw in (%d/%d)", static_cast<GSTextureOGL*>(rt)->GetID(), static_cast<GSTextureOGL*>(ds)->GetID()).c_str());
GSDrawingEnvironment& env = m_env;
GSDrawingContext* context = m_context;

View File

@ -254,11 +254,9 @@ void GSTextureOGL::Invalidate()
bool GSTextureOGL::Update(const GSVector4i& r, const void* data, int pitch)
{
ASSERT(m_type != GSTexture::DepthStencil && m_type != GSTexture::Offscreen);
GL_PUSH(format("Upload Texture %d", m_texture_id).c_str());
m_dirty = true;
#ifdef ENABLE_OGL_DEBUG
std::string help = format("Upload Texture %d", m_texture_id);
GL_PUSH(help.c_str());
#endif
// Note: reduce noise for gl retracers
// It might introduce bug after an emulator pause so always set it in standard mode