Commit Graph

4534 Commits

Author SHA1 Message Date
bjorn 89edccbf4c Add lovr.headset.isPassthroughEnabled and lovr.headset.setPassthroughEnabled; 2023-02-05 19:51:12 -08:00
bjorn 5a27a0f819 Update OpenXR to 1.0.26; 2023-02-05 18:12:43 -08:00
bjorn e4eb336bd6 Prevent creation of unrenderable texture views;
There were certain cases where an unrenderable texture view could be
created from a renderable parent texture (e.g. it has multiple mipmap
levels).  This would leave renderView as NULL, which would cause a
crash.
2023-02-05 17:34:24 -08:00
bjorn e076a582ce 3D depth textures can not have the 'render' flag;
Vulkan said so!!
2023-02-05 17:18:45 -08:00
bjorn a160def4e3 rm unreachable mipmap assert;
It's clamped earlier.
2023-02-05 17:15:15 -08:00
bjorn 7027defe3c rm attachmentCount shader flag;
It doesn't work as intended (due to glslang issues?).  The current way
to write a shader that uses multiple attachments is to declare multiple
output variables, which is a little better because you can name them
however you want and customize the type.

It would be nice to be able to support a "void" entrypoint for multiple
attachments so you don't need to awkwardly return the first target's
color, but I can't find a way around this right now.
2023-02-05 16:04:17 -08:00
bjorn b76d9bbfe5 Ensure mipmap count is consistently 1 for render targets;
Currently if you create a texture from dimensions (assumed to be a
render target), its mipmap count differs depending on whether you
provide an options table.  Now it will consistently be 1.
2023-02-05 16:02:58 -08:00
bjorn 495fca5f23 Add a variant of Texture:newView for single slices/mipmaps;
This is a more convenient syntax for the common case of creating a 2D
view of a single slice/level of an array/cubemap/3D texture.
2023-02-05 15:15:11 -08:00
bjorn 06c150ce4e Pass:setBlendMode/Pass:setColorWrite take optional target index;
If the target index is missing, the state will apply to all targets.
Fixes undefined behavior when setting color state in a pass with
multiple color attachments.
2023-02-05 15:07:33 -08:00
bjorn b0c3bd6e4c Lightuserdata can be pushed to channels; 2023-02-04 14:08:22 -08:00
bjorn 8337dd9caf Vectors work with channels;
They are copied by value.  Upon popping, they are pushed as temporary
vectors.  Matrices are allocated on the heap, everything else is stored
in the Variant itself.
2023-02-04 14:03:12 -08:00
bjorn 2144b5f81d Backport Lua utf8 library; 2023-02-03 23:17:43 -08:00
bjorn fbc591802a Details; 2023-02-01 19:26:18 -08:00
bjorn 66cb43a665 Support elbow poses from hand tracking;
Via XR_ULTRALEAP_hand_tracking_forearm
2023-02-01 18:36:05 -08:00
bjorn bf98c066b4 t.math.globals also adds capitalized constructors; 2023-02-01 17:57:37 -08:00
bjorn b9186487d1 Update LuaJIT; 2023-01-31 18:21:46 -08:00
bjorn b8b40bac40 Update stb_image to 2.28; 2023-01-31 18:20:26 -08:00
bjorn 39dfce8e8a Merge branch 'master' into dev 2023-01-31 18:02:11 -08:00
bjorn dfdda04fc7 Add Pico OpenXR SDK submodule; 2023-01-30 18:04:57 -08:00
bjorn d973020ce4 Add UVs to roundrect; 2023-01-27 00:32:21 -08:00
bjorn 2bccc4bf08 Increase max size of vector pool;
16k vec3s -> 4 million vec3s
2023-01-26 21:44:01 -08:00
bjorn 132b8d6003 Pass:roundrect; 2023-01-26 21:24:37 -08:00
bjorn d08cc539e8 Add vector constants;
They are implemented in the __index metamethod and return temporaries.
2023-01-24 18:37:04 -08:00
bjorn 017c2136fd Merge branch 'master' into dev 2023-01-24 18:36:27 -08:00
bjorn 4b0931a814 Change temp vector constructors to metatable __calls;
This enables a few things:

- Custom vector methods can be added/replaced.
- Vector methods can be called as non-methods e.g. vec3.normalize(v)
- Possibility for vector constants in an __index metamethod.

This was measured as increasing overhead by 3.5% when creating temporary
vectors (2ns), which is arbitrarily deemed acceptable.
2023-01-24 18:01:31 -08:00
bjorn f78c57050b actions: try to fix macOS permissions; 2023-01-23 18:38:14 -08:00
bjorn 4e01f84070 Depth resolves;
- Allow multisampled render pass to have a single-sample depth attachment
- Add a new depthResolve feature, indicating whether it's supported
- Fix stencil load/save
- Minor changes to render pass caching
- Currently the depth resolve is done using the first sample.  A future
  improvement would be to expose/use the min/max/average resolve modes.
2023-01-22 23:30:57 -08:00
bjorn 4f55b742c9 actions: macOS downloads and installs MoltenVK; 2023-01-21 15:27:14 -08:00
bjorn b24350fb31 gpu: macOS also tries linking to MoltenVK; 2023-01-21 15:27:14 -08:00
bjorn 59394c0cbc CMake: macOS links against Vulkan;
But shh in the build script we're going to make the Vulkan library
variable point to MoltenVK.
2023-01-21 15:26:36 -08:00
bjorn e042e718df CMake: macOS move_lib supports imported libraries; 2023-01-21 15:25:48 -08:00
bjorn cbdcef931d actions: fix macOS .app directory structure; 2023-01-21 12:52:18 -08:00
bjorn b9c49b8e07 actions: space out workflow yml; 2023-01-21 12:52:13 -08:00
bjorn bee8d16427 Add error when render pass/texture sample counts don't match; 2023-01-21 12:16:35 -08:00
bjorn 5bb3f50d77 gpu: enable VK_EXT_swapchain_colorspace when available; 2023-01-20 22:02:32 -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 4675dfb3e9 Fix build; 2023-01-18 18:21:53 -08:00
bjorn 14610333ab gpu: reduce tick count to 2;
4 is likely excessive, especially for VR, and increases memory usage and
cache misses.
2023-01-18 17:58:28 -08:00
bjorn 32cc6d52e7 gpu: cleanup;
- Surface stuff in struct;
- Struct for extensions;
2023-01-18 17:57:03 -08:00
bjorn ad76d2c0c6 gpu: Require and use VK_KHR_create_renderpass2;
It's pretty much ubiquitous and is needed for depth resolves.
2023-01-16 16:25:39 -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
Bjorn df4d519ccd
Merge pull request #629 from undefdev/master
Fix constrained rendering in windowed mode on macOS #620
2023-01-06 14:49:28 -08:00
undef bc7a541279 Fix constrained rendering in windowed mode on macOS #620 2023-01-06 20:30:05 +01:00
bjorn b6d8546a6f Merge branch 'master' into dev 2023-01-02 16:46:55 -08:00
bjorn dd65a59602 Fix some literals in Curve:evaluate; 2023-01-02 14:43:27 -08:00
bjorn 9d40968ff2 Year; 2023-01-01 19:00:38 -08:00
bjorn 58c5f0624e Fix for vk portability extension;
- Always enable when supported.
- It's not required to be enabled, even if portability_enumeration is present.
2023-01-01 05:03:05 -08:00
bjorn ae4a75eecd Shift around Vulkan initialization;
Start to make it easier to declare extensions, mark them as required,
and detect whether they're supported at runtime.
2022-12-31 17:42:51 -08:00
Bjorn 231301fdff
Add Discord to README; 2022-12-31 13:52:51 -08:00
bjorn 4a25b22c4a tup: use vendored vulkan headers; 2022-12-30 22:04:27 -08:00