1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-02 12:33:52 +00:00
Commit graph

4793 commits

Author SHA1 Message Date
Bjorn 2d8db03faa
Merge pull request #642 from bjornbytes/buffer-improvements
Buffer Format Improvements
2023-03-21 23:07:20 -07:00
bjorn bfbd17fc9f Zero-initialize spv_field memory;
Not all fields are guaranteed to get filled in.
2023-03-21 22:26:14 -07:00
bjorn aecfe544b6 core/spv: Support runtime arrays in struct fields;
These have their array length set to ~0u.
2023-03-21 22:25:48 -07:00
bjorn f32800c044 Clean up Model lookeruppers; Model:getMaterial takes string; 2023-03-21 21:30:11 -07:00
bjorn 4d5e3f03b9 Change the way a single stencil action is used;
When a single stencil action is provided in Pass:setStencilWrite, it now
maps to just passOp instead of all the ops.  This matches expectations
and previous versions.
2023-03-21 21:13:38 -07:00
bjorn aa2f620c89 Fix issue where changing shaders doesn't reset vertex format; 2023-03-20 13:54:38 -07:00
bjorn fa0576e42c Fix some magic numbers; 2023-03-20 13:54:38 -07:00
bjorn 8b30dc73d3 Fix backwards compatibility behavior;
Fixes (data, format) order when fields are given using integer keys
instead of string keys.
2023-03-20 13:54:38 -07:00
bjorn 8fa46fe236 Reading arrays of vectors works with temp vectors; 2023-03-20 13:54:38 -07:00
bjorn 92e9efd882 More flexible Buffer formats; Deprecate temp buffers;
- Pass:mesh accepts tables for vertices/indices
- Add Pass:setVertexFormat to set format used for table-based meshes
- Pass:send accepts tables for buffers
- Pass:send supports arbitrarily nested structs/arrays for push constants
- Buffer formats support arbitrarily nested structs/arrays
  - Zero-length buffers are valid and represent structs
  - Fields can have names using 'name'
  - Field types can be tables of other fields (structs)
  - Fields can have 'length' key
- newBuffer syntax has been changed to put format first (old version
  still works)
- Buffers can be created from shader variables, avoiding need to declare
  matching format.
- Pass:clear/Pass:read use byte offsets instead of indices
- Pass:copy uses byte offsets when copying a Buffer to a Buffer
- Deprecate lovr.graphics.getBuffer (tables can be used instead)
2023-03-20 13:54:37 -07:00
bjorn d2b2523306 Improve sampler2D error message;
- core/spv just returns the type of image variables instead of trying to
  validate them.
- When Shader is loading resources, it will reject combined image
  samplers, uniform/texel buffers, and input attachments, with better
  error messages that include the binding number of the invalid resource.
2023-03-20 13:15:47 -07:00
bjorn ffd6396aae Error when model uses absolute path; Ignore ./ in model paths;
Fixes #652
2023-03-13 21:14:47 -07:00
bjorn a2da95031b Merge branch 'master' into dev 2023-03-13 20:49:33 -07:00
bjorn c871261946 CMake cleanup; 2023-03-12 15:07:23 -07:00
bjorn c42e784cd3 rm unused LuaJIT option;
GC64 is enabled by default.
2023-03-12 14:57:21 -07:00
bjorn 1d1470f042 Fix directory archive path normalization;
Fixes non-normalized paths not behaving as expected.
2023-03-09 21:27:04 -08:00
bjorn fe524452f3 Merge branch 'master' into dev 2023-03-09 18:37:25 -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 2ad2fd6d90 OpenXR: Improve error messages;
- Error messages say what went wrong instead of file/line
- Instead of silently failing during startup, log a warning
2023-03-07 20:16:59 -08:00
Bjorn cf235588dd
Merge pull request #649 from mcclure/cpp-noreturn
Make 0.16 util.h compile correctly when included from a C++ file
2023-03-05 19:12:31 -08:00
mcc c3b63e60ba Create LOVR_NORETURN abstracting the contradictory noreturn implementations in C11 and C++11 2023-03-05 19:16:59 -05:00
Bjorn d8e856e6e0
Merge pull request #645 from mcclure/size-t-narrow
Address various MSVC warnings (casts, comparisons, function pointers)
2023-03-03 17:25:48 -08:00
Bjorn 5fa53b3812
Update error message; 2023-03-03 17:17:49 -08:00
mcc e4e8c5476b Warning fixes (fix style) 2023-03-03 15:48:41 -05:00
bjorn aba5f328fe Throttle when OpenXR session is idle; 2023-03-02 19:33:35 -08:00
bjorn 6de1c624b4 Scope shader macros by the stage they're valid in;
Leads to better error messages if you try to use e.g. DefaultPosition in
a fragment shader.
2023-03-02 19:03:15 -08:00
bjorn ccffd3c1b2 Merge branch 'master' into dev 2023-03-02 18:31:20 -08:00
bjorn 6d382c2f0c Ensure blank images are cleared to zero;
This was an unintended change in v0.16.0.
2023-03-02 18:31:06 -08:00
mcc 52a7a51b8e Silence spurious function-pointer mismatch warning 2023-03-01 19:14:22 -05:00
mcc d00d908520 Silence signed/unsigned warning on rounded rectangle loop 2023-03-01 19:13:15 -05:00
mcc a5216347a0 Address size_t narrowing warnings in MSVC by adding casts. Add some asserts to make sure the casts are safe. 2023-03-01 18:15:04 -05:00
bjorn 4afb0ae2bf Fix Pass:clear(buffer); 2023-02-25 00:01:31 -08:00
bjorn 886db5f91d Stop using isdigit in obj importer; 2023-02-25 00:00:04 -08:00
bjorn 0103259938 Fix CMake build; 2023-02-24 21:05:31 -08:00
bjorn abbc6a6dc6 Merge branch 'master' into dev 2023-02-21 21:12:33 -08:00
bjorn 04c4dee851 rm -Os from glslangValidator flags;
It's not necessary
2023-02-21 21:11:29 -08:00
bjorn af4f1c1dea Fix compilation with glslang disabled; 2023-02-07 22:48:50 -08:00
bjorn 41dd24edc4 Organize math module files; 2023-02-07 21:44:43 -08:00
bjorn 1bc7af2a31 tup: fully support renaming android package; 2023-02-05 22:02:04 -08:00
Bjorn d1eaa43997
Merge pull request #641 from brainrom/pkgrename
Android package rename via CMake
2023-02-05 21:57:25 -08:00
Bjorn 49489dc0e8
Apply suggestions from code review 2023-02-05 21:47:52 -08:00
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