ARB_DSA is now preferred in single-bind cases, as it is easier to use
than passing pointers to ARB_multi_bind. ARB_multi_bind was preferred
for single-bind previously simply because EXT_DSA was not in core.
Because there is a lot to say about feature selection for each function,
I took this as a opportunity to remove redundant documentation blocks,
just refer to Texture documentation from everywhere and add extension
requirements and deprecation where needed, so it's clear for each class
what needs what.
ARB_DSA also took the opportunity to finally remove all target enum
values from function calls and because of that the CubeMapTexture has to
handle a bunch of special cases. In order:
- CubeMapTexture::imageSize() now doesn't take face parameter and
returns one value for all faces. I'm thus now also assuming that the
user is sane and called either setStorage() or setImage() with the
same size for all faces. In non-ARB_DSA path I'm thus querying only
size of +X face and returning it as size for all faces. The old
imageSize(Coordinate, Int) overload is still present, but ignores
the first parameter and calls imageSize(Int). It is marked as
deprecated and will be removed in some future release.
- CubeMapTexture::image() now needs to call glTextureSubImage() in
ARB_DSA path to make it possible to extract single face. Other code
paths (EXT_DSA, Robustness and "default") remain the same.
- CubeMapTexture::setSubImage() calls glTextureSubImage3D() in
ARB_DSA, because it is not possible to specify face index in
glTextureSubImage2D(). Other code paths (EXT_DSA and "default")
remain the same.
Implementation of these special cases is extracted into CubeMapTexture
class to avoid pollution of AbstractTexture with incompatible nonsense.
I ran into a weird problem with Corrade module path not being found when
using just CMAKE_INSTALL_PREFIX for Emscripten build. Amazingly enough,
this wasn't problem at all with all other crosscompilation builds. CMake
hates me, I think.
I think it's better to leave the choice on the user -- whether to do
nothing (which might be slower), invalidate whole framebuffer (which
might lose data) or do scissor + clear and thus emulate the
sub-framebuffer invalidation somehow.
Also, for some weird reason I made off-by-one error in
eb32fb1c40, so the documentation for
Framebuffer::invalidate() appeared in documentation block for
Framebuffer::attachRenderbuffer(). Should be fixed now.
The comment was right, but the code was apparently copy-pasted. Sadly no
unit test covered this, because nearly every desktop impl has
ARB_texture_storage and on ES2 (which is the only that doesn't have
texture storage) it's not possible to query image size, heh.
ARB_direct_state_access doesn't have equivalent for glTexImage*D(),
which indicates that these calls should not be used anymore. Also
removed EXT_direct_state_access code path and kept just the plain
glBindTexture() + glTexImage*D(), as I assume that all implementations
which have EXT_DSA have also ARB_texture_storage, thus this alternative
would have no use.
The enum was only two-state, in almost all cases it included unnecessary
branching and the non-default usage was too verbose, thus all
transformation functions were split into two variants, <transform>() and
<transform>Local(). The <transform>() behaves exactly like the previous
implementation with TransformationType::Global, the <transform>Local()
behaves like the previous implementation with TransformationType::Local.
The enum and original functions were kept, they are marked as deprecated
and will be removed in future release.
This is rather large changeset, I triple checked that the new (both
deprecated and non-deprecated) implementations work as intended, but
can't possibly test every possible use case, so I'm sorry if I messed
something up :-) Also there was probably some bug in internal virtual
function implementations before, it should be now fixed.