Merge large parts of nakeee's "Soap" branch into trunk, after fixing a few crash bugs in FileUtil.cpp.

Not really anything interesting, just some better comments, some slightly more portable/cleaner code in places.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2459 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-02-28 01:26:56 +00:00
parent 2783f24cfe
commit 4bdb4aa0d1
77 changed files with 1610 additions and 1479 deletions

View File

@ -294,7 +294,7 @@ void BPWritten(int addr, int changes, int newval)
if (!Renderer::SetScissorRect())
{
if (addr == BPMEM_SCISSORBR) {
ERROR_LOG("bad scissor!\n");
ERROR_LOG(VIDEO, "bad scissor!\n");
}
}
}

View File

@ -415,20 +415,20 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
if (vi == NULL) {
vi = glXChooseVisual(GLWin.dpy, GLWin.screen, attrListSgl);
GLWin.doubleBuffered = False;
ERROR_LOG("Only Singlebuffered Visual!\n");
ERROR_LOG(VIDEO, "Only Singlebuffered Visual!\n");
}
else {
GLWin.doubleBuffered = True;
ERROR_LOG("Got Doublebuffered Visual!\n");
ERROR_LOG(VIDEO, "Got Doublebuffered Visual!\n");
}
glXQueryVersion(GLWin.dpy, &glxMajorVersion, &glxMinorVersion);
ERROR_LOG("glX-Version %d.%d\n", glxMajorVersion, glxMinorVersion);
ERROR_LOG(VIDEO, "glX-Version %d.%d\n", glxMajorVersion, glxMinorVersion);
/* create a GLX context */
GLWin.ctx = glXCreateContext(GLWin.dpy, vi, 0, GL_TRUE);
if(!GLWin.ctx)
{
ERROR_LOG("Couldn't Create GLX context.Quit");
ERROR_LOG(VIDEO, "Couldn't Create GLX context.Quit");
exit(0); // TODO: Don't bring down entire Emu
}
/* create a color map */
@ -450,7 +450,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
// set best mode to current
bestMode = 0;
ERROR_LOG("XF86VidModeExtension-Version %d.%d\n", vidModeMajorVersion, vidModeMinorVersion);
ERROR_LOG(VIDEO, "XF86VidModeExtension-Version %d.%d\n", vidModeMajorVersion, vidModeMinorVersion);
XF86VidModeGetAllModeLines(GLWin.dpy, GLWin.screen, &modeNum, &modes);
if (modeNum > 0 && modes != NULL) {
@ -467,7 +467,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
XF86VidModeSetViewPort(GLWin.dpy, GLWin.screen, 0, 0);
dpyWidth = modes[bestMode]->hdisplay;
dpyHeight = modes[bestMode]->vdisplay;
ERROR_LOG("Resolution %dx%d\n", dpyWidth, dpyHeight);
ERROR_LOG(VIDEO, "Resolution %dx%d\n", dpyWidth, dpyHeight);
XFree(modes);
/* create a fullscreen window */
@ -484,7 +484,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
GrabModeAsync, GrabModeAsync, GLWin.win, None, CurrentTime);
}
else {
ERROR_LOG("Failed to start fullscreen. If you received the \n"
ERROR_LOG(VIDEO, "Failed to start fullscreen. If you received the \n"
"\"XFree86-VidModeExtension\" extension is missing, add\n"
"Load \"extmod\"\n"
"to your X configuration file (under the Module Section)\n");
@ -565,11 +565,11 @@ bool OpenGL_MakeCurrent()
glXMakeCurrent(GLWin.dpy, GLWin.win, GLWin.ctx);
XGetGeometry(GLWin.dpy, GLWin.win, &winDummy, &GLWin.x, &GLWin.y,
&GLWin.width, &GLWin.height, &borderDummy, &GLWin.depth);
ERROR_LOG("GLWin Depth %d", GLWin.depth)
ERROR_LOG(VIDEO, "GLWin Depth %d", GLWin.depth)
if (glXIsDirect(GLWin.dpy, GLWin.ctx)) {
ERROR_LOG("you have Direct Rendering!");
ERROR_LOG(VIDEO, "you have Direct Rendering!");
} else {
ERROR_LOG("no Direct Rendering possible!");
ERROR_LOG(VIDEO, "no Direct Rendering possible!");
}
// better for pad plugin key input (thc)
@ -781,7 +781,7 @@ void OpenGL_Shutdown()
{
if (!glXMakeCurrent(GLWin.dpy, None, NULL))
{
ERROR_LOG("Could not release drawing context.\n");
ERROR_LOG(VIDEO, "Could not release drawing context.\n");
}
XUnmapWindow(GLWin.dpy, GLWin.win);
glXDestroyContext(GLWin.dpy, GLWin.ctx);
@ -807,9 +807,9 @@ void HandleGLError()
{
GLint loc = 0;
glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &loc);
ERROR_LOG("program error at %d: ", loc);
ERROR_LOG((char*)pstr);
ERROR_LOG("\n");
ERROR_LOG(VIDEO, "program error at %d: ", loc);
ERROR_LOG(VIDEO, (char*)pstr);
ERROR_LOG(VIDEO, "\n");
}
// check the error status of this framebuffer */
@ -824,40 +824,40 @@ void HandleGLError()
case GL_FRAMEBUFFER_COMPLETE_EXT:
break;
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
ERROR_LOG("Error! missing a required image/buffer attachment!\n");
ERROR_LOG(VIDEO, "Error! missing a required image/buffer attachment!\n");
break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
ERROR_LOG("Error! has no images/buffers attached!\n");
ERROR_LOG(VIDEO, "Error! has no images/buffers attached!\n");
break;
// case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT:
// ERROR_LOG("Error! has an image/buffer attached in multiple locations!\n");
// ERROR_LOG(VIDEO, "Error! has an image/buffer attached in multiple locations!\n");
// break;
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
ERROR_LOG("Error! has mismatched image/buffer dimensions!\n");
ERROR_LOG(VIDEO, "Error! has mismatched image/buffer dimensions!\n");
break;
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
ERROR_LOG("Error! colorbuffer attachments have different types!\n");
ERROR_LOG(VIDEO, "Error! colorbuffer attachments have different types!\n");
break;
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
ERROR_LOG("Error! trying to draw to non-attached color buffer!\n");
ERROR_LOG(VIDEO, "Error! trying to draw to non-attached color buffer!\n");
break;
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
ERROR_LOG("Error! trying to read from a non-attached color buffer!\n");
ERROR_LOG(VIDEO, "Error! trying to read from a non-attached color buffer!\n");
break;
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
ERROR_LOG("Error! format is not supported by current graphics card/driver!\n");
ERROR_LOG(VIDEO, "Error! format is not supported by current graphics card/driver!\n");
break;
default:
ERROR_LOG("*UNKNOWN ERROR* reported from glCheckFramebufferStatusEXT()!\n");
ERROR_LOG(VIDEO, "*UNKNOWN ERROR* reported from glCheckFramebufferStatusEXT()!\n");
break;
}
}
void HandleCgError(CGcontext ctx, CGerror err, void* appdata)
{
ERROR_LOG("Cg error: %s\n", cgGetErrorString(err));
ERROR_LOG(VIDEO, "Cg error: %s\n", cgGetErrorString(err));
const char* listing = cgGetLastListing(g_cgcontext);
if (listing != NULL) {
ERROR_LOG(" last listing: %s\n", listing);
ERROR_LOG(VIDEO, " last listing: %s\n", listing);
}
}

View File

@ -67,10 +67,10 @@
#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
#endif
#define GL_REPORT_ERROR() { err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
#define GL_REPORT_ERROR() { err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG(VIDEO, "%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
#if defined(_DEBUG) || defined(DEBUGFAST)
#define GL_REPORT_ERRORD() { GLenum err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
#define GL_REPORT_ERRORD() { GLenum err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG(VIDEO, "%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
#else
#define GL_REPORT_ERRORD()
#endif

View File

@ -60,7 +60,7 @@ void PixelShaderCache::Init()
int maxinst, maxattribs;
glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, (GLint *)&maxinst);
glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB, (GLint *)&maxattribs);
ERROR_LOG("pixel max_alu=%d, max_inst=%d, max_attrib=%d\n", s_nMaxPixelInstructions, maxinst, maxattribs);
ERROR_LOG(VIDEO, "pixel max_alu=%d, max_inst=%d, max_attrib=%d\n", s_nMaxPixelInstructions, maxinst, maxattribs);
char pmatrixprog[1024];
sprintf(pmatrixprog, "!!ARBfp1.0"
@ -80,7 +80,7 @@ void PixelShaderCache::Init()
GLenum err = GL_NO_ERROR;
GL_REPORT_ERROR();
if (err != GL_NO_ERROR) {
ERROR_LOG("Failed to create color matrix fragment program\n");
ERROR_LOG(VIDEO, "Failed to create color matrix fragment program\n");
glDeleteProgramsARB(1, &s_ColorMatrixProgram);
s_ColorMatrixProgram = 0;
}
@ -139,7 +139,7 @@ FRAGMENTSHADER* PixelShaderCache::GetShader()
// printf("Compiling pixel shader. size = %i\n", strlen(code));
if (!code || !CompilePixelShader(newentry.shader, code)) {
ERROR_LOG("failed to create pixel shader\n");
ERROR_LOG(VIDEO, "failed to create pixel shader\n");
return NULL;
}
@ -178,8 +178,8 @@ bool PixelShaderCache::CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrpr
const char* opts[] = {"-profileopts", stropt, "-O2", "-q", NULL};
CGprogram tempprog = cgCreateProgram(g_cgcontext, CG_SOURCE, pstrprogram, g_cgfProf, "main", opts);
if (!cgIsProgram(tempprog) || cgGetError() != CG_NO_ERROR) {
ERROR_LOG("Failed to create ps %s:\n", cgGetLastListing(g_cgcontext));
ERROR_LOG(pstrprogram);
ERROR_LOG(VIDEO, "Failed to create ps %s:\n", cgGetLastListing(g_cgcontext));
ERROR_LOG(VIDEO, pstrprogram);
return false;
}
@ -209,8 +209,8 @@ bool PixelShaderCache::CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrpr
GLenum err = GL_NO_ERROR;
GL_REPORT_ERROR();
if (err != GL_NO_ERROR) {
ERROR_LOG(pstrprogram);
ERROR_LOG(pcompiledprog);
ERROR_LOG(VIDEO, pstrprogram);
ERROR_LOG(VIDEO, pcompiledprog);
}
cgDestroyProgram(tempprog);

View File

@ -126,9 +126,9 @@ bool Renderer::Init()
const char* ptoken = (const char*)glGetString(GL_EXTENSIONS);
if (ptoken == NULL) return false;
INFO_LOG("Supported OpenGL Extensions:\n");
INFO_LOG(ptoken); // write to the log file
INFO_LOG("\n");
INFO_LOG(VIDEO, "Supported OpenGL Extensions:\n");
INFO_LOG(VIDEO, ptoken); // write to the log file
INFO_LOG(VIDEO, "\n");
if (GLEW_EXT_blend_func_separate && GLEW_EXT_blend_equation_separate)
g_bBlendSeparate = true;
@ -140,24 +140,24 @@ bool Renderer::Init()
s_bFullscreen = g_Config.bFullscreen;
if (glewInit() != GLEW_OK) {
ERROR_LOG("glewInit() failed!\nDoes your video card support OpenGL 2.x?");
ERROR_LOG(VIDEO, "glewInit() failed!\nDoes your video card support OpenGL 2.x?");
return false;
}
if (!GLEW_EXT_framebuffer_object) {
ERROR_LOG("*********\nGPU: ERROR: Need GL_EXT_framebufer_object for multiple render targets\nGPU: *********\nDoes your video card support OpenGL 2.x?");
ERROR_LOG(VIDEO, "*********\nGPU: ERROR: Need GL_EXT_framebufer_object for multiple render targets\nGPU: *********\nDoes your video card support OpenGL 2.x?");
bSuccess = false;
}
if (!GLEW_EXT_secondary_color) {
ERROR_LOG("*********\nGPU: OGL ERROR: Need GL_EXT_secondary_color\nGPU: *********\nDoes your video card support OpenGL 2.x?");
ERROR_LOG(VIDEO, "*********\nGPU: OGL ERROR: Need GL_EXT_secondary_color\nGPU: *********\nDoes your video card support OpenGL 2.x?");
bSuccess = false;
}
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, (GLint *)&numvertexattribs);
if (numvertexattribs < 11) {
ERROR_LOG("*********\nGPU: OGL ERROR: Number of attributes %d not enough\nGPU: *********\nDoes your video card support OpenGL 2.x?", numvertexattribs);
ERROR_LOG(VIDEO, "*********\nGPU: OGL ERROR: Number of attributes %d not enough\nGPU: *********\nDoes your video card support OpenGL 2.x?", numvertexattribs);
bSuccess = false;
}
@ -168,12 +168,12 @@ bool Renderer::Init()
if (WGLEW_EXT_swap_control)
wglSwapIntervalEXT(0);
else
ERROR_LOG("no support for SwapInterval (framerate clamped to monitor refresh rate)\nDoes your video card support OpenGL 2.x?");
ERROR_LOG(VIDEO, "no support for SwapInterval (framerate clamped to monitor refresh rate)\nDoes your video card support OpenGL 2.x?");
#elif defined(HAVE_X11) && HAVE_X11
if (glXSwapIntervalSGI)
glXSwapIntervalSGI(0);
else
ERROR_LOG("no support for SwapInterval (framerate clamped to monitor refresh rate)\n");
ERROR_LOG(VIDEO, "no support for SwapInterval (framerate clamped to monitor refresh rate)\n");
#else
//TODO
@ -184,7 +184,7 @@ bool Renderer::Init()
GLint max_texture_size;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&max_texture_size);
if (max_texture_size < 1024) {
ERROR_LOG("GL_MAX_TEXTURE_SIZE too small at %i - must be at least 1024", max_texture_size);
ERROR_LOG(VIDEO, "GL_MAX_TEXTURE_SIZE too small at %i - must be at least 1024", max_texture_size);
}
GL_REPORT_ERROR();
@ -195,7 +195,7 @@ bool Renderer::Init()
glGenFramebuffersEXT(1, (GLuint *)&s_uFramebuffer);
if (s_uFramebuffer == 0) {
ERROR_LOG("failed to create the renderbuffer\nDoes your video card support OpenGL 2.x?");
ERROR_LOG(VIDEO, "failed to create the renderbuffer\nDoes your video card support OpenGL 2.x?");
}
_assert_(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) == GL_FRAMEBUFFER_COMPLETE_EXT);
@ -283,7 +283,7 @@ bool Renderer::Init()
}
if (s_ZBufferTarget == 0)
ERROR_LOG("disabling ztarget mrt feature (max mrt=%d)\n", nMaxMRT);
ERROR_LOG(VIDEO, "disabling ztarget mrt feature (max mrt=%d)\n", nMaxMRT);
// Why is this left here?
//glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, s_DepthTarget);
@ -299,12 +299,12 @@ bool Renderer::Init()
// load the effect, find the best profiles (if any)
if (cgGLIsProfileSupported(CG_PROFILE_ARBVP1) != CG_TRUE) {
ERROR_LOG("arbvp1 not supported\n");
ERROR_LOG(VIDEO, "arbvp1 not supported\n");
return false;
}
if (cgGLIsProfileSupported(CG_PROFILE_ARBFP1) != CG_TRUE) {
ERROR_LOG("arbfp1 not supported\n");
ERROR_LOG(VIDEO, "arbfp1 not supported\n");
return false;
}
@ -313,24 +313,24 @@ bool Renderer::Init()
cgGLSetOptimalOptions(g_cgvProf);
cgGLSetOptimalOptions(g_cgfProf);
//ERROR_LOG("max buffer sizes: %d %d\n", cgGetProgramBufferMaxSize(g_cgvProf), cgGetProgramBufferMaxSize(g_cgfProf));
//ERROR_LOG(VIDEO, "max buffer sizes: %d %d\n", cgGetProgramBufferMaxSize(g_cgvProf), cgGetProgramBufferMaxSize(g_cgfProf));
int nenvvertparams, nenvfragparams, naddrregisters[2];
glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, (GLint *)&nenvvertparams);
glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, (GLint *)&nenvfragparams);
glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB, (GLint *)&naddrregisters[0]);
glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB, (GLint *)&naddrregisters[1]);
DEBUG_LOG("max program env parameters: vert=%d, frag=%d\n", nenvvertparams, nenvfragparams);
DEBUG_LOG("max program address register parameters: vert=%d, frag=%d\n", naddrregisters[0], naddrregisters[1]);
DEBUG_LOG(VIDEO, "max program env parameters: vert=%d, frag=%d\n", nenvvertparams, nenvfragparams);
DEBUG_LOG(VIDEO, "max program address register parameters: vert=%d, frag=%d\n", naddrregisters[0], naddrregisters[1]);
if (nenvvertparams < 238)
ERROR_LOG("not enough vertex shader environment constants!!\n");
ERROR_LOG(VIDEO, "not enough vertex shader environment constants!!\n");
#ifndef _DEBUG
cgGLSetDebugMode(GL_FALSE);
#endif
if (cgGetError() != CG_NO_ERROR) {
ERROR_LOG("cg error\n");
ERROR_LOG(VIDEO, "cg error\n");
return false;
}
@ -591,7 +591,7 @@ bool Renderer::SetScissorRect()
rc_bottom *= MValueY;
if (rc_bottom > 480 * MValueY) rc_bottom = 480 * MValueY;
/*LOG("Scissor: lt=(%d,%d), rb=(%d,%d,%i), off=(%d,%d)\n",
/*LOG(VIDEO, "Scissor: lt=(%d,%d), rb=(%d,%d,%i), off=(%d,%d)\n",
rc_left, rc_top,
rc_right, rc_bottom, Renderer::GetTargetHeight(),
xoff, yoff
@ -1333,7 +1333,7 @@ void UpdateViewport()
// [4] = yorig + height/2 + 342
// [5] = 16777215 * farz
/*INFO_LOG("view: topleft=(%f,%f), wh=(%f,%f), z=(%f,%f)\n",
/*INFO_LOG(VIDEO, "view: topleft=(%f,%f), wh=(%f,%f), z=(%f,%f)\n",
rawViewport[3]-rawViewport[0]-342, rawViewport[4]+rawViewport[1]-342,
2 * rawViewport[0], 2 * rawViewport[1],
(rawViewport[5] - rawViewport[2]) / 16777215.0f, rawViewport[5] / 16777215.0f);*/

View File

@ -68,7 +68,7 @@ void CreateRgbToYuyvProgram()
"}\n";
if (!PixelShaderCache::CompilePixelShader(s_rgbToYuyvProgram, FProgram)) {
ERROR_LOG("Failed to create RGB to YUYV fragment program\n");
ERROR_LOG(VIDEO, "Failed to create RGB to YUYV fragment program\n");
}
}
@ -95,7 +95,7 @@ void CreateYuyvToRgbProgram()
"}\n";
if (!PixelShaderCache::CompilePixelShader(s_yuyvToRgbProgram, FProgram)) {
ERROR_LOG("Failed to create YUYV to RGB fragment program\n");
ERROR_LOG(VIDEO, "Failed to create YUYV to RGB fragment program\n");
}
}
@ -125,7 +125,7 @@ FRAGMENTSHADER& GetOrCreateEncodingShader(u32 format)
if (!PixelShaderCache::CompilePixelShader(s_encodingPrograms[format], shader)) {
const char* error = cgGetLastListing(g_cgcontext);
ERROR_LOG("Failed to create encoding fragment program\n");
ERROR_LOG(VIDEO, "Failed to create encoding fragment program\n");
}
}

View File

@ -101,10 +101,10 @@ void TextureMngr::TCacheEntry::SetTextureParameters(TexMode0 &newmode)
(g_Config.bForceFiltering || newmode.min_filter >= 4) ? GL_LINEAR : GL_NEAREST);
if (newmode.wrap_s == 2 || newmode.wrap_t == 2)
DEBUG_LOG("cannot support mirrorred repeat mode\n");
DEBUG_LOG(VIDEO, "cannot support mirrorred repeat mode\n");
if (newmode.wrap_s == 1 || newmode.wrap_t == 1)
DEBUG_LOG("cannot support repeat mode\n");
DEBUG_LOG(VIDEO, "cannot support repeat mode\n");
}
else {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
@ -531,7 +531,7 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool
colmat[0] = colmat[4] = colmat[8] = colmat[13] = 1;
break;
default:
ERROR_LOG("Unknown copy zbuf format: 0x%x\n", copyfmt);
ERROR_LOG(VIDEO, "Unknown copy zbuf format: 0x%x\n", copyfmt);
colmat[0] = colmat[5] = colmat[10] = colmat[15] = 1;
break;
}
@ -556,7 +556,7 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool
}
break;
default:
ERROR_LOG("Unknown copy intensity format: 0x%x\n", copyfmt);
ERROR_LOG(VIDEO, "Unknown copy intensity format: 0x%x\n", copyfmt);
colmat[0] = colmat[5] = colmat[10] = colmat[15] = 1;
break;
}
@ -598,7 +598,7 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool
break;
default:
ERROR_LOG("Unknown copy color format: 0x%x\n", copyfmt);
ERROR_LOG(VIDEO, "Unknown copy color format: 0x%x\n", copyfmt);
colmat[0] = colmat[5] = colmat[10] = colmat[15] = 1;
break;
}

View File

@ -226,7 +226,7 @@ void Flush()
}
}
else {
ERROR_LOG("error loading tex\n");
ERROR_LOG(VIDEO, "error loading tex\n");
TextureMngr::DisableStage(i); // disable since won't be used
}
}

View File

@ -97,7 +97,7 @@ VERTEXSHADER* VertexShaderCache::GetShader(u32 components)
#endif
if (!code || !VertexShaderCache::CompileVertexShader(entry.shader, code)) {
ERROR_LOG("failed to create vertex shader\n");
ERROR_LOG(VIDEO, "failed to create vertex shader\n");
return NULL;
}
@ -137,13 +137,13 @@ bool VertexShaderCache::CompileVertexShader(VERTEXSHADER& vs, const char* pstrpr
const char *opts[] = {"-profileopts", stropt, "-O2", "-q", NULL};
CGprogram tempprog = cgCreateProgram(g_cgcontext, CG_SOURCE, pstrprogram, g_cgvProf, "main", opts);
if (!cgIsProgram(tempprog) || cgGetError() != CG_NO_ERROR) {
ERROR_LOG("Failed to load vs %s:\n", cgGetLastListing(g_cgcontext));
ERROR_LOG(pstrprogram);
ERROR_LOG(VIDEO, "Failed to load vs %s:\n", cgGetLastListing(g_cgcontext));
ERROR_LOG(VIDEO, pstrprogram);
return false;
}
//ERROR_LOG(pstrprogram);
//ERROR_LOG("id: %d\n", g_Config.iSaveTargetId);
//ERROR_LOG(VIDEO, pstrprogram);
//ERROR_LOG(VIDEO, "id: %d\n", g_Config.iSaveTargetId);
char* pcompiledprog = (char*)cgGetProgramString(tempprog, CG_COMPILED_PROGRAM);
char* plocal = strstr(pcompiledprog, "program.local");
@ -161,8 +161,8 @@ bool VertexShaderCache::CompileVertexShader(VERTEXSHADER& vs, const char* pstrpr
GLenum err = GL_NO_ERROR;
GL_REPORT_ERROR();
if (err != GL_NO_ERROR) {
ERROR_LOG(pstrprogram);
ERROR_LOG(pcompiledprog);
ERROR_LOG(VIDEO, pstrprogram);
ERROR_LOG(VIDEO, pcompiledprog);
}
cgDestroyProgram(tempprog);

View File

@ -142,7 +142,7 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
case 0x1015:
case 0x1016:
case 0x1017:
DEBUG_LOG("xf addr: %x=%x\n", address, data);
DEBUG_LOG(VIDEO, "xf addr: %x=%x\n", address, data);
break;
case 0x1018:
//_assert_msg_(GX_XF, 0, "XF matrixindex0");
@ -195,7 +195,7 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
case 0x104d:
case 0x104e:
case 0x104f:
DEBUG_LOG("xf addr: %x=%x\n", address, data);
DEBUG_LOG(VIDEO, "xf addr: %x=%x\n", address, data);
break;
case 0x1050: xfregs.texcoords[0].postmtxinfo.hex = data; break;
case 0x1051: xfregs.texcoords[1].postmtxinfo.hex = data; break;
@ -207,7 +207,7 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
case 0x1057: xfregs.texcoords[7].postmtxinfo.hex = data; break;
default:
DEBUG_LOG("xf addr: %x=%x\n", address, data);
DEBUG_LOG(VIDEO, "xf addr: %x=%x\n", address, data);
break;
}
}