Changed: #573 Added new checks for FBO extensions and multisample

This commit is contained in:
kervala 2010-12-20 16:48:03 +01:00
parent b9f9d418da
commit e60ba59fec
2 changed files with 91 additions and 2 deletions

View file

@ -417,6 +417,17 @@ NEL_PFNGLRENDERBUFFERSTORAGEEXTPROC nglRenderbufferStorageEXT;
NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC nglFramebufferRenderbufferEXT; NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC nglFramebufferRenderbufferEXT;
NEL_PFNGLDELETERENDERBUFFERSEXTPROC nglDeleteRenderbuffersEXT; NEL_PFNGLDELETERENDERBUFFERSEXTPROC nglDeleteRenderbuffersEXT;
NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC nglDeleteFramebuffersEXT; 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
NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB;
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
PFNWGLALLOCATEMEMORYNVPROC nwglAllocateMemoryNV; PFNWGLALLOCATEMEMORYNVPROC nwglAllocateMemoryNV;
@ -889,6 +900,17 @@ static bool setupWGLARBPBuffer(const char *glext)
return true; return true;
} }
// *********************************
static bool setupARBMultisample(const char *glext)
{
H_AUTO_OGL(setupARBMultisample);
CHECK_EXT("GL_ARB_multisample");
CHECK_ADDRESS(NEL_PFNGLSAMPLECOVERAGEARBPROC, glSampleCoverageARB);
return true;
}
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
// ********************************* // *********************************
static bool setupWGLARBPixelFormat (const char *glext) static bool setupWGLARBPixelFormat (const char *glext)
@ -1188,6 +1210,14 @@ static bool setupARBTextureRectangle(const char *glext)
return true; return true;
} }
// ***************************************************************************
static bool setupEXTTextureFilterAnisotropic(const char *glext)
{
H_AUTO_OGL(setupEXTTextureFilterAnisotropic);
CHECK_EXT("GL_EXT_texture_filter_anisotropic");
return true;
}
// *************************************************************************** // ***************************************************************************
static bool setupFrameBufferObject(const char *glext) static bool setupFrameBufferObject(const char *glext)
{ {
@ -1206,6 +1236,30 @@ static bool setupFrameBufferObject(const char *glext)
CHECK_ADDRESS(NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC, glFramebufferRenderbufferEXT); CHECK_ADDRESS(NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC, glFramebufferRenderbufferEXT);
CHECK_ADDRESS(NEL_PFNGLDELETERENDERBUFFERSEXTPROC, glDeleteRenderbuffersEXT); CHECK_ADDRESS(NEL_PFNGLDELETERENDERBUFFERSEXTPROC, glDeleteRenderbuffersEXT);
CHECK_ADDRESS(NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC, glDeleteFramebuffersEXT); 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; return true;
} }
@ -1268,6 +1322,9 @@ void registerGlExtensions(CGlExtensions &ext)
// Check ARBTextureNonPowerOfTwo // Check ARBTextureNonPowerOfTwo
ext.ARBTextureNonPowerOfTwo= setupARBTextureNonPowerOfTwo(glext); ext.ARBTextureNonPowerOfTwo= setupARBTextureNonPowerOfTwo(glext);
// Check ARBMultisample
ext.ARBMultisample = setupARBMultisample(glext);
// Check NVVertexArrayRange // Check NVVertexArrayRange
// Disable feature ??? // Disable feature ???
if(!ext.DisableHardwareVertexArrayAGP) if(!ext.DisableHardwareVertexArrayAGP)
@ -1360,9 +1417,18 @@ void registerGlExtensions(CGlExtensions &ext)
// Check GL_ARB_texture_rectangle // Check GL_ARB_texture_rectangle
ext.ARBTextureRectangle = setupARBTextureRectangle(glext); ext.ARBTextureRectangle = setupARBTextureRectangle(glext);
// Check GL_EXT_texture_filter_anisotropic
ext.EXTTextureFilterAnisotropic = setupEXTTextureFilterAnisotropic(glext);
// Check GL_EXT_framebuffer_object // Check GL_EXT_framebuffer_object
ext.FrameBufferObject = setupFrameBufferObject(glext); 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 // Check GL_EXT_packed_depth_stencil
ext.PackedDepthStencil = setupPackedDepthStencil(glext); ext.PackedDepthStencil = setupPackedDepthStencil(glext);

View file

@ -80,7 +80,10 @@ struct CGlExtensions
bool EXTTextureRectangle; bool EXTTextureRectangle;
bool ARBTextureRectangle; bool ARBTextureRectangle;
bool FrameBufferObject; bool FrameBufferObject;
bool FrameBufferBlit;
bool FrameBufferMultisample;
bool PackedDepthStencil; bool PackedDepthStencil;
bool EXTTextureFilterAnisotropic;
// true if NVVertexProgram and if we know that VP is emulated // true if NVVertexProgram and if we know that VP is emulated
bool NVVertexProgramEmulated; bool NVVertexProgramEmulated;
bool EXTSecondaryColor; bool EXTSecondaryColor;
@ -114,6 +117,7 @@ struct CGlExtensions
bool ARBVertexBufferObject; bool ARBVertexBufferObject;
bool ARBVertexProgram; bool ARBVertexProgram;
bool ARBTextureNonPowerOfTwo; bool ARBTextureNonPowerOfTwo;
bool ARBMultisample;
public: public:
@ -165,10 +169,14 @@ public:
ARBVertexProgram = false; ARBVertexProgram = false;
NVTextureRectangle = false; NVTextureRectangle = false;
EXTTextureRectangle = false; EXTTextureRectangle = false;
EXTTextureFilterAnisotropic = false;
ARBTextureRectangle = false; ARBTextureRectangle = false;
ARBTextureNonPowerOfTwo = false; ARBTextureNonPowerOfTwo = false;
ARBMultisample = false;
NVOcclusionQuery = false; NVOcclusionQuery = false;
FrameBufferObject = false; FrameBufferObject = false;
FrameBufferBlit = false;
FrameBufferMultisample = false;
PackedDepthStencil = false; PackedDepthStencil = false;
NVVertexArrayRange2 = false; NVVertexArrayRange2 = false;
NVStateVARWithoutFlush = 0; NVStateVARWithoutFlush = 0;
@ -177,7 +185,7 @@ public:
DisableHardwareVertexProgram= false; DisableHardwareVertexProgram= false;
DisableHardwareVertexArrayAGP= false; DisableHardwareVertexArrayAGP= false;
DisableHardwareTextureShader= false; DisableHardwareTextureShader= false;
}; }
std::string toString() std::string toString()
{ {
@ -198,6 +206,7 @@ public:
result += NVTextureRectangle ? "NVTextureRectangle " : ""; result += NVTextureRectangle ? "NVTextureRectangle " : "";
result += EXTTextureRectangle ? "EXTTextureRectangle " : ""; result += EXTTextureRectangle ? "EXTTextureRectangle " : "";
result += ARBTextureRectangle ? "ARBTextureRectangle " : ""; result += ARBTextureRectangle ? "ARBTextureRectangle " : "";
result += EXTTextureFilterAnisotropic ? "EXTTextureFilterAnisotropic " : "";
result += ARBTextureNonPowerOfTwo ? "ARBTextureNonPowerOfTwo " : ""; result += ARBTextureNonPowerOfTwo ? "ARBTextureNonPowerOfTwo " : "";
result += "texture stages(*) = "; result += "texture stages(*) = ";
result += NLMISC::toString(NbTextureStages); result += NLMISC::toString(NbTextureStages);
@ -218,6 +227,7 @@ public:
result += EXTBlendColor ? "EXTBlendColor " : ""; result += EXTBlendColor ? "EXTBlendColor " : "";
result += NVOcclusionQuery ? "NVOcclusionQuery " : ""; result += NVOcclusionQuery ? "NVOcclusionQuery " : "";
result += NVStateVARWithoutFlush ? "NVStateVARWithoutFlush " : ""; result += NVStateVARWithoutFlush ? "NVStateVARWithoutFlush " : "";
result += ARBMultisample ? "ARBMultisample " : "";
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
result += "\n WindowsGL: "; result += "\n WindowsGL: ";
@ -241,6 +251,8 @@ public:
result += "\n FBO: "; result += "\n FBO: ";
result += FrameBufferObject ? "FramebufferObject " : ""; result += FrameBufferObject ? "FramebufferObject " : "";
result += FrameBufferBlit ? "FrameBufferBlit " : "";
result += FrameBufferMultisample ? "FrameBufferMultisample " : "";
result += PackedDepthStencil ? "PackedDepthStencil " : ""; result += PackedDepthStencil ? "PackedDepthStencil " : "";
return result; return result;
@ -329,6 +341,7 @@ extern NEL_PFNGLGETCOMPRESSEDTEXIMAGEARBPROC nglGetCompressedTexImageARB;
//==================== //====================
extern NEL_PFNGLFLUSHVERTEXARRAYRANGENVPROC nglFlushVertexArrayRangeNV; extern NEL_PFNGLFLUSHVERTEXARRAYRANGENVPROC nglFlushVertexArrayRangeNV;
extern NEL_PFNGLVERTEXARRAYRANGENVPROC nglVertexArrayRangeNV; extern NEL_PFNGLVERTEXARRAYRANGENVPROC nglVertexArrayRangeNV;
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
extern PFNWGLALLOCATEMEMORYNVPROC nwglAllocateMemoryNV; extern PFNWGLALLOCATEMEMORYNVPROC nwglAllocateMemoryNV;
extern PFNWGLFREEMEMORYNVPROC nwglFreeMemoryNV; extern PFNWGLFREEMEMORYNVPROC nwglFreeMemoryNV;
@ -712,6 +725,16 @@ extern NEL_PFNGLRENDERBUFFERSTORAGEEXTPROC nglRenderbufferStorageEXT;
extern NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC nglFramebufferRenderbufferEXT; extern NEL_PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC nglFramebufferRenderbufferEXT;
extern NEL_PFNGLDELETERENDERBUFFERSEXTPROC nglDeleteRenderbuffersEXT; extern NEL_PFNGLDELETERENDERBUFFERSEXTPROC nglDeleteRenderbuffersEXT;
extern NEL_PFNGLDELETEFRAMEBUFFERSEXTPROC nglDeleteFramebuffersEXT; 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
extern NEL_PFNGLSAMPLECOVERAGEARBPROC nglSampleCoverageARB;
#endif // NL_OPENGL_EXTENSION_H #endif // NL_OPENGL_EXTENSION_H