This allows them to be initialized/destroyed from multiple threads in
any order. Previously, the first thread to require a module had to be
the last thread to use the module, otherwise it would be destroyed too
early.
There are still a few issues. If the main thread doesn't require a
module, it won't pick up the conf.lua settings. Also graphics isn't
handling the shader cache writing properly. And I think this breaks the
headset-graphics refcounting. But these will be fixed in future
commits.
- Archive is now an object that has a refcount
- Archives are stored in linked list instead of array
- Not exposed to Lua yet, but could be in the future
- core/zip was merged into the filesystem module
- Mountpoints are handled centrally instead of per-archive
- Zip doesn't pre-hash with the mountpoint anymore
- mtime is truly only computed on request for zips
Mountpoints don't work properly yet.
- If you load an image with a non-blittable format, mipmap count will
default to 1.
- If you explicitly request mipmaps on a non-blank texture with a
non-blittable format, that's an error (rather than leaving mipmap
chain undefined or sliently falling back to 1 mipmap).
- Cubemaps can have any layer count that is a multiple of 6.
- A cubemap with more than 6 layers will be a cubemap array image view.
- This isn't perfect because it conflates regular cubemaps with
6-layer cubemap arrays.
- Enable the vk feature, handle the spv feature, add getPixel helper.
- 'sample' now implies both sample and linear filtering (practically always
true for all formats lovr supports)
- 'render' now includes 'blend' for color formats (also practically
always true except for r32f on some old mobile GPUs)
- 'blit' now includes 'blitsrc'/'blitdst' because lovr doesn't support
blitting between textures with different formats
- 'atomic' is removed because lovr doesn't really support atomic images yet
These are methods that implement some common raycast behaviors without
creating a closure. They also take tag filters. The tag filters could
be optimized to use tag numbers instead of string comparison, and the
default raycast method could take a tag filter, but I didn't want to
modify the C API while Jolt is in progress.
The technique used only works for AABBs. Trying to apply the model
matrix to the extent like that isn't valid. For now, switch back to
the naive approach. This is quite a bit slower, but at least it's
correct.
If there is only a single pass in the submit, barrierCount is zero
since there will be no inter-pass synchronization. This is almost
correct, but not quite, because if a Pass has compute and render work,
the render pass may need to synchronize with the compute pass. So a
barrier is still necessary. For simplicity, always allocate the full
number of barriers, even though the final render barrier will always be
empty.
Additionally, avoids passing NULL to memset when the barrier count is
zero and the barrier arrays are NULL.
This fixes issues where some fonts would have glyphs with weird windings
and they would get rendered inside-out.
Unfortunately updating msdfgen increased its size by a factor of 2-3x.
- rm :getTallyData, it's totally lame, just do a readback
- rm gpu_tally_get_data too, webgpu doesn't support it anyway
- Clamp tally copy count so it doesn't overflow buffer
- Tally buffer offset's gotta be a multiple of 4
- Return nil instead of 2 values when tally buffer isn't set
- Copy correct number of tallies (multiply by view count instead of max
view count)
- Skip occlusion queries entirely if no tally buffer was set
Quat:mul also takes numbers.
They both require 3 args when using numbers.
I didn't opt for the 4-component Mat4:mul(numbers) variant, mostly out
of laziness.
Co-Authored-By: Josip Miskovic <josipmiskovic@gmail.com>
They defaulted to 1 to avoid confusion when mipmaps weren't generated
during a render pass (withou the { mipmaps = true } flag), but now the
mipmaps flag is obsolete and render passes automatically generate
mipmaps for all levels in their texture views. This means that render
passes can have mipmaps by default again, which leads to better
appearance when sampling them later.