gsdx-ogl: LINUX-ONLY

* add a callback for GLERROR.  Allow to breakpoint on GSDeviceOGL::DebugCallback (gdb is completely lost on amd driver, hope it is better on nvidia)
* Add some empty glsl convert to shutup some useless debugging error
* request an advance opengl context without pre 3.0 feature.


git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl@4983 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2011-12-08 16:39:14 +00:00
parent 2be037d78f
commit afdb2dadc3
5 changed files with 33 additions and 11 deletions

View File

@ -289,7 +289,8 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
#ifdef __LINUX__
// Get the Xwindow from dsp.
s_gs->m_wnd.Attach((void*)((uint32*)(dsp)+1), false);
if( !s_gs->m_wnd.Attach((void*)((uint32*)(dsp)+1), false) )
return -1;
#else
s_gs->m_wnd.Attach(*dsp, false);
#endif

View File

@ -159,10 +159,11 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
}
}
m_window = wnd;
// FIXME disable it when code is ready
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
glDebugMessageCallbackARB(&GSDeviceOGL::DebugCallback, NULL);
m_window = wnd;
// ****************************************************************
// Various object
@ -1150,6 +1151,12 @@ void GSDeviceOGL::CompileShaderFromSource(const std::string& glsl_file, const st
free(log);
}
void GSDeviceOGL::DebugCallback(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, int length, const char* message, void* userParam)
{
DebugOutputToFile(source, type, id, severity, message);
}
void GSDeviceOGL::CheckDebugLog()
{
unsigned int count = 64; // max. num. of messages that will be read from the log

View File

@ -228,12 +228,6 @@ class GSDeviceOGL : public GSDevice
PSConstantBuffer m_ps_cb_cache;
#endif
//GLenum frag_back[1] = { GL_BACK };
//GLenum frag_target[1] = { GL_COLOR_ATTACHMENT0 }:
void CheckDebugLog();
void DebugOutputToFile(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, const char* message);
protected:
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
GSTexture* FetchSurface(int type, int w, int h, bool msaa, int format);
@ -244,6 +238,11 @@ class GSDeviceOGL : public GSDevice
GSDeviceOGL();
virtual ~GSDeviceOGL();
static void DebugCallback(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, int length, const char* message, void* userParam);
void CheckDebugLog();
static void DebugOutputToFile(unsigned int source, unsigned int type, unsigned int id, unsigned int severity, const char* message);
bool Create(GSWnd* wnd);
bool Reset(int w, int h);
void Flip();

View File

@ -361,8 +361,9 @@ bool GSWnd::Attach(void* handle, bool managed)
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 4,
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
// FIXME : Request a debug context to ease opengl development
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
// FIXME : Request a debug context to ease opengl development
// Note: don't support deprecated feature (pre openg 3.1)
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
0
};
m_context = glXCreateContextAttribsARB(m_XDisplay, fbc[0], 0, true, context_attribs);

View File

@ -94,6 +94,20 @@ void ps_main6() // diagonal
SV_Target0 = c;
}
// Avoid to log useless error compilation failure
void ps_main1()
{
}
void ps_main2()
{
}
void ps_main3()
{
}
void ps_main4()
{
}
//void ps_main1()
//{
// vec4 c = sample_c(TEXCOORD);