Commit Graph

1202 Commits

Author SHA1 Message Date
bjorn 1d1470f042 Fix directory archive path normalization;
Fixes non-normalized paths not behaving as expected.
2023-03-09 21:27:04 -08:00
bjorn b33cc99374 Fix potential crash when creating textures;
beginFrame needs to be called a little bit earlier (before getting the
buffer to write the texture contents).
2023-03-09 18:36:23 -08:00
bjorn bf31072d0d Cleanup; 2023-01-30 19:44:23 -08:00
Ilya Chelyadin d84d358de7 Minor fixes 2023-01-31 06:03:53 +03:00
Ilya Chelyadin f0265a6f48 Disable headless OpenXR extension for Android 2023-01-29 23:45:23 +03:00
Ilya 933ae3a9ba
Merge branch 'bjornbytes:master' into picofix 2023-01-29 23:33:48 +03:00
bjorn bee8d16427 Add error when render pass/texture sample counts don't match; 2023-01-21 12:16:35 -08:00
bjorn ffa4beb21c Fix thread refcounting;
Minor race condition between thread starting and thread getting released.
2023-01-19 15:05:04 -08:00
bjorn 3e0d2a1ecf core/os: window size is always in framebuffer units;
pixel density is exposed as a separate accessor.
2023-01-10 19:54:48 -08:00
undef bc7a541279 Fix constrained rendering in windowed mode on macOS #620 2023-01-06 20:30:05 +01:00
Ilya f3837d99fd
Merge branch 'bjornbytes:master' into picofix 2023-01-04 23:03:54 +03:00
bjorn dd65a59602 Fix some literals in Curve:evaluate; 2023-01-02 14:43:27 -08:00
bjorn b885f2abf5 rm AUTO_MAP_LOCATIONS flag from glslang options;
It doesn't work properly, and silently produces broken shaders when the location is left off.
2022-12-26 07:21:54 -08:00
bjorn 305213bfb4 Error if shader push constants are too big; 2022-12-25 17:18:05 -08:00
Josip Miskovic bc1308c463 Check if torus shape is cached 2022-12-22 17:26:21 +01:00
bjorn 886e3bb42f Fix some windows warnings; 2022-12-19 14:01:30 -08:00
Ilya 5b36c44cfc
Merge branch 'bjornbytes:master' into picofix 2022-12-11 11:19:06 +03:00
bjorn f013831b73 Reorganize thread code;
- Put channel into thread module file.
- Make thread internals private.
- Handle more thread bookkeeping in thread module instead of Lua API.
- Fix a few race conditions/leaks nobody was probably ever going to hit.
2022-12-10 20:13:39 -08:00
bjorn 06dad182db Fix mounted directories with non-empty mountpoints;
Mounting directories with mountpoints wasn't treating the components
in the mountpoint path as virtual directories.
2022-12-10 18:25:09 -08:00
bjorn 74a9b90e93 Fix zip archive enumeration;
Zip archives weren't enumerating in the root directory when they were
mounted with a non-empty mountpoint.  Additionally, zips mounted at the
root directory weren't listing files properly.  This fixes both by
normalizing the mountpoint prefix (it had a prepended slash when it was
empty, which messed up hashing), and ensuring there is a "root node" in
the tree with an empty string.
2022-12-10 18:25:09 -08:00
Ilya 10675761e2
Check for thread handle 2022-12-11 00:47:20 +03:00
bjorn 36070e828c Add missing validation for rendering to depth textures; 2022-12-10 11:20:56 -08:00
Ilya Chelyadin 48aad15b1f Fix comma 2022-12-08 07:12:59 +03:00
Ilya Chelyadin f62c99e469 Fix typos, indentation, minor issues 2022-12-08 07:05:30 +03:00
Ilya bd767092f3
Merge branch 'bjornbytes:master' into picofix 2022-12-07 19:50:13 +03:00
bjorn b5c14da4a6 Pass:line errors if only 1 point is provided; 2022-12-04 18:01:20 -08:00
bjorn efc81e4cec Fix some gcc warnings; 2022-12-03 01:20:02 -08:00
Ilya 92c136bc73
Merge branch 'bjornbytes:master' into picofix 2022-12-01 21:20:33 +03:00
bjorn f9d7742dfd Add support for headless headset rendering;
Although the name is unfortunate, this allows access to lovr.headset
when no window is opened or when the graphics module is disabled.  This
requires the XR_MND_headless extension to be supported by the runtime.
2022-11-26 14:40:39 -08:00
Ilya Chelyadin 13d8c4a207 Interaction profiles suggestion improvement
At least one profile should be supported. Monado fails on Neo 3 profile.
2022-11-25 21:16:42 +03:00
bjorn 4422df2a47 Variant small string optimization; 2022-11-24 15:40:43 -08:00
bjorn 8f74778c19 Error if require path is too long instead of truncating; 2022-11-23 14:08:32 -08:00
bjorn 53da4dd1dc rm File again;
forks please yell if you still need it
2022-11-23 11:58:42 -08:00
Ilya Chelyadin 3f20364c3f Pico is back!
Tested on Pico Neo 3 with PUI v4.9.3
Also included generic (Monado-Android) Android flavor.
2022-11-22 22:01:13 +03:00
bjorn dbdd22ae95 Compute passes release their shaders properly;
Active shader was only getting released for render passes.
2022-11-21 19:52:41 -08:00
bjorn 7f2618227f Fix off-by-one tick number in readbacks;
Only when a readback is read back before a pass is created.

Should really change gpu to know if the frame has started yet and adjust
the tick index accordingly.
2022-11-21 19:42:41 -08:00
bjorn 6d1bbe9c5c Fix Android build on new NDKs;
Some Android header defines DEPTH, which clashes with a symbol in the
OpenXR driver.  This change just stops using Android headers in there
and declares more granular private functions.  It also removes a few
unused private os functions.
2022-11-15 20:35:39 -08:00
bjorn 58dc7ee9dd Add missing check for sample usage in material textures; 2022-11-14 20:10:23 -08:00
bjorn 9277b38273 Use fancy syntax for model data map indices;
Matches nodes.
2022-11-14 19:20:29 -08:00
bjorn c61d6b059b Merge branch 'master' into dev 2022-11-14 19:19:17 -08:00
s-ol 7dbdda1205 Fix node indexing for GLTF models with multiple root nodes 2022-11-14 08:02:13 -08:00
s-ol 773d22f40d Check bounds in luax_checkanimation / luax_checknodeindex 2022-11-14 08:02:13 -08:00
bjorn cacc5eae71 ModelData:getTriangles reuses vertices better;
ModelData:getTriangles currently adds a fresh set of vertices for every
mesh in a node.  This is technically correct, but it wastes space when 2
nodes reference the same set of vertices with different index buffers,
which is pretty common when a node has multiple materials.  It also
breaks ODE, who doesn't like it when vertices outnumber indices too
much.
2022-11-09 22:22:51 -08:00
bjorn 00aa4e3a23 TerrainShape mass fix; 2022-11-09 22:22:26 -08:00
bjorn f8f748320e Minor Shape improvements;
- Add helper functions for creating shapes to avoid duplication between
  newShape and newShapeCollider.
- Add lovr.physics.newMeshShape and lovr.physics.newTerrainShape
- Register TerrainShape so it has all the base Shape methods
- Smooth out a few TerrainShape warnings
2022-11-09 20:53:42 -08:00
bjorn 9783140725 Fix window resize; 2022-11-09 19:05:01 -08:00
bjorn 3775ed1be6 gpu: use distinct allocator/memory for staging buffers;
Fixes easily-encounterable GPU OOM on discrete cards.

Currently when mapping CPU-accessible GPU memory, there are only two
types of memory: write and read.

The "write" allocations try to use the special 256MB pinned memory
region, with the thought that since this memory is usually for vertices,
uniforms, etc. it should be fast.

However, this memory is also used for staging buffers for buffers and
textures, which can easily exceed the 256MB (or 246MB on NV) limit upon
creating a handful of large textures.

To fix this, we're going to separate WRITE mappings into STREAM and
STAGING.  STREAM will act like the old CPU_WRITE mapping type and use
the same memory type.  STAGING will use plain host-visible memory and
avoid hogging the precious 256MB memory region.

STAGING also uses a different allocation strategy.  Instead of creating
a big buffer with a zone for each tick, it's a more traditional linear
allocator that allocates in 4MB chunks and condemns the chunk if it ever
fills up.  This is a better fit for staging buffer lifetimes since there's
usually a bunch of them at startup and then a small/sporadic amount
afterwards.  The buffer doesn't need to double in size, and it doesn't
need to be kept around after the transfers are issued.  The memory
really is single-use and won't roll over from frame to frame like the
other scratchpads.
2022-11-09 19:05:01 -08:00
mcc c682ced654 Minor comments on audio.c 2022-11-09 19:05:01 -08:00
Josip Miskovic 34611f2069 Add physics heightfield shape 2022-11-08 18:46:49 -08:00
bjorn 36e1471cf0 lovr.graphics.isInitialized;
Returns whether the graphics module is initialized.  Used by the default
error handler to know if it's safe to try to render the error screen.
2022-11-07 19:12:11 -08:00