GL3: Remove GL_EXT_framebuffer_object

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 11 years ago
parent 40a6972753
commit 3bba0fad6c

@ -373,10 +373,15 @@ bool CDriverGL3::setupDisplay()
#endif // NL_OS_WINDOWS #endif // NL_OS_WINDOWS
// Check required extensions!! // Check required extensions!!
if (!_Extensions.GLCore)
{
nlwarning("Missing required GL 3.30 Core features. Update your driver");
throw EBadDisplay("Missing required GL 3.30 Core features. Update your driver");
}
if (!_Extensions.ARBSeparateShaderObjects) if (!_Extensions.ARBSeparateShaderObjects)
{ {
nlwarning("Missing Required GL extension: GL_ARB_separate_shader_objects. Update your driver"); nlwarning("Missing required GL extension: GL_ARB_separate_shader_objects. Update your driver");
throw EBadDisplay("Missing Required GL extension: GL_ARB_separate_shader_objects. Update your driver"); throw EBadDisplay("Missing required GL extension: GL_ARB_separate_shader_objects. Update your driver");
} }
// ARBMultiTexture is a OpenGL 1.2 required extension. // ARBMultiTexture is a OpenGL 1.2 required extension.
@ -550,7 +555,7 @@ bool CDriverGL3::activeFrameBufferObject(ITexture * tex)
} }
else else
{ {
nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); nglBindFramebuffer(GL_FRAMEBUFFER, 0);
return true; return true;
} }
} }
@ -1680,7 +1685,7 @@ bool CDriverGL3::supportPackedDepthStencil() const
{ {
H_AUTO_OGL(CDriverGL3_supportPackedDepthStencil); H_AUTO_OGL(CDriverGL3_supportPackedDepthStencil);
return _Extensions.PackedDepthStencil; return true;
} }
// *************************************************************************** // ***************************************************************************
@ -1688,7 +1693,7 @@ bool CDriverGL3::supportFrameBufferObject() const
{ {
H_AUTO_OGL(CDriverGL3_supportFrameBufferObject); H_AUTO_OGL(CDriverGL3_supportFrameBufferObject);
return _Extensions.FrameBufferObject; return true;
} }
// *************************************************************************** // ***************************************************************************

@ -318,6 +318,27 @@ PFNGLGETQUERYIVPROC nglGetQueryiv;
PFNGLGETQUERYOBJECTIVPROC nglGetQueryObjectiv; PFNGLGETQUERYOBJECTIVPROC nglGetQueryObjectiv;
PFNGLGETQUERYOBJECTUIVPROC nglGetQueryObjectuiv; PFNGLGETQUERYOBJECTUIVPROC nglGetQueryObjectuiv;
PFNGLISRENDERBUFFERPROC nglIsRenderbuffer;
PFNGLBINDRENDERBUFFERPROC nglBindRenderbuffer;
PFNGLDELETERENDERBUFFERSPROC nglDeleteRenderbuffers;
PFNGLGENRENDERBUFFERSPROC nglGenRenderbuffers;
PFNGLRENDERBUFFERSTORAGEPROC nglRenderbufferStorage;
PFNGLGETRENDERBUFFERPARAMETERIVPROC nglGetRenderbufferParameteriv;
PFNGLISFRAMEBUFFERPROC nglIsFramebuffer;
PFNGLBINDFRAMEBUFFERPROC nglBindFramebuffer;
PFNGLDELETEFRAMEBUFFERSPROC nglDeleteFramebuffers;
PFNGLGENFRAMEBUFFERSPROC nglGenFramebuffers;
PFNGLCHECKFRAMEBUFFERSTATUSPROC nglCheckFramebufferStatus;
PFNGLFRAMEBUFFERTEXTURE1DPROC nglFramebufferTexture1D;
PFNGLFRAMEBUFFERTEXTURE2DPROC nglFramebufferTexture2D;
PFNGLFRAMEBUFFERTEXTURE3DPROC nglFramebufferTexture3D;
PFNGLFRAMEBUFFERRENDERBUFFERPROC nglFramebufferRenderbuffer;
PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC nglGetFramebufferAttachmentParameteriv;
PFNGLGENERATEMIPMAPPROC nglGenerateMipmap;
PFNGLBLITFRAMEBUFFERPROC nglBlitFramebuffer;
PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC nglRenderbufferStorageMultisample;
PFNGLFRAMEBUFFERTEXTURELAYERPROC nglFramebufferTextureLayer;
// GL_ARB_separate_shader_objects // GL_ARB_separate_shader_objects
PFNGLUSEPROGRAMSTAGESPROC nglUseProgramStages; PFNGLUSEPROGRAMSTAGESPROC nglUseProgramStages;
PFNGLACTIVESHADERPROGRAMPROC nglActiveShaderProgram; PFNGLACTIVESHADERPROGRAMPROC nglActiveShaderProgram;
@ -380,28 +401,6 @@ PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC nglProgramUniformMatrix4x3dv;
PFNGLVALIDATEPROGRAMPIPELINEPROC nglValidateProgramPipeline; PFNGLVALIDATEPROGRAMPIPELINEPROC nglValidateProgramPipeline;
PFNGLGETPROGRAMPIPELINEINFOLOGPROC nglGetProgramPipelineInfoLog; PFNGLGETPROGRAMPIPELINEINFOLOGPROC nglGetProgramPipelineInfoLog;
// GL_EXT_framebuffer_object
NEL_PFNGLISRENDERBUFFEREXTPROC nglIsRenderbufferEXT;
NEL_PFNGLISFRAMEBUFFEREXTPROC nglIsFramebufferEXT;
NEL_PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC nglCheckFramebufferStatusEXT;
NEL_PFNGLGENFRAMEBUFFERSEXTPROC nglGenFramebuffersEXT;
NEL_PFNGLBINDFRAMEBUFFEREXTPROC nglBindFramebufferEXT;
NEL_PFNGLFRAMEBUFFERTEXTURE2DEXTPROC nglFramebufferTexture2DEXT;
NEL_PFNGLGENRENDERBUFFERSEXTPROC nglGenRenderbuffersEXT;
NEL_PFNGLBINDRENDERBUFFEREXTPROC nglBindRenderbufferEXT;
NEL_PFNGLRENDERBUFFERSTORAGEEXTPROC nglRenderbufferStorageEXT;
NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC nglFramebufferRenderbufferEXT;
NEL_PFNGLDELETERENDERBUFFERSEXTPROC nglDeleteRenderbuffersEXT;
NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC nglDeleteFramebuffersEXT;
NEL_PFNGETRENDERBUFFERPARAMETERIVEXTPROC nglGetRenderbufferParameterivEXT;
NEL_PFNGENERATEMIPMAPEXTPROC nglGenerateMipmapEXT;
// GL_EXT_framebuffer_blit
NEL_PFNGLBLITFRAMEBUFFEREXTPROC nglBlitFramebufferEXT;
// GL_EXT_framebuffer_multisample
NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC nglRenderbufferStorageMultisampleEXT;
// GL_ARB_multisample // GL_ARB_multisample
NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB; NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB;
@ -701,64 +700,7 @@ static bool setupEXTTextureFilterAnisotropic(const char *glext)
return true; return true;
} }
// *************************************************************************** static bool setupGLCore(const char *glext)
static bool setupFrameBufferObject(const char *glext)
{
H_AUTO_OGL(setupFrameBufferObject);
CHECK_EXT("GL_EXT_framebuffer_object");
CHECK_ADDRESS(NEL_PFNGLISRENDERBUFFEREXTPROC, glIsRenderbufferEXT);
CHECK_ADDRESS(NEL_PFNGLISFRAMEBUFFEREXTPROC, glIsFramebufferEXT);
CHECK_ADDRESS(NEL_PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC, glCheckFramebufferStatusEXT);
CHECK_ADDRESS(NEL_PFNGLGENFRAMEBUFFERSEXTPROC, glGenFramebuffersEXT);
CHECK_ADDRESS(NEL_PFNGLBINDFRAMEBUFFEREXTPROC, glBindFramebufferEXT);
CHECK_ADDRESS(NEL_PFNGLFRAMEBUFFERTEXTURE2DEXTPROC, glFramebufferTexture2DEXT);
CHECK_ADDRESS(NEL_PFNGLGENRENDERBUFFERSEXTPROC, glGenRenderbuffersEXT);
CHECK_ADDRESS(NEL_PFNGLBINDRENDERBUFFEREXTPROC, glBindRenderbufferEXT);
CHECK_ADDRESS(NEL_PFNGLRENDERBUFFERSTORAGEEXTPROC, glRenderbufferStorageEXT);
CHECK_ADDRESS(NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC, glFramebufferRenderbufferEXT);
CHECK_ADDRESS(NEL_PFNGLDELETERENDERBUFFERSEXTPROC, glDeleteRenderbuffersEXT);
CHECK_ADDRESS(NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC, glDeleteFramebuffersEXT);
CHECK_ADDRESS(NEL_PFNGETRENDERBUFFERPARAMETERIVEXTPROC, glGetRenderbufferParameterivEXT);
CHECK_ADDRESS(NEL_PFNGENERATEMIPMAPEXTPROC, glGenerateMipmapEXT);
return true;
}
// ***************************************************************************
static bool setupFrameBufferBlit(const char *glext)
{
H_AUTO_OGL(setupFrameBufferBlit);
CHECK_EXT("GL_EXT_framebuffer_blit");
CHECK_ADDRESS(NEL_PFNGLBLITFRAMEBUFFEREXTPROC, glBlitFramebufferEXT);
return true;
}
// ***************************************************************************
static bool setupFrameBufferMultisample(const char *glext)
{
H_AUTO_OGL(setupFrameBufferMultisample);
CHECK_EXT("GL_EXT_framebuffer_multisample");
CHECK_ADDRESS(NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC, glRenderbufferStorageMultisampleEXT);
return true;
}
// ***************************************************************************
static bool setupPackedDepthStencil(const char *glext)
{
H_AUTO_OGL(setupPackedDepthStencil);
CHECK_EXT("GL_EXT_packed_depth_stencil");
return true;
}
static bool setupCore(const char *glext)
{ {
CHECK_ADDRESS(PFNGLATTACHSHADERPROC, glAttachShader); CHECK_ADDRESS(PFNGLATTACHSHADERPROC, glAttachShader);
CHECK_ADDRESS(PFNGLCOMPILESHADERPROC, glCompileShader); CHECK_ADDRESS(PFNGLCOMPILESHADERPROC, glCompileShader);
@ -831,6 +773,27 @@ static bool setupCore(const char *glext)
CHECK_ADDRESS(PFNGLGETQUERYOBJECTIVPROC, glGetQueryObjectiv); CHECK_ADDRESS(PFNGLGETQUERYOBJECTIVPROC, glGetQueryObjectiv);
CHECK_ADDRESS(PFNGLGETQUERYOBJECTUIVPROC, glGetQueryObjectuiv); CHECK_ADDRESS(PFNGLGETQUERYOBJECTUIVPROC, glGetQueryObjectuiv);
CHECK_ADDRESS(PFNGLISRENDERBUFFERPROC, glIsRenderbuffer);
CHECK_ADDRESS(PFNGLBINDRENDERBUFFERPROC, glBindRenderbuffer);
CHECK_ADDRESS(PFNGLDELETERENDERBUFFERSPROC, glDeleteRenderbuffers);
CHECK_ADDRESS(PFNGLGENRENDERBUFFERSPROC, glGenRenderbuffers);
CHECK_ADDRESS(PFNGLRENDERBUFFERSTORAGEPROC, glRenderbufferStorage);
CHECK_ADDRESS(PFNGLGETRENDERBUFFERPARAMETERIVPROC, glGetRenderbufferParameteriv);
CHECK_ADDRESS(PFNGLISFRAMEBUFFERPROC, glIsFramebuffer);
CHECK_ADDRESS(PFNGLBINDFRAMEBUFFERPROC, glBindFramebuffer);
CHECK_ADDRESS(PFNGLDELETEFRAMEBUFFERSPROC, glDeleteFramebuffers);
CHECK_ADDRESS(PFNGLGENFRAMEBUFFERSPROC, glGenFramebuffers);
CHECK_ADDRESS(PFNGLCHECKFRAMEBUFFERSTATUSPROC, glCheckFramebufferStatus);
CHECK_ADDRESS(PFNGLFRAMEBUFFERTEXTURE1DPROC, glFramebufferTexture1D);
CHECK_ADDRESS(PFNGLFRAMEBUFFERTEXTURE2DPROC, glFramebufferTexture2D);
CHECK_ADDRESS(PFNGLFRAMEBUFFERTEXTURE3DPROC, glFramebufferTexture3D);
CHECK_ADDRESS(PFNGLFRAMEBUFFERRENDERBUFFERPROC, glFramebufferRenderbuffer);
CHECK_ADDRESS(PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC, glGetFramebufferAttachmentParameteriv);
CHECK_ADDRESS(PFNGLGENERATEMIPMAPPROC, glGenerateMipmap);
CHECK_ADDRESS(PFNGLBLITFRAMEBUFFERPROC, glBlitFramebuffer);
CHECK_ADDRESS(PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC, glRenderbufferStorageMultisample);
CHECK_ADDRESS(PFNGLFRAMEBUFFERTEXTURELAYERPROC, glFramebufferTextureLayer);
return true; return true;
} }
@ -939,7 +902,7 @@ void registerGlExtensions(CGlExtensions &ext)
} }
// Check 3.30 Core // Check 3.30 Core
setupCore(glext); ext.GLCore = setupGLCore(glext);
// Check GL_ARB_separate_shader_objects // Check GL_ARB_separate_shader_objects
ext.ARBSeparateShaderObjects = setupARBSeparateShaderObjects(glext); ext.ARBSeparateShaderObjects = setupARBSeparateShaderObjects(glext);
@ -998,18 +961,6 @@ void registerGlExtensions(CGlExtensions &ext)
// get the maximum value // get the maximum value
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &ext.EXTTextureFilterAnisotropicMaximum); glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &ext.EXTTextureFilterAnisotropicMaximum);
} }
// Check GL_EXT_framebuffer_object
ext.FrameBufferObject = setupFrameBufferObject(glext);
// Check GL_EXT_framebuffer_blit
ext.FrameBufferBlit = setupFrameBufferBlit(glext);
// Check GL_EXT_framebuffer_multisample
ext.FrameBufferMultisample = setupFrameBufferMultisample(glext);
// Check GL_EXT_packed_depth_stencil
ext.PackedDepthStencil = setupPackedDepthStencil(glext);
} }

@ -36,6 +36,7 @@ struct CGlExtensions
std::string GLVersion; std::string GLVersion;
// Required Extensions. // Required Extensions.
bool GLCore;
bool ARBSeparateShaderObjects; bool ARBSeparateShaderObjects;
bool ARBMultiTexture; bool ARBMultiTexture;
@ -49,10 +50,6 @@ struct CGlExtensions
bool NVTextureRectangle; bool NVTextureRectangle;
bool EXTTextureRectangle; bool EXTTextureRectangle;
bool ARBTextureRectangle; bool ARBTextureRectangle;
bool FrameBufferObject;
bool FrameBufferBlit;
bool FrameBufferMultisample;
bool PackedDepthStencil;
bool EXTTextureFilterAnisotropic; bool EXTTextureFilterAnisotropic;
float EXTTextureFilterAnisotropicMaximum; float EXTTextureFilterAnisotropicMaximum;
@ -102,10 +99,6 @@ public:
ARBTextureRectangle = false; ARBTextureRectangle = false;
ARBTextureNonPowerOfTwo = false; ARBTextureNonPowerOfTwo = false;
ARBMultisample = false; ARBMultisample = false;
FrameBufferObject = false;
FrameBufferBlit = false;
FrameBufferMultisample = false;
PackedDepthStencil = false;
NVStateVARWithoutFlush = 0; NVStateVARWithoutFlush = 0;
} }
@ -128,10 +121,6 @@ public:
result += "texture stages(*) = "; result += "texture stages(*) = ";
result += NLMISC::toString(NbTextureStages); result += NLMISC::toString(NbTextureStages);
result += "\n Programs: ";
result += "ARBFragmentProgram ";
result += "ARBVertexProgram";
result += "\n Misc: "; result += "\n Misc: ";
result += EXTVertexWeighting ? "EXTVertexWeighting " : ""; result += EXTVertexWeighting ? "EXTVertexWeighting " : "";
result += EXTSeparateSpecularColor ? "EXTSeparateSpecularColor " : ""; result += EXTSeparateSpecularColor ? "EXTSeparateSpecularColor " : "";
@ -153,15 +142,6 @@ public:
result += GLXMESASwapControl ? "GLXMESASwapControl " : ""; result += GLXMESASwapControl ? "GLXMESASwapControl " : "";
#endif #endif
result += "\n Array/VBO: ";
result += "VertexBufferObject";
result += "\n FBO: ";
result += FrameBufferObject ? "FramebufferObject " : "";
result += FrameBufferBlit ? "FrameBufferBlit " : "";
result += FrameBufferMultisample ? "FrameBufferMultisample " : "";
result += PackedDepthStencil ? "PackedDepthStencil " : "";
return result; return result;
} }
@ -394,7 +374,7 @@ extern PFNGLGETVERTEXATTRIBIVARBPROC nglGetVertexAttribivARB;
extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC nglGetVertexAttribPointervARB; extern PFNGLGETVERTEXATTRIBPOINTERVARBPROC nglGetVertexAttribPointervARB;
extern PFNGLISPROGRAMARBPROC nglIsProgramARB; extern PFNGLISPROGRAMARBPROC nglIsProgramARB;
// Core // Core 3.30
extern PFNGLATTACHSHADERPROC nglAttachShader; extern PFNGLATTACHSHADERPROC nglAttachShader;
extern PFNGLCOMPILESHADERPROC nglCompileShader; extern PFNGLCOMPILESHADERPROC nglCompileShader;
extern PFNGLCREATEPROGRAMPROC nglCreateProgram; extern PFNGLCREATEPROGRAMPROC nglCreateProgram;
@ -466,6 +446,27 @@ extern PFNGLGETQUERYIVPROC nglGetQueryiv;
extern PFNGLGETQUERYOBJECTIVPROC nglGetQueryObjectiv; extern PFNGLGETQUERYOBJECTIVPROC nglGetQueryObjectiv;
extern PFNGLGETQUERYOBJECTUIVPROC nglGetQueryObjectuiv; extern PFNGLGETQUERYOBJECTUIVPROC nglGetQueryObjectuiv;
extern PFNGLISRENDERBUFFERPROC nglIsRenderbuffer;
extern PFNGLBINDRENDERBUFFERPROC nglBindRenderbuffer;
extern PFNGLDELETERENDERBUFFERSPROC nglDeleteRenderbuffers;
extern PFNGLGENRENDERBUFFERSPROC nglGenRenderbuffers;
extern PFNGLRENDERBUFFERSTORAGEPROC nglRenderbufferStorage;
extern PFNGLGETRENDERBUFFERPARAMETERIVPROC nglGetRenderbufferParameteriv;
extern PFNGLISFRAMEBUFFERPROC nglIsFramebuffer;
extern PFNGLBINDFRAMEBUFFERPROC nglBindFramebuffer;
extern PFNGLDELETEFRAMEBUFFERSPROC nglDeleteFramebuffers;
extern PFNGLGENFRAMEBUFFERSPROC nglGenFramebuffers;
extern PFNGLCHECKFRAMEBUFFERSTATUSPROC nglCheckFramebufferStatus;
extern PFNGLFRAMEBUFFERTEXTURE1DPROC nglFramebufferTexture1D;
extern PFNGLFRAMEBUFFERTEXTURE2DPROC nglFramebufferTexture2D;
extern PFNGLFRAMEBUFFERTEXTURE3DPROC nglFramebufferTexture3D;
extern PFNGLFRAMEBUFFERRENDERBUFFERPROC nglFramebufferRenderbuffer;
extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC nglGetFramebufferAttachmentParameteriv;
extern PFNGLGENERATEMIPMAPPROC nglGenerateMipmap;
extern PFNGLBLITFRAMEBUFFERPROC nglBlitFramebuffer;
extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC nglRenderbufferStorageMultisample;
extern PFNGLFRAMEBUFFERTEXTURELAYERPROC nglFramebufferTextureLayer;
// GL_ARB_separate_shader_objects // GL_ARB_separate_shader_objects
extern PFNGLUSEPROGRAMSTAGESPROC nglUseProgramStages; extern PFNGLUSEPROGRAMSTAGESPROC nglUseProgramStages;
extern PFNGLACTIVESHADERPROGRAMPROC nglActiveShaderProgram; extern PFNGLACTIVESHADERPROGRAMPROC nglActiveShaderProgram;
@ -569,28 +570,6 @@ extern NEL_PFNGLXGETSWAPINTERVALMESAPROC nglXGetSwapIntervalMESA;
#endif #endif
// GL_EXT_framebuffer_object
extern NEL_PFNGLISRENDERBUFFEREXTPROC nglIsRenderbufferEXT;
extern NEL_PFNGLISFRAMEBUFFEREXTPROC nglIsFramebufferEXT;
extern NEL_PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC nglCheckFramebufferStatusEXT;
extern NEL_PFNGLGENFRAMEBUFFERSEXTPROC nglGenFramebuffersEXT;
extern NEL_PFNGLBINDFRAMEBUFFEREXTPROC nglBindFramebufferEXT;
extern NEL_PFNGLFRAMEBUFFERTEXTURE2DEXTPROC nglFramebufferTexture2DEXT;
extern NEL_PFNGLGENRENDERBUFFERSEXTPROC nglGenRenderbuffersEXT;
extern NEL_PFNGLBINDRENDERBUFFEREXTPROC nglBindRenderbufferEXT;
extern NEL_PFNGLRENDERBUFFERSTORAGEEXTPROC nglRenderbufferStorageEXT;
extern NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC nglFramebufferRenderbufferEXT;
extern NEL_PFNGLDELETERENDERBUFFERSEXTPROC nglDeleteRenderbuffersEXT;
extern NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC nglDeleteFramebuffersEXT;
extern NEL_PFNGETRENDERBUFFERPARAMETERIVEXTPROC nglGetRenderbufferParameterivEXT;
extern NEL_PFNGENERATEMIPMAPEXTPROC nglGenerateMipmapEXT;
// GL_EXT_framebuffer_blit
extern NEL_PFNGLBLITFRAMEBUFFEREXTPROC nglBlitFramebufferEXT;
// GL_EXT_framebuffer_multisample
extern NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC nglRenderbufferStorageMultisampleEXT;
// GL_ARB_multisample // GL_ARB_multisample
extern NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB; extern NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB;

@ -173,24 +173,6 @@ typedef GLvoid (APIENTRY *NEL_PFNGLGETPROGRAMIVARBPROC)(GLenum target, GLenum pn
typedef GLvoid (APIENTRY *NEL_PFNGLGETPROGRAMSTRINGARBPROC)(GLenum target, GLenum pname, GLvoid *string); typedef GLvoid (APIENTRY *NEL_PFNGLGETPROGRAMSTRINGARBPROC)(GLenum target, GLenum pname, GLvoid *string);
typedef GLboolean (APIENTRY *NEL_PFNGLISPROGRAMARBPROC)(GLuint program); typedef GLboolean (APIENTRY *NEL_PFNGLISPROGRAMARBPROC)(GLuint program);
typedef GLboolean (APIENTRY * NEL_PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
typedef GLboolean (APIENTRY * NEL_PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
typedef GLenum (APIENTRY * NEL_PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum pname);
typedef GLvoid (APIENTRY * NEL_PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
typedef GLvoid (APIENTRY * NEL_PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
typedef GLvoid (APIENTRY * NEL_PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef GLvoid (APIENTRY * NEL_PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
typedef GLvoid (APIENTRY * NEL_PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
typedef GLvoid (APIENTRY * NEL_PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef GLvoid (APIENTRY * NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef GLvoid (APIENTRY * NEL_PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
typedef GLvoid (APIENTRY * NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
typedef GLvoid (APIENTRY * NEL_PFNGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef GLvoid (APIENTRY * NEL_PFNGENERATEMIPMAPEXTPROC) (GLenum target);
typedef GLvoid (APIENTRY * NEL_PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef GLvoid (APIENTRY * NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef GLvoid (APIENTRY * NEL_PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
#ifndef NL_GL_ARB_multisample #ifndef NL_GL_ARB_multisample

@ -87,12 +87,12 @@ CTextureDrvInfosGL3::~CTextureDrvInfosGL3()
if (InitFBO) if (InitFBO)
{ {
nglDeleteFramebuffersEXT(1, &FBOId); nglDeleteFramebuffers(1, &FBOId);
if (AttachDepthStencil) if (AttachDepthStencil)
{ {
nglDeleteRenderbuffersEXT(1, &DepthFBOId); nglDeleteRenderbuffers(1, &DepthFBOId);
if (!UsePackedDepthStencil) if (!UsePackedDepthStencil)
nglDeleteRenderbuffersEXT(1, &StencilFBOId); nglDeleteRenderbuffers(1, &StencilFBOId);
} }
} }
} }
@ -108,21 +108,21 @@ bool CTextureDrvInfosGL3::initFrameBufferObject(ITexture * tex)
} }
// generate IDs // generate IDs
nglGenFramebuffersEXT(1, &FBOId); nglGenFramebuffers(1, &FBOId);
if (AttachDepthStencil) if (AttachDepthStencil)
{ {
nglGenRenderbuffersEXT(1, &DepthFBOId); nglGenRenderbuffers(1, &DepthFBOId);
if (UsePackedDepthStencil) if (UsePackedDepthStencil)
StencilFBOId = DepthFBOId; StencilFBOId = DepthFBOId;
else else
nglGenRenderbuffersEXT(1, &StencilFBOId); nglGenRenderbuffers(1, &StencilFBOId);
} }
//nldebug("3D: using depth %d and stencil %d", DepthFBOId, StencilFBOId); //nldebug("3D: using depth %d and stencil %d", DepthFBOId, StencilFBOId);
// initialize FBO // initialize FBO
nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOId); nglBindFramebuffer(GL_FRAMEBUFFER, FBOId);
nglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, TextureMode, ID, 0); nglFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, TextureMode, ID, 0);
// attach depth/stencil render to FBO // attach depth/stencil render to FBO
// note: for some still unkown reason it's impossible to add // note: for some still unkown reason it's impossible to add
@ -130,113 +130,79 @@ bool CTextureDrvInfosGL3::initFrameBufferObject(ITexture * tex)
// opengl.org extension registry). Until a safe approach to add // opengl.org extension registry). Until a safe approach to add
// them is found, there will be no attached stencil for the time // them is found, there will be no attached stencil for the time
// being, aside of using packed depth+stencil buffers. // being, aside of using packed depth+stencil buffers.
// FIXME GL3
if (AttachDepthStencil) if (AttachDepthStencil)
{ {
if (UsePackedDepthStencil) if (UsePackedDepthStencil)
{ {
//nldebug("3D: using packed depth stencil"); //nldebug("3D: using packed depth stencil");
nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilFBOId); nglBindRenderbuffer(GL_RENDERBUFFER, StencilFBOId);
nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, tex->getWidth(), tex->getHeight()); nglRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, tex->getWidth(), tex->getHeight());
} }
else else
{ {
nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthFBOId); nglBindRenderbuffer(GL_RENDERBUFFER, DepthFBOId);
nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, tex->getWidth(), tex->getHeight()); nglRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, tex->getWidth(), tex->getHeight());
/* /*
nglBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilFBOId); nglBindRenderbuffer(GL_RENDERBUFFER, StencilFBOId);
nglRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX8_EXT, tex->getWidth(), tex->getHeight()); nglRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, tex->getWidth(), tex->getHeight());
*/ */
} }
nglFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, nglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
GL_RENDERBUFFER_EXT, DepthFBOId); GL_RENDERBUFFER, DepthFBOId);
nldebug("3D: glFramebufferRenderbufferExt(depth:24) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); nldebug("3D: glFramebufferRenderbufferExt(depth:24) = %X", nglCheckFramebufferStatus(GL_FRAMEBUFFER));
nglFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, nglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
GL_RENDERBUFFER_EXT, StencilFBOId); GL_RENDERBUFFER, StencilFBOId);
nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); nldebug("3D: glFramebufferRenderbufferExt(stencil:8) = %X", nglCheckFramebufferStatus(GL_FRAMEBUFFER));
} }
// check status // check status
GLenum status; GLenum status;
status = (GLenum) nglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); status = (GLenum) nglCheckFramebufferStatus(GL_FRAMEBUFFER);
switch(status) { switch(status) {
#ifdef GL_FRAMEBUFFER_COMPLETE_EXT #ifdef GL_FRAMEBUFFER_COMPLETE
case GL_FRAMEBUFFER_COMPLETE_EXT: case GL_FRAMEBUFFER_COMPLETE:
InitFBO = true; InitFBO = true;
break; break;
#endif #endif
#ifdef GL_FRAMEBUFFER_COMPLETE_OES #ifdef GL_FRAMEBUFFER_UNSUPPORTED
case GL_FRAMEBUFFER_COMPLETE_OES: case GL_FRAMEBUFFER_UNSUPPORTED:
InitFBO = true;
break;
#endif
#ifdef GL_FRAMEBUFFER_UNSUPPORTED_EXT
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
nlwarning("Unsupported framebuffer format");
break;
#endif
#ifdef GL_FRAMEBUFFER_UNSUPPORTED_OES
case GL_FRAMEBUFFER_UNSUPPORTED_OES:
nlwarning("Unsupported framebuffer format"); nlwarning("Unsupported framebuffer format");
break; break;
#endif #endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT #ifdef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
nlwarning("Framebuffer incomplete attachment"); nlwarning("Framebuffer incomplete attachment");
break; break;
#endif #endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES #ifdef GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES: case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
nlwarning("Framebuffer incomplete attachment");
break;
#endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
nlwarning("Framebuffer incomplete, missing attachment");
break;
#endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES:
nlwarning("Framebuffer incomplete, missing attachment"); nlwarning("Framebuffer incomplete, missing attachment");
break; break;
#endif #endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT #ifdef GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT
case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT: case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT:
nlwarning("Framebuffer incomplete, duplicate attachment"); nlwarning("Framebuffer incomplete, duplicate attachment");
break; break;
#endif #endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT #ifdef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
nlwarning("Framebuffer incomplete, attached images must have same dimensions"); nlwarning("Framebuffer incomplete, attached images must have same dimensions");
break; break;
#endif #endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES #ifdef GL_FRAMEBUFFER_INCOMPLETE_FORMATS
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES: case GL_FRAMEBUFFER_INCOMPLETE_FORMATS:
nlwarning("Framebuffer incomplete, attached images must have same dimensions");
break;
#endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
nlwarning("Framebuffer incomplete, attached images must have same format");
break;
#endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES:
nlwarning("Framebuffer incomplete, attached images must have same format"); nlwarning("Framebuffer incomplete, attached images must have same format");
break; break;
#endif #endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT #ifdef GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT: case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
nlwarning("Framebuffer incomplete, missing draw buffer"); nlwarning("Framebuffer incomplete, missing draw buffer");
break; break;
#endif #endif
#ifdef GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT #ifdef GL_FRAMEBUFFER_BINDING
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: case GL_FRAMEBUFFER_BINDING:
nlwarning("Framebuffer incomplete, missing read buffer");
break;
#endif
#ifdef GL_FRAMEBUFFER_BINDING_EXT
case GL_FRAMEBUFFER_BINDING_EXT:
nlwarning("Framebuffer BINDING_EXT"); nlwarning("Framebuffer BINDING_EXT");
break; break;
#endif #endif
@ -244,11 +210,6 @@ bool CTextureDrvInfosGL3::initFrameBufferObject(ITexture * tex)
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
nlwarning("Framebuffer incomplete multisample"); nlwarning("Framebuffer incomplete multisample");
break; break;
#endif
#ifdef GL_FRAMEBUFFER_BINDING_OES
case GL_FRAMEBUFFER_BINDING_OES:
nlwarning("Framebuffer BINDING_EXT");
break;
#endif #endif
default: default:
nlwarning("Framebuffer incomplete status %d", (sint)status); nlwarning("Framebuffer incomplete status %d", (sint)status);
@ -258,14 +219,14 @@ bool CTextureDrvInfosGL3::initFrameBufferObject(ITexture * tex)
// clean up resources if allocation failed // clean up resources if allocation failed
if (!InitFBO) if (!InitFBO)
{ {
nglDeleteFramebuffersEXT(1, &FBOId); nglDeleteFramebuffers(1, &FBOId);
if (AttachDepthStencil) if (AttachDepthStencil)
{ {
nglDeleteRenderbuffersEXT(1, &DepthFBOId); nglDeleteRenderbuffers(1, &DepthFBOId);
if (!UsePackedDepthStencil) if (!UsePackedDepthStencil)
nglDeleteRenderbuffersEXT(1, &StencilFBOId); nglDeleteRenderbuffers(1, &StencilFBOId);
} }
} }
@ -282,14 +243,14 @@ bool CTextureDrvInfosGL3::activeFrameBufferObject(ITexture * tex)
if (initFrameBufferObject(tex)) if (initFrameBufferObject(tex))
{ {
glBindTexture(TextureMode, 0); glBindTexture(TextureMode, 0);
nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBOId); nglBindFramebuffer(GL_FRAMEBUFFER, FBOId);
} }
else else
return false; return false;
} }
else else
{ {
nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); nglBindFramebuffer(GL_FRAMEBUFFER, 0);
} }
return true; return true;

Loading…
Cancel
Save