Commit Graph

5344 Commits

Author SHA1 Message Date
bjorn ef8d1abf87 Update changelog; 2024-03-17 14:02:56 -07:00
bjorn cc4567652e Merge branch 'stable' into dev 2024-03-17 13:59:31 -07:00
bjorn d50f661ce6 Fix possible negative dt when restarting simulator; 2024-03-17 13:59:13 -07:00
bjorn 26d17fc402 boot.lua: exit successfully when printing help; 2024-03-12 13:32:26 -07:00
Bjorn 27c59de5dc
Merge pull request #759 from brainrom/patch-2
Fix boot.lua merge
2024-03-12 13:21:39 -07:00
Ilya 994f623c5d
Fix boot.lua merge
boot.lua was broken during merging with stable branch.
2024-03-12 23:12:29 +03:00
bjorn 9c2c4f6906 Update changelog; 2024-03-12 12:02:17 -07:00
bjorn 2b218d09d0 Merge branch 'stable' into dev 2024-03-12 11:58:34 -07:00
bjorn 66f6ee9bb9 v0.17.1; 2024-03-12 11:56:30 -07:00
bjorn 38f05b9f01 Update OpenXR to 1.0.34;
(cherry picked from commit 48e484ed8a)
2024-03-12 11:06:20 -07:00
Josip Miskovic a84385a030 Fix Model:getMesh()
(cherry picked from commit 37fdb39e73)
2024-03-12 11:05:22 -07:00
bjorn c17abe4f24 CMake: disable BUILD_WITH_WAYLAND_HEADERS for OpenXR;
(cherry picked from commit 78586c3770)
2024-03-12 11:04:42 -07:00
bjorn 053893f3f6 Bump OpenXR to 1.0.33;
(cherry picked from commit da5a6cec10)
2024-03-12 11:04:38 -07:00
bjorn b09d612e6b Validate that intra-buffer copy has non-overlapping ranges;
(cherry picked from commit 06bfbbaa6b)
2024-03-12 11:04:14 -07:00
bjorn 561b20699a Fix error when loading a Model without any vertices;
(cherry picked from commit 3712bc3fba)
2024-03-12 11:03:33 -07:00
bjorn aff97b7a30 glTF: support glb models without BIN chunk;
(cherry picked from commit 35f97f08f3)
2024-03-12 11:02:21 -07:00
bjorn 1f6904c04b Fix errhand loop when debug library is unavailable;
(cherry picked from commit dacc17e1b7)
2024-03-12 11:02:00 -07:00
Josip Miskovic 8c3c0f8136 Bound check the number of sphere segments
(cherry picked from commit 3db04db05a)
2024-03-12 11:00:42 -07:00
bjorn 1e02de6cda Fix depth write not working when depth test is disabled;
A classic

(cherry picked from commit 5c46d6169a)
2024-03-12 10:55:21 -07:00
bjorn 24c13e88d3 Fix render pass cache when compiling pipelines;
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)
2024-03-12 10:55:16 -07:00
bjorn 5611a6130b Fix cubemap orientation;
+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)
2024-03-12 10:53:28 -07:00
bjorn 35228f1838 Create files/directories with more permissions;
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)
2024-03-12 10:46:14 -07:00
Josip Miskovic 0e9171e2dd Use virtual memory in vector pools
(cherry picked from commit a1d7bf5fbc)
2024-03-12 10:44:43 -07:00
bjorn ae1edd95e7 Skip creating texture views for transfer-only textures;
Vulkan forbids it!

(cherry picked from commit eac68d2fe4)
2024-03-12 10:41:20 -07:00
bjorn d097d9819d Add wrappers for malloc functions; 2024-03-11 14:38:00 -07:00
bjorn 2d7b636a90 Change more asserts to checks; 2024-03-11 00:58:21 -07:00
bjorn 0d8d6f579b rm unused lovrImageClear prototype; 2024-03-11 00:57:59 -07:00
bjorn aa79822edb Fix VertexIndex;
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.
2024-03-10 10:36:13 -07:00
bjorn 1cda2d59a7 gpu: increase max number of memory blocks to 1024;
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.
2024-03-08 12:03:55 -08:00
bjorn f93fb0c0c7 Set buffer tick properly when destroying pass;
This was causing one of the pass's buffers to be unrecyclable.
2024-03-08 11:56:23 -08:00
bjorn 4719dbdd10 Fix crash with timestamp readback; 2024-03-07 10:26:35 -08:00
bjorn 9068c8daee rm map_remove;
It's no longer used.
2024-03-07 10:13:00 -08:00
bjorn f9cfc4e76e Update changelog; 2024-03-05 09:14:16 -08:00
bjorn dc643ad166 Shader:getBufferFormat improvements;
- Returns nil instead of erroring if variable does not exist.
- For runtime-sized arrays, returns nil for length instead of 4 billion.
2024-03-05 09:01:01 -08:00
Bjorn 600a8c372e
Merge pull request #755 from jmiskovic/fix/jolt_win
Allow joltc fns without explicit argument list
2024-03-04 11:54:10 -08:00
Josip Miskovic 8a5b88e851 Allow joltc fns without explicit argument list
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.
2024-03-04 19:03:22 +01:00
Bjorn b3b523cdbf
Merge pull request #754 from brainrom/patch-2
Make lovrAssert act like a function
2024-03-03 03:54:13 -08:00
Ilya 4139f0f180
Make lovrAssert act like a function
`do {} while(0)` is the perfect way to make function-like macro act like a real function (require ;, encapsulate local variables)
2024-03-03 14:37:14 +03:00
bjorn 1ec0a41bb8 Also avoid allocating empty uniform buffer for indirect/compute; 2024-03-01 17:14:08 -08:00
bjorn c3d81debe8 Clean up GPU submission; 2024-03-01 17:13:06 -08:00
bjorn 80b596daf6 job: return NULL if queue is full when starting job;
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.
2024-03-01 16:48:28 -08:00
bjorn 79e28eb7e3 Fix issue with shader uniforms;
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!
2024-03-01 12:46:08 -08:00
Bjorn fd331090c9
Merge pull request #751 from brainrom/patch-1
Fixed nogame.zip creatrion
2024-02-29 10:36:34 -08:00
Ilya f77a8f6cb2
Fixed nogame.zip creatrion
logo.spv wasn't packed in nogame.zip, therefore nogame is failed to start. Now all files in nogame folder are packed.
2024-02-29 11:35:55 +03:00
Bjorn 6c7ca1e275
Merge pull request #750 from bjornbytes/job
Job System
2024-02-28 12:51:25 -08:00
bjorn 224b6a495d Simplify job error string memory stuff;
Comparison against string literal isn't good.  I wish there was a way to
not heap allocate so much though, but exceptions are exceptional anyway.
2024-02-28 12:31:34 -08:00
bjorn 901dd268f2 job copies errors; add variadic version of job_abort;
I caved and depended on malloc/sprintf because I couldn't find anywhere
else good to put it...
2024-02-28 12:31:34 -08:00
bjorn f6af859984 job system error handling;
- 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.
2024-02-28 12:31:34 -08:00
bjorn b32ac1c5a5 Details; 2024-02-28 12:31:34 -08:00
bjorn 1701409763 threads polyfill defines thread_local;
Might need to be removed for C23.
2024-02-28 12:31:34 -08:00