mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
2be037d78f
commit
afdb2dadc3
|
@ -289,7 +289,8 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
|
||||||
|
|
||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
// Get the Xwindow from dsp.
|
// 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
|
#else
|
||||||
s_gs->m_wnd.Attach(*dsp, false);
|
s_gs->m_wnd.Attach(*dsp, false);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -159,10 +159,11 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_window = wnd;
|
|
||||||
|
|
||||||
// FIXME disable it when code is ready
|
// FIXME disable it when code is ready
|
||||||
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
|
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
|
||||||
|
glDebugMessageCallbackARB(&GSDeviceOGL::DebugCallback, NULL);
|
||||||
|
|
||||||
|
m_window = wnd;
|
||||||
|
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
// Various object
|
// Various object
|
||||||
|
@ -1150,6 +1151,12 @@ void GSDeviceOGL::CompileShaderFromSource(const std::string& glsl_file, const st
|
||||||
free(log);
|
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()
|
void GSDeviceOGL::CheckDebugLog()
|
||||||
{
|
{
|
||||||
unsigned int count = 64; // max. num. of messages that will be read from the log
|
unsigned int count = 64; // max. num. of messages that will be read from the log
|
||||||
|
|
|
@ -228,12 +228,6 @@ class GSDeviceOGL : public GSDevice
|
||||||
PSConstantBuffer m_ps_cb_cache;
|
PSConstantBuffer m_ps_cb_cache;
|
||||||
#endif
|
#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:
|
protected:
|
||||||
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
|
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
|
||||||
GSTexture* FetchSurface(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();
|
GSDeviceOGL();
|
||||||
virtual ~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 Create(GSWnd* wnd);
|
||||||
bool Reset(int w, int h);
|
bool Reset(int w, int h);
|
||||||
void Flip();
|
void Flip();
|
||||||
|
|
|
@ -361,8 +361,9 @@ bool GSWnd::Attach(void* handle, bool managed)
|
||||||
{
|
{
|
||||||
GLX_CONTEXT_MAJOR_VERSION_ARB, 4,
|
GLX_CONTEXT_MAJOR_VERSION_ARB, 4,
|
||||||
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
|
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
|
||||||
// FIXME : Request a debug context to ease opengl development
|
// FIXME : Request a debug context to ease opengl development
|
||||||
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
|
// 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
|
0
|
||||||
};
|
};
|
||||||
m_context = glXCreateContextAttribsARB(m_XDisplay, fbc[0], 0, true, context_attribs);
|
m_context = glXCreateContextAttribsARB(m_XDisplay, fbc[0], 0, true, context_attribs);
|
||||||
|
|
|
@ -94,6 +94,20 @@ void ps_main6() // diagonal
|
||||||
SV_Target0 = c;
|
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()
|
//void ps_main1()
|
||||||
//{
|
//{
|
||||||
// vec4 c = sample_c(TEXCOORD);
|
// vec4 c = sample_c(TEXCOORD);
|
||||||
|
|
Loading…
Reference in New Issue