Because its usage is rather specific, there wasn't no
extension-dependent dispatch happening and thus the extension was never
marked as used. But that was confusing since it actually is, so add an
explicit branch just to list the extension.
Memory-maps the file and uses openMemory() instead of openFile(). For
efficient data formats (such as glTF) can avoid reading the whole blob
if only the metadata or a part of the file is needed (for example the
peak usage for --info-materials with the Buggy.glb example model went
from 8.5 MB to 991 kB, as it reads just the JSON at the start and never
even pages in the buffer blobs at the end).
This currently only works for standalone files, files that reference
external images etc. would need to have file callbacks implemented. And
it's Sunday and I'm lazy.
Using openMemory() instead of openData() allows the implementation to
assume the data will stay in scope for as long as needed, which can
prevent unnecessary copies in some plugin implementations.
It warranted a new flag, DataFlag::ExternallyOwned, to describe this
kind of memory. I couldn't reuse Owned as that's used for allocations
owned by the instance, which is too little for certain future use cases.
For example returning *Data instances referencing an Owned memory would
mean the user has to assume the memory is gone when the importer
instance is gone, and that's generally not true for memory passed to
openMemory().
Originally I thought I would do this later, but then realized the
existing plugin implementations would need to get all updated again to
be aware of the new flag, with some being forgotten, and it's just
easier to do the whole thing in a single step.
This makes it much less annoying to pass arbitrarily typed data, such as
std::uint8_t or char8_t and what not. It was already done like this for
the new shader converter plugins, where the input is often 32-bit ints
for SPIR-V.
OTOH the internal virtual API is kept with ArrayView<const char>, as
that makes it easier to operate on by the implementations.
This allows to better describe memory ownership and transfer it instead
of forcing the plugins to allocate their own local copy if the import
happens in-place on the imported data. Right now that's mainly for the
openFile() use case, which implicitly allocated an Array with file
contents only to pass it to openData() which then made a copy because it
could not make any assumption about data scope.
In other words, certain plugins (TgaImporter, KtxImporter, DdsImporter,
CgltfImporter and possibly others) will now have their peak memory usage
*halved*.
Because it was getting annoying to scroll through the output, especially
with shitty files that duplicate materials etc. The --info is now a
shortcut for specifying all other --info options together.
It was used just for certain corner cases that weren't covered by
{EXT,OES}_draw_elements_base_vertex already, but because of a wrongly
understood extension interaction the EXT/OES multidraw entrypoint (which
isn't implemented on ANGLE) was used from these as well.
And while trying to disable the two extensions for the MeshGLTest I
discovered the test half-expects the ANGLE variant to be implemented and
so I finished it for both the single-draw and multi-draw case.
The extension interaction that makes base-vertex multidraw calls broken
on ANGLE will be fixed in the following commit.
Yes, this is only ever provided by an ANGLE extension, and as you might
have guessed, The Great Google Overlords didn't bother caring to have
this supported outside of their browser.
Since the main point of the low-level API is to make use of the
EXT_multi_draw_arrays / ANGLE_multi_draw / WEBGL_multi_draw extensions
for a reduced driver overhead *and* the builtin gl_DrawID variable, it
just doesn't make sense to provide a fallback to draw() in a loop. When
the extensions are not available, the user has to do extra work in order
to supply proper UBO draw offset for each draw call, and thus the
fallback path has basically no practical use.
On the other hand, draw() taking the MeshView instances is kept as-is --
this one is rather old and so breaking compatibility would be an
unnecessary pain point. Plus, since it has to allocate the contiguous
arrays internally, it's not desirable for any fast-path rendering
anyway.
Thanks Google, for your careless fuckall way of creating private ANGLE
extensions that then immediately get exposed to Chrome and Chrome only.
Way to go!!
It doesn't allow anything except full RGBA and 32-bit types to be read
from the framebuffer. Chromium browsers weren't complaining but Firefox
did. I remember a similar restriction from GLES2 but all implementations
I tested with including ANGLE and SwiftShader allow that already, so
it's practically just a WebGL limitation.
This doesn't actually fix the WebGL-specific error (there it
additionally disallows mismatched signedness in a vertex attribute) but
is nevertheless good to have correct.
Unlike most other extensions, this one has to be explicitly enabled in
Emscripten in order to be used. Which thus done as part of other "driver
workarounds" done on startup. To avoid that, the extension can be
explicitly disabled, and thanks to the previous commit the disabling
will be performed before the extension is attempted to be enabled.