Commit Graph

4945 Commits

Author SHA1 Message Date
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 d4a17eee4c Actions: Update Android build-tools version to 34.0.0; 2024-01-13 18:11:22 -08:00
bjorn fd3b0c365d Actions: update sdkmanager path; 2024-01-13 18:09:54 -08:00
bjorn 1122f6419b Actions: rm sudo from Android install command; 2024-01-09 15:12:42 -08:00
bjorn 3216573f0b Actions: Manually install Android SDK;
GitHub removed Android versions v30 and below.
2024-01-09 15:10:15 -08:00
bjorn 49328b88a6 Shader #include errors on missing file; 2023-11-30 09:03:33 -08:00
bjorn eefc89909e Fix bitangent sign;
Really gotta compress ModelVertex at some point.
2023-11-09 16:50:52 -08:00
bjorn 4522d1050f Fix OpenXR layout transitions; 2023-11-09 14:57:29 -08:00
bjorn 648118d308 Fix excessive gamma-to-linear conversion; 2023-11-09 12:47:39 -08:00
bjorn 6a83ef9678 Fix lovr.quit to not get called twice when aborting quit; 2023-10-18 12:58:49 -07:00
bjorn 1d6f3afc34 v0.17.0; 2023-10-14 19:36:19 -07:00
bjorn 99f8c3a25c Fix frustum culling;
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.
2023-10-11 18:21:11 -07:00
bjorn 68aad50a2d Use better UBO size when pass has more than 256 draws; 2023-10-11 13:55:25 -07:00
bjorn 5d6f538524 Pass:barrier also barriers against indirect stage;
Fixes a validation error that probably no one was running into.
2023-10-11 08:26:06 -07:00
bjorn b319aeeb40 Fix Pass:send when using a table with an array UBO; 2023-10-07 16:22:56 -07:00
bjorn 878018e150 Merge branch 'master' into dev 2023-10-05 12:26:09 -07:00
bjorn 27c1f50774 tup: sanitize also adds undefined behavior sanitizer; 2023-10-05 12:23:12 -07:00
bjorn 539b19c84c Fix minor undefined behavior; 2023-10-05 12:21:27 -07:00
bjorn 6cfbfd050d Fix issue with synchronization;
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.
2023-10-05 12:09:55 -07:00
bjorn 6e12370ee8 Fix out of bounds access in newShader; 2023-10-05 11:26:43 -07:00
bjorn 2a3b517334 Fix incorrect depth buffer default in Pass:setCanvas;
If you did newPass(texture) instead of using a table, the pass would not
have a depth buffer instead of using d32f.
2023-10-05 07:20:01 -07:00
bjorn e307487041 Pass:send supports single booleans for push constants;
vectors/arrays/structs with booleans still aren't supported.
2023-10-05 06:36:21 -07:00
bjorn fc9bb8a5e4 Fix crash when trying to load hand models on non-Quest; 2023-10-04 17:04:03 -07:00
bjorn c0fbc515f8 Fix Mesh:getIndices; 2023-10-04 14:40:34 -07:00
bjorn 6682fe1930 Fix Mesh:computeBoundingBox; 2023-10-04 14:36:39 -07:00
bjorn 44b250a517 Fix issue with texture readback layer count; 2023-10-04 13:12:55 -07:00
bjorn 327b1954ea Readbacks with nesting always use key-value format; 2023-10-04 09:00:36 -07:00
bjorn 805b83601f Buffer readbacks use a more consistent format;
- Always wrapped in table
- Length is always item count
- Scalars are tables of numbers { 1, 2, 3 }
- Vectors are wrapped in tables { { 1, 2 }, { 3, 4 } }
- Compound formats are wrapped in tables, like Mesh vertices
- Structs/nested types are tables
2023-10-04 08:52:05 -07:00
bjorn 842df4b305 Fix buffer readback issues; 2023-10-04 08:52:05 -07:00
bjorn c976b36682 Buffer:getData takes optional index/count arguments;
Also, the Buffer needs to have a format.
2023-10-04 08:52:05 -07:00
bjorn 86db0e3ab5 Buffer:getPointer is renamed to mapData;
It also takes range parameters.

:getPointer is deprecated.
2023-10-04 08:52:05 -07:00
bjorn 9dd2782af9 Fix win32 warnings; 2023-10-03 11:51:08 -07:00
bjorn cf744ace83 tup: add MSDFGEN_PUBLIC define; 2023-10-03 11:17:06 -07:00
bjorn f0686f0115 Update msdfgen; Orient contours properly;
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.
2023-10-03 11:12:38 -07:00
bjorn 3041a9a484 Pass:setTallyBuffer(nil) works; 2023-10-02 10:49:54 -07:00
bjorn 9a276e5f9a Tally fixups;
- 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
2023-10-02 10:20:52 -07:00
bjorn 9c28eab732 Fix crash when drawing with an active compute shader; 2023-10-02 09:56:33 -07:00
bjorn 6462c7bc07 getBundle takes bindings; 2023-10-02 09:07:50 -07:00
bjorn 9734ef005c Fix Pass:setClear w/ table of numbers; 2023-10-02 08:47:04 -07:00
bjorn d901481cdc Clear canvas info properly when setting canvas to nil; 2023-09-30 13:19:31 -07:00
bjorn fd2b2e7e4a Render pass samples can't be a boolean that's weird; 2023-09-30 12:31:10 -07:00
bjorn fecb0c27d5 Fix nogame screen when headset module is disabled; 2023-09-30 01:46:51 -07:00
bjorn d7c6461916 Render targets with mipmaps get transfer usage;
Also I think no mipmaps is more sane default for render targets.
2023-09-29 05:22:03 -07:00