Comparing the lower 32 bits to the full hash was producing false
negatives and causing unnecessary render pass creation when creating
pipelines.
(cherry picked from commit 83f106b89f)
+Z is the front face in a cubemap, not -Z. Currently cubemap faces are
flipped in both the X and Z directions.
Some kind of flip is required because cubemaps use a left-handed
coordinate space instead of lovr's/vulkan's right-handed coordinate
space.
Equirect does not need any changes.
(cherry picked from commit 1b1bc182bf)
Files are created with 664 (though usually modified by umask).
Directories are created with 755 permissions.
Main motivation is to allow adb to access files on Android 12+
(cherry picked from commit 9445331df8)
Adding an offset to VertexIndex/BaseVertex breaks those builtins for
shader code. Instead, go back to binding the vertex buffer at an
appropriate offset.
This means we rebind the vertex buffer and makes it harder to batch
draws. In the future we'd like to go back to binding all vertex buffers
at zero and incorporating per-draw vertex offsets, but we'll need to
adjust the VertexIndex macro to subtract that offset.
We are allocating buffers in smaller chunks now (4MB), and only 256 of
those would limit GPU memory usage to 1GB (in reality the cap is much
higher since static buffers and textures are still suballocated, and any
allocation bigger than 4MB will use its own block). Still, in some
degenerate cases with huge amounts of temporary buffer memory, we are
hitting this limit earlier than we'd like.
The C4255 warning in MSVC complains about function lacking explicit list
of arguments (`f()` instead of `f(void)`). Disabling this warning allows
joltc to build on windows platform.
The current implementation might spin forever if only one thread is
starting/waiting on jobs, since nothing will be waiting on the jobs
(i.e. freeing up queue slots) while spinning.
The correct thing to do is to return NULL and let the caller handle
backpressure. It's a bit more annoying to program since you might not
get a job back and need to handle it, but it's the right thing to do.
Shader == NULL wasn't clearing the dirty uniform flag, so if the
uniforms were dirty when you set a default shader we would try to
allocate and bind a zero-size uniform buffer.
Instead, let's avoid making a new uniform buffer if the shader doesn't
have any uniforms!
- Jobs can now throw exceptions using job_abort. This will store an
error message on the job and immediately stop the job. The method
will never return. It must be called from the worker thread running
the job, so in practice it should only be called by the job function.
- After waiting for the job to complete or abort using job_wait, the
error message can be checked using job_get_error. This is the raw
pointer passed to job_abort, caller is responsible for freeing it or
doing whatever necessary cleanup is required.
- job_free must be used to recycle the job after waiting on it.
Yes it uses longjmp.
There's also some general cleanup, and job_start just does random jobs
when the queue is full instead of returning NULL.