1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-04 05:23:34 +00:00
Commit graph

5070 commits

Author SHA1 Message Date
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
bjorn 4e6effceff lovr.graphics.wait updates timing stats and readbacks; 2023-09-28 23:26:04 -07:00
bjorn 4a5a66d2ea Fix glslang submodule; 2023-09-28 22:10:27 -07:00
bjorn a2f539de56 Update glslang; Shader #include uses virtual filesystem;
This update seemed to increased glslang's binary size even more...
2023-09-28 22:04:05 -07:00
bjorn 7486108462 Add gammaToLinear and linearToGamma shader helpers; 2023-09-28 05:10:26 -07:00
bjorn 684560ef81 Fix Mesh:getDrawRange not returning base vertex; 2023-09-28 03:17:18 -07:00
bjorn c3b99a397a Mesh bounding box uses same convention as everyone else;
It was using

minx, miny, minz, maxx, maxy, maxz

Instead of

minx, maxx, miny, maxy, minz, maxz
2023-09-28 02:26:53 -07:00
bjorn 19c4aed465 Fix crash when headset module is disabled; 2023-09-27 23:04:55 -07:00
bjorn c3c5284f11 Improve viewport/scissor accessors;
- Better validation
- Can set to nil to "disable"
- Getter returns nil when "disabled"
- Negative viewport height works again
2023-09-27 00:24:01 -07:00
bjorn 3fb3590b77 Mat4:mul/Quat:mul return temp vectors;
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>
2023-09-26 01:30:54 -07:00
bjorn 6883c36397 Rename Mat4:getTranslation/Rotation -> position/orientation;
It's a little less correct, but literally everything else is
"getPosition" and "getOrientation".
2023-09-25 21:59:51 -07:00
bjorn fbdecda440 Render textures have mipmaps by default again;
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.
2023-09-25 00:07:26 -07:00
bjorn 73b1b951f5 Model:clone has separate blend shape state; 2023-09-24 23:51:42 -07:00
bjorn ed0756bfa2 rm variant of newMesh that takes indices;
Too many variants!  Also it had bugs.
2023-09-24 23:39:51 -07:00
bjorn a478f417f2 Pass:draw(Texture) bounds; 2023-09-24 23:31:57 -07:00
bjorn d021596e6d Mark blend passthrough mode as supported on Quest; 2023-09-24 22:07:37 -07:00
bjorn 860ebbd133 Fix Shader:getBufferFormat; 2023-09-22 20:44:06 -07:00
bjorn 1d91ea1fde Replace tinycthread with C11 threads.h polyfill; 2023-09-21 23:26:16 -07:00
Bjorn 5db7d4a914
Merge pull request #704 from bjornbytes/surface
Surface Improvements
2023-09-21 22:34:45 -07:00
bjorn 15b6b0d41f Update LuaJIT; 2023-09-21 22:31:02 -07:00
bjorn 94cdb9ae4e Fix GCC warning;
GCC warns when passing a pointer to a float to lovrModelSetNodeTransform
(currently done in OpenXR driver when updating model poses from an
XrPose).
2023-09-21 22:24:57 -07:00
bjorn 8b5511efc4 Upgrade to OpenXR 1.0.30; 2023-09-21 22:20:27 -07:00
bjorn f2a9f8ec17 win32: use high resolution timer for sleeps; 2023-09-21 20:49:55 -07:00
bjorn 6eae891eb3 Add Mat4:getPose;
Companion to Mat4:getTranslation/Rotation/Scale;
2023-09-21 20:11:26 -07:00
bjorn 2a97fc0380 Vec3:transform; Vec4:transform; Vec3:rotate;
Co-Authored-By: Josip Miskovic <josipmiskovic@gmail.com>
2023-09-21 20:03:48 -07:00
bjorn b03e3244c3 LÖVR no longer requires 64KB uniform buffers;
Due to per-draw data size reduction from 144 -> 64 bytes.
2023-09-21 15:58:04 -07:00