ZZogl-pg: In the Debug build, downgrade various assertions to log messages.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3209 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-06-15 11:20:52 +00:00
parent 6de9dbeca0
commit ee1d7f137b
6 changed files with 25 additions and 30 deletions

View File

@ -715,7 +715,7 @@ inline void RenderCheckForMemory(tex0Info& texframe, list<CRenderTarget*>& listT
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
} }
// Put FPS counter on scren (not in window title) // Put FPS counter on screen (not in window title)
inline void AfterRenderDisplayFPS() inline void AfterRenderDisplayFPS()
{ {
char str[64]; char str[64];

View File

@ -519,7 +519,7 @@ bool ZeroGS::Create(int _width, int _height)
ZZLog::Error_Log("Failed to create the renderbuffer."); ZZLog::Error_Log("Failed to create the renderbuffer.");
} }
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT); GL_REPORT_ERRORD();
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, s_uFramebuffer); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, s_uFramebuffer);

View File

@ -643,11 +643,8 @@ inline void FlushSetStream(VB& curvb)
// memcpy_amd(pdata, curvb.pBufferData, curvb.nCount * sizeof(VertexGPU)); // memcpy_amd(pdata, curvb.pBufferData, curvb.nCount * sizeof(VertexGPU));
// glUnmapBuffer(GL_ARRAY_BUFFER); // glUnmapBuffer(GL_ARRAY_BUFFER);
SET_STREAM(); SET_STREAM();
#ifdef _DEBUG
GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); GL_REPORT_ERRORD();
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT);
#endif
} }
int SetMaskR = 0x0; int SetMaskR = 0x0;
@ -1867,7 +1864,8 @@ void ZeroGS::SetContextTarget(int context)
assert(curvb.prndr != NULL && curvb.pdepth != NULL); assert(curvb.prndr != NULL && curvb.pdepth != NULL);
assert(curvb.pdepth->fbh == curvb.prndr->fbh); if (curvb.pdepth->fbh != curvb.prndr->fbh) ZZLog::Debug_Log("(curvb.pdepth->fbh(0x%x) != curvb.prndr->fbh(0x%x))", curvb.pdepth->fbh, curvb.prndr->fbh);
//assert(curvb.pdepth->fbh == curvb.prndr->fbh);
if (curvb.pdepth->status & CRenderTarget::TS_Virtual) if (curvb.pdepth->status & CRenderTarget::TS_Virtual)
{ {

View File

@ -280,7 +280,7 @@ inline int ZeroGS::VB::CheckFrameResolveDepth(int tbp)
assert(pnewdepth != NULL && prndr != NULL); assert(pnewdepth != NULL && prndr != NULL);
if (pnewdepth->fbh != prndr->fbh) ZZLog::Debug_Log("pnewdepth->fbh(0x%x) != prndr->fbh(0x%x)", pnewdepth->fbh, prndr->fbh); if (pnewdepth->fbh != prndr->fbh) ZZLog::Debug_Log("pnewdepth->fbh(0x%x) != prndr->fbh(0x%x)", pnewdepth->fbh, prndr->fbh);
assert(pnewdepth->fbh == prndr->fbh); //assert(pnewdepth->fbh == prndr->fbh);
if ((pprevdepth != pnewdepth) || (pprevdepth != NULL && (pprevdepth->status & CRenderTarget::TS_NeedUpdate))) if ((pprevdepth != pnewdepth) || (pprevdepth != NULL && (pprevdepth->status & CRenderTarget::TS_NeedUpdate)))
result = 2; result = 2;
@ -407,7 +407,7 @@ void ZeroGS::VB::CheckFrame(int tbp)
if (prndr != NULL) SetContextTarget(ictx); if (prndr != NULL) SetContextTarget(ictx);
} }
// This is the case, most easy to perform, when nothinh was changed // This is the case, most easy to perform, when nothing was changed
inline void ZeroGS::VB::FlushTexUnchangedClutDontUpdate() inline void ZeroGS::VB::FlushTexUnchangedClutDontUpdate()
{ {
if (ZZOglGet_cld_TexBits(uNextTex0Data[1])) if (ZZOglGet_cld_TexBits(uNextTex0Data[1]))

View File

@ -580,7 +580,7 @@ void ZeroGS::CRenderTarget::ConvertTo32()
// assume depth already set !? // assume depth already set !?
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_NV, ptexConv, 0); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_NV, ptexConv, 0);
ZeroGS::ResetRenderTarget(1); ZeroGS::ResetRenderTarget(1);
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT); GL_REPORT_ERRORD();
BindToSample(&ptex) ; BindToSample(&ptex) ;
@ -688,7 +688,7 @@ void ZeroGS::CRenderTarget::ConvertTo16()
// assume depth already set !? // assume depth already set !?
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_NV, ptexConv, 0); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_NV, ptexConv, 0);
ZeroGS::ResetRenderTarget(1); ZeroGS::ResetRenderTarget(1);
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT); GL_REPORT_ERRORD();
BindToSample(&ptex) ; BindToSample(&ptex) ;
@ -796,7 +796,7 @@ void ZeroGS::CRenderTarget::_CreateFeedback()
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_NV, ptexFeedback, 0); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_NV, ptexFeedback, 0);
glBindTexture(GL_TEXTURE_RECTANGLE_NV, ptex); glBindTexture(GL_TEXTURE_RECTANGLE_NV, ptex);
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT); GL_REPORT_ERRORD();
cgGLSetTextureParameter(ppsBaseTexture.sFinal, ptex); cgGLSetTextureParameter(ppsBaseTexture.sFinal, ptex);
cgGLEnableTextureParameter(ppsBaseTexture.sFinal); cgGLEnableTextureParameter(ppsBaseTexture.sFinal);
@ -827,7 +827,7 @@ void ZeroGS::CRenderTarget::_CreateFeedback()
vb[icurctx].bVarsTexSync = 0; vb[icurctx].bVarsTexSync = 0;
} }
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT); GL_REPORT_ERRORD();
} }
void ZeroGS::CRenderTarget::SetRenderTarget(int targ) void ZeroGS::CRenderTarget::SetRenderTarget(int targ)
@ -836,8 +836,9 @@ void ZeroGS::CRenderTarget::SetRenderTarget(int targ)
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + targ, GL_TEXTURE_RECTANGLE_NV, ptex, 0); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + targ, GL_TEXTURE_RECTANGLE_NV, ptex, 0);
// if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT) //GL_REPORT_ERRORD();
// ERROR_LOG_SPAM("Too bad Framebuffer not compele, glitches could appear onscreen!\n"); //if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT)
//ERROR_LOG_SPAM("The Framebuffer is not complete. Glitches could appear onscreen.\n");
} }
ZeroGS::CDepthTarget::CDepthTarget() : CRenderTarget(), pdepth(0), pstencil(0), icount(0) {} ZeroGS::CDepthTarget::CDepthTarget() : CRenderTarget(), pdepth(0), pstencil(0), icount(0) {}
@ -1039,14 +1040,13 @@ void ZeroGS::CDepthTarget::Update(int context, ZeroGS::CRenderTarget* prndr)
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_NV, ptex, 0); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_NV, ptex, 0);
SetDepthStencilSurface(); SetDepthStencilSurface();
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_RECTANGLE_NV, 0, 0); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_RECTANGLE_NV, 0, 0);
GLenum buffer = GL_COLOR_ATTACHMENT0_EXT; GLenum buffer = GL_COLOR_ATTACHMENT0_EXT;
if (glDrawBuffers != NULL) glDrawBuffers(1, &buffer); if (glDrawBuffers != NULL) glDrawBuffers(1, &buffer);
int stat = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); GL_REPORT_ERRORD();
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT);
SetViewport(); SetViewport();
@ -1092,9 +1092,9 @@ void ZeroGS::CDepthTarget::SetDepthStencilSurface()
if (icount++ < 8) // not going to fail if succeeded 4 times if (icount++ < 8) // not going to fail if succeeded 4 times
{ {
GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); GL_REPORT_ERRORD();
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT)
{ {
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0);
@ -3909,7 +3909,7 @@ void _Resolve(const void* psrc, int fbp, int fbw, int fbh, int psm, u32 fbm, boo
void _Resolve(const void* psrc, int fbp, int fbw, int fbh, int psm, u32 fbm, bool mode) void _Resolve(const void* psrc, int fbp, int fbw, int fbh, int psm, u32 fbm, bool mode)
{ {
FUNCLOG FUNCLOG
//assert( glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT ); //GL_REPORT_ERRORD();
s_nResolved += 2; s_nResolved += 2;
// align the rect to the nearest page // align the rect to the nearest page

View File

@ -211,7 +211,8 @@ void ZeroGS::HandleGLError()
if (error != 0) if (error != 0)
{ {
int w, h; int w = 0;
int h = 0;
GLint fmt; GLint fmt;
glGetRenderbufferParameterivEXT(GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_INTERNAL_FORMAT_EXT, &fmt); glGetRenderbufferParameterivEXT(GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_INTERNAL_FORMAT_EXT, &fmt);
glGetRenderbufferParameterivEXT(GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_WIDTH_EXT, &w); glGetRenderbufferParameterivEXT(GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_WIDTH_EXT, &w);
@ -255,7 +256,7 @@ void ZeroGS::HandleGLError()
break; break;
default: default:
ZZLog::Error_Log("*UNKNOWN ERROR* reported from glCheckFramebufferStatusEXT() for %s!"); ZZLog::Error_Log("*UNKNOWN ERROR* reported from glCheckFramebufferStatusEXT(0x%x)!", error);
break; break;
} }
} }
@ -561,10 +562,6 @@ void ZeroGS::RenderCustom(float fAlpha)
vb[1].bSyncVars = 0; vb[1].bSyncVars = 0;
GL_REPORT_ERROR(); GL_REPORT_ERROR();
GLint status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
assert(status == GL_FRAMEBUFFER_COMPLETE_EXT || status == GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT);
} }
void ZeroGS::Restore() void ZeroGS::Restore()