Commit Graph

5344 Commits

Author SHA1 Message Date
bjorn a4c1d9fce6 Thread module initializes job system;
Worker count can be set from conf.lua.

A negative worker count is relative to the number of cores.

-1 is the default.
2024-02-28 12:31:34 -08:00
bjorn d017ca0fac Details; 2024-02-28 12:31:34 -08:00
bjorn 35b5693a19 Add some more windows atomics; 2024-02-28 12:31:34 -08:00
bjorn e8dc1484d3 Cleanup; 2024-02-28 12:31:34 -08:00
bjorn 98e2e94ea8 Job done counter uses atomic loads/stores; 2024-02-28 12:31:34 -08:00
bjorn 4a175c4cf8 Fix atomic intrinsics; 2024-02-28 12:31:34 -08:00
bjorn 6347114030 Job system; 2024-02-28 12:31:34 -08:00
Bjorn 73eae189ae
Merge pull request #749 from bjornbytes/shader-rework
Shader Rework
2024-02-26 15:35:39 -08:00
bjorn 792fd75204 Texture view improvements;
- You can nest texture views (make a view of a view).
- You can do transfers on views (copies, clears, blits, etc.).
- You can give labels to views.
- API changes
  - Rename Texture:newView to lovr.graphics.newTextureView.
  - Constructor takes a table of options (order was too confusing).
  - Remove Texture:isView/getParent, since views can be used for everything now.
  - Better matches what LÖVE ended up doing.
- Fix bug where :getType on a view returned parent type.
2024-02-26 15:24:09 -08:00
bjorn ec380e0cfd rm pass uniformSize;
It's no longer necessary.
2024-02-25 14:58:11 -08:00
bjorn fa8ea6732b rm pass binding mask;
It's no longer necessary.
2024-02-25 14:57:27 -08:00
bjorn 466a052ded Cleanup; 2024-02-24 15:45:30 -08:00
bjorn 2fe5ba8f3b Ensure all binding fields are fully initialized; 2024-02-24 15:45:10 -08:00
bjorn ae19b7aad3 Fix resource binding numbers; 2024-02-24 15:33:09 -08:00
bjorn 652a074677 Update resource invalidation when switching shaders;
Previously, when switching shaders, resource bindings would be preserved
for resources with matching slots/types.  This doesn't make sense in a
world where binding numbers are internal.  Instead, match up resources
by name/type.

Additionally, rewire all the uniforms by name/size so uniforms with the
same name get preserved (name/type would be too hard for e.g. structs).
This seems like it would be horribly slow and may need to be optimized,
optional, or removed.

I didn't test any of this lol, but I will I promise.
2024-02-24 14:34:29 -08:00
bjorn bd83ad6eb4 Cleanup; 2024-02-24 11:49:11 -08:00
bjorn 48e484ed8a Update OpenXR to 1.0.34; 2024-02-24 11:05:39 -08:00
Bjorn f3cae5f80e
Merge pull request #748 from bjornbytes/rm-msaa-textures
Remove Multisample Textures
2024-02-23 12:38:23 -08:00
Bjorn bad3d8b78a
Merge pull request #747 from bjornbytes/changelog
Changelog
2024-02-23 12:38:12 -08:00
Bjorn f1158b2159
Merge pull request #745 from bjornbytes/xr-swapchain-colorspace
Fix OpenXR Swapchain Colorspaces
2024-02-23 12:37:54 -08:00
bjorn 114109ab54 rm multisample texture objects; 2024-02-22 14:40:32 -08:00
bjorn b65fa0d1f6 Add changelog; 2024-02-22 14:16:54 -08:00
bjorn b63ec6e137 Graphics shader requires fragment stage for now;
The vertex-only shader requires too much juggling of shader stage flags
and pipeline layout compatibility when e.g. binding push constants and
descriptor sets.
2024-02-21 10:37:59 -08:00
bjorn 6a669bd967 rm var shader macro;
It is no longer necessary, and wasn't widely used/documented.
2024-02-21 10:28:30 -08:00
bjorn ada33c6620 Downgrade glslang to 13.0.0 with lovr cherrypicks; 2024-02-21 10:25:00 -08:00
bjorn cbc9312716 Fix memory leak; 2024-02-21 10:21:42 -08:00
bjorn 728b166d69 Fix binding numbers; 2024-02-21 10:21:42 -08:00
bjorn 64e253a8ef mv logo shader to nogame bundle; 2024-02-21 10:21:42 -08:00
bjorn 81ef58d032 Use push constant instead of BaseInstance for DrawID;
This is a little slower, but means indirect draws can use Transform and Color.

There are other solutions for this.  For example LÖVR could reserve
BaseInstance and use a compute shader to rewrite indirect buffers.

For now we choose to be correct and a little slower.
2024-02-21 10:21:42 -08:00
bjorn 875a7f8237 Shader rework;
- Undeprecate ShaderType (it's good actually, kinda like a pipeline bind
  point and more specific than having lovr trying to make sense of a
  random set of stages).
- Use a default uniform block instead of push constants.  The Constants
  macro now maps to a uniform block declaration.
- It is no longer possible to create a shader by giving a single
  DefaultShader string (you can still give a per-stage DefaultShader
  though).
- lovr.graphics.compileShader now takes all stages instead of a single
  stage.  In general we need all stages when compiling GLSL because
  default uniforms require linking across stages.
2024-02-21 10:21:41 -08:00
bjorn 8b78a4d3b5 core/gpu: depth-only passes can include fragment shader; 2024-02-20 10:19:16 -08:00
bjorn d4e2736e0b Update glslang;
Includes a fix for generating SPIRV for multiple shader stages.

Also reverts a buggy upstream commit temporarily.
2024-02-20 10:17:20 -08:00
bjorn 45eba2fe85 rm ability to send resources by slot number; 2024-02-20 10:16:41 -08:00
bjorn 93348499e9 Binding numbers are assigned explicitly and merged across stages; 2024-02-20 10:16:41 -08:00
bjorn 035d359133 Add relaxed Vulkan flag; 2024-02-20 10:16:41 -08:00
bjorn f7c1d4cccb core/spv: return pointer to set/binding decorations instead of value; 2024-02-20 10:16:41 -08:00
bjorn eecd201f57 tup: use version-qualified library name for LuaJIT; 2024-02-20 09:35:56 -08:00
bjorn c6f010a572 tup: fix build; support toggling between jolt/ode; 2024-02-20 09:35:56 -08:00
Bjorn 10b0c81209
Merge pull request #746 from jmiskovic/fix/modelGetMesh
Fix Model:getMesh()
2024-02-19 15:01:27 -08:00
Josip Miskovic 37fdb39e73 Fix Model:getMesh() 2024-02-19 23:49:18 +01:00
bjorn 555d97afbe core/spv: parse texture properties;
Can detect if texture is cubemap, array, 2d, multisample, etc.
2024-02-18 20:36:33 -08:00
Bjorn f2bcfee8be
Merge pull request #735 from jmiskovic/jolt-rebase
Jolt physics engine integration
2024-02-17 12:11:41 -08:00
bjorn 0bf09ca108 Rearrange the way sRGB textures work (again); 2024-02-16 12:45:35 -08:00
Bjorn 2770ab270a
Merge pull request #743 from jmiskovic/simulator-supersampling
Headset simulator supersampling
2024-02-14 10:50:39 -08:00
Josip Miskovic 7229a93f11 Headset simulator supersampling 2024-02-14 19:34:13 +01:00
Josip Miskovic 47c9b20542 Jolt world-level damping and sleeping allowed
The damping 0.05 value comes from Jolt's BodyCreationSettings.h.
2024-02-13 19:18:57 +01:00
Josip Miskovic 0b8546fd62 Jolt MSVC workaround; set ODE as default engine 2024-02-13 17:34:18 +01:00
Josip Miskovic 431062c345 Increase Jolt body & constraint limits
The new values come from comments in the official HelloWorld.cpp. After
the changes the any increase of memory consumption is within the
measurement error.
2024-02-13 17:25:43 +01:00
bjorn 41deb706ce rm steamvr workaround for local-floor reference space; 2024-02-09 21:17:11 -08:00
bjorn 7b39a30600 Fix sType field in gpu_xr_acquire; 2024-02-09 19:01:55 -08:00