PDA

View Full Version : Can I call core API with EXT enums?



ffhighwind
04-21-2013, 07:06 AM
I'm making a wrapper around OpenGL and I came across "ubiquitous extensions." Specifically, image formats like GL_COMPRESSED_*_EXT.

Can I use this EXT format on a core API functions... like... Framebuffer Blit? If no, would mixing and matching core/EXT have overhead? Meaning... should I just switch to calling EXT on everything?

Also... should I switch my wrapper API to this DSA thing I keep reading about?

Alfonse Reinheart
04-21-2013, 03:07 PM
Can I use this EXT format on a core API functions... like... Framebuffer Blit?

Well, glFramebufferBlit doesn't take a format as a parameter, so I'm not sure how you would use that. But if you are asking if you can blit from/to a compressed image, the answer is no. But that has nothing to do with extensions; compressed image formats (whether core or from an extension) are not "color renderable". And therefore, you may not attach them to an FBO at all (http://www.opengl.org/wiki/Framebuffer_Object#Framebuffer_Object_Structure). If you tried, the FBO would not be attachment complete and therefore you can't blit from/to it.


should I switch my wrapper API to this DSA thing I keep reading about?

That's up to you and what hardware you want to include/exclude. EXT_DSA is available on NVIDIA and AMD hardware, but it's not everywhere (ie: Intel or MacOSX).

And AMD often seems to forget that providing DSA along with certain other extensions means that they must also provide new functions. For example ARB_texture_storage also has functions of the form glTextureStorage2DEXT, but they're only available if ARB_texture_storage and EXT_DSA are both available. AMD exposes both extensions, but they don't expose the glTextureStorage2DEXT functions.

mhagain
04-22-2013, 05:12 AM
but they don't expose the glTextureStorage2DEXT functions.

Yes they do (Catalyst 13.1 and have been since at least 12.x sometime):


PFNGLTEXTURESTORAGE2DEXTPROC TestGLTexStorage2D = (PFNGLTEXTURESTORAGE2DEXTPROC) wglGetProcAddress ("glTextureStorage2DEXT");

if (TestGLTexStorage2D)
OutputDebugString ("glTextureStorage2DEXT is exported\n");
else OutputDebugString ("glTextureStorage2DEXT is NOT exported\n");

thokra
04-22-2013, 05:27 AM
Also supported on Linux 13.3 Beta.

Alfonse Reinheart
04-22-2013, 05:37 AM
It didn't work when I tried it last year sometime.