For some reason a buffer *allocated* with this function caused
Mesh::draw() to draw nothing. I gave up on investigating the root cause
-- using non-DSA glBufferData() "just works", so in case of this driver
the "svga3d-broken-dsa-bufferdata" workaround uses the non-DSA code
path.
DetectedDriver::AMD is now DetectedDriver::Amd,
DetectedDriver::ProbablyAngle is now just DetectedDriver::Angle. The old
names are still present, but deprecated and will be removed in the
future.
The GL queries are needed only if the user-provided pixel storage
doesn't contain enough information, in particular dimensions and byte
size of compression block.
So in case they are present, no query for compressed image size is done
for full image queries (just saving one API call) and no queries for
block dimensions and byte size for subimage queries (saving four API
calls and not requiring ARB_internalformat_query2).
The documentation was fixed and tests were updated to take the
ARB_internalformat_query2 requirement into account.
There were various issues with the tests at the moment:
* In order to test non-default pixel storage parameters, out-of-bound
array slices were passed to GL functions. That of course cause ASan
to complain (and maybe also some drivers to crash).
* Only the non-default pixel storage parameters were tested.
Unfortunately this is a heavily buggy area in all the drivers, so
when such a test failed, it was not immediately clear whether the
failure is related just to driver not understanding pixel storage
properly or something deeper and made debugging much much harder than
it should be.
* For compressed textures, default and non-default pixel storage has
grossly different code paths and these should be tested both by
default.
* Some test cases had a patched-in code testing for both default and
non-default pixel storage, but the code was so hidden that I didn't
even know it was there -- it should be separate test cases.
All the tests are now instanced, testing both the simple case and
some pixel storage case, they are also reordered and cleaned up a bit.
For some reason I thought it's size of one face pre-ARB_DSA and size of
all six faces on ARB_DSA. NVidia drivers (which return different size
based on whether the texture is immutable, which is totally crazy)
didn't help with that at all. Now I realized this while fixing test
failures on Mesa. IIRC I couldn't find a clear explanation in the spec
anyway, so I'll just bite the bullet and assume *this* is the correct
way now. Mesa tests now pass instead of saying that my provided buffer
size is too small.