Commit 8f2de7d5 authored by hybrid's avatar hybrid

Add blend equation function for MRTs

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3661 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 617d5a4e
...@@ -73,6 +73,7 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() : ...@@ -73,6 +73,7 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() :
pGlProvokingVertexARB(0), pGlProvokingVertexEXT(0), pGlProvokingVertexARB(0), pGlProvokingVertexEXT(0),
pGlColorMaskIndexedEXT(0), pGlEnableIndexedEXT(0), pGlDisableIndexedEXT(0), pGlColorMaskIndexedEXT(0), pGlEnableIndexedEXT(0), pGlDisableIndexedEXT(0),
pGlBlendFuncIndexedAMD(0), pGlBlendFunciARB(0), pGlBlendFuncIndexedAMD(0), pGlBlendFunciARB(0),
pGlBlendEquationIndexedAMD(0), pGlBlendEquationiARB(0),
pGlProgramParameteriARB(0), pGlProgramParameteriEXT(0), pGlProgramParameteriARB(0), pGlProgramParameteriEXT(0),
pGlGenQueriesARB(0), pGlDeleteQueriesARB(0), pGlIsQueryARB(0), pGlGenQueriesARB(0), pGlDeleteQueriesARB(0), pGlIsQueryARB(0),
pGlBeginQueryARB(0), pGlEndQueryARB(0), pGlGetQueryivARB(0), pGlBeginQueryARB(0), pGlEndQueryARB(0), pGlGetQueryivARB(0),
...@@ -249,6 +250,8 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -249,6 +250,8 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
pGlDisableIndexedEXT= (PFNGLDISABLEINDEXEDEXTPROC) wglGetProcAddress("glDisableIndexedEXT"); pGlDisableIndexedEXT= (PFNGLDISABLEINDEXEDEXTPROC) wglGetProcAddress("glDisableIndexedEXT");
pGlBlendFuncIndexedAMD= (PFNGLBLENDFUNCINDEXEDAMDPROC) wglGetProcAddress("glBlendFuncIndexedAMD"); pGlBlendFuncIndexedAMD= (PFNGLBLENDFUNCINDEXEDAMDPROC) wglGetProcAddress("glBlendFuncIndexedAMD");
pGlBlendFunciARB= (PFNGLBLENDFUNCIPROC) wglGetProcAddress("glBlendFunciARB"); pGlBlendFunciARB= (PFNGLBLENDFUNCIPROC) wglGetProcAddress("glBlendFunciARB");
pGlBlendEquationIndexedAMD= (PFNGLBLENDEQUATIONINDEXEDAMDPROC) wglGetProcAddress("glBlendEquationIndexedAMD");
pGlBlendEquationiARB= (PFNGLBLENDEQUATIONIPROC) wglGetProcAddress("glBlendEquationiARB");
pGlProgramParameteriARB= (PFNGLPROGRAMPARAMETERIARBPROC) wglGetProcAddress("glProgramParameteriARB"); pGlProgramParameteriARB= (PFNGLPROGRAMPARAMETERIARBPROC) wglGetProcAddress("glProgramParameteriARB");
pGlProgramParameteriEXT= (PFNGLPROGRAMPARAMETERIEXTPROC) wglGetProcAddress("glProgramParameteriEXT"); pGlProgramParameteriEXT= (PFNGLPROGRAMPARAMETERIEXTPROC) wglGetProcAddress("glProgramParameteriEXT");
...@@ -571,6 +574,10 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -571,6 +574,10 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glBlendFuncIndexedAMD")); IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glBlendFuncIndexedAMD"));
pGlBlendFunciARB= (PFNGLBLENDFUNCIPROC) pGlBlendFunciARB= (PFNGLBLENDFUNCIPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glBlendFunciARB")); IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glBlendFunciARB"));
pGlBlendEquationIndexedAMD= (PFNGLBLENDEQUATIONINDEXEDAMDPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glBlendEquationIndexedAMD"));
pGlBlendEquationiARB= (PFNGLBLENDEQUATIONIPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glBlendEquationiARB"));
pGlProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC) pGlProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glProgramParameteriARB")); IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glProgramParameteriARB"));
pGlProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC) pGlProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)
......
...@@ -1034,6 +1034,7 @@ class COpenGLExtensionHandler ...@@ -1034,6 +1034,7 @@ class COpenGLExtensionHandler
void extGlEnableIndexed(GLenum target, GLuint index); void extGlEnableIndexed(GLenum target, GLuint index);
void extGlDisableIndexed(GLenum target, GLuint index); void extGlDisableIndexed(GLenum target, GLuint index);
void extGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst); void extGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst);
void extGlBlendEquationIndexed(GLuint buf, GLenum mode);
void extGlProgramParameteri(GLuint program, GLenum pname, GLint value); void extGlProgramParameteri(GLuint program, GLenum pname, GLint value);
// occlusion query // occlusion query
...@@ -1143,6 +1144,8 @@ class COpenGLExtensionHandler ...@@ -1143,6 +1144,8 @@ class COpenGLExtensionHandler
PFNGLDISABLEINDEXEDEXTPROC pGlDisableIndexedEXT; PFNGLDISABLEINDEXEDEXTPROC pGlDisableIndexedEXT;
PFNGLBLENDFUNCINDEXEDAMDPROC pGlBlendFuncIndexedAMD; PFNGLBLENDFUNCINDEXEDAMDPROC pGlBlendFuncIndexedAMD;
PFNGLBLENDFUNCIPROC pGlBlendFunciARB; PFNGLBLENDFUNCIPROC pGlBlendFunciARB;
PFNGLBLENDEQUATIONINDEXEDAMDPROC pGlBlendEquationIndexedAMD;
PFNGLBLENDEQUATIONIPROC pGlBlendEquationiARB;
PFNGLPROGRAMPARAMETERIARBPROC pGlProgramParameteriARB; PFNGLPROGRAMPARAMETERIARBPROC pGlProgramParameteriARB;
PFNGLPROGRAMPARAMETERIEXTPROC pGlProgramParameteriEXT; PFNGLPROGRAMPARAMETERIEXTPROC pGlProgramParameteriEXT;
PFNGLGENQUERIESARBPROC pGlGenQueriesARB; PFNGLGENQUERIESARBPROC pGlGenQueriesARB;
...@@ -2174,6 +2177,23 @@ inline void COpenGLExtensionHandler::extGlBlendFuncIndexed(GLuint buf, GLenum sr ...@@ -2174,6 +2177,23 @@ inline void COpenGLExtensionHandler::extGlBlendFuncIndexed(GLuint buf, GLenum sr
} }
inline void COpenGLExtensionHandler::extGlBlendEquationIndexed(GLuint buf, GLenum mode)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (FeatureAvailable[IRR_ARB_draw_buffers_blend] && pGlBlendEquationiARB)
pGlBlendEquationiARB(buf, mode);
if (FeatureAvailable[IRR_AMD_draw_buffers_blend] && pGlBlendEquationIndexedAMD)
pGlBlendEquationIndexedAMD(buf, mode);
#elif defined(GL_ARB_draw_buffers_blend)
glBlendEquationiARB(buf, src, dst);
#elif defined(GL_AMD_draw_buffers_blend)
glBlendEquationIndexedAMD(buf, src, dst);
#else
os::Printer::log("glBlendEquationIndexed not supported", ELL_ERROR);
#endif
}
inline void COpenGLExtensionHandler::extGlProgramParameteri(GLuint program, GLenum pname, GLint value) inline void COpenGLExtensionHandler::extGlProgramParameteri(GLuint program, GLenum pname, GLint value)
{ {
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment