Commit Graph

255 Commits

Author SHA1 Message Date
Sasha Szpakowski bda679d629 vulkan: fix extra redundant swapchain recreation happening on resize. 2025-02-02 17:05:48 -04:00
Sasha Szpakowski 0e5133e1f7 vulkan: prefer native drivers over vulkan-on-d3d12. 2025-02-02 11:13:09 -04:00
Sasha Szpakowski cc88b94ac4 vulkan: pick the first device with the highest score when multiple have the same score. 2025-02-02 10:57:22 -04:00
Sasha Szpakowski 25a2753b72 vulkan: fix 1 frame delay of backbuffer resize
Fixes #2128.
2025-02-01 17:08:33 -04:00
Sasha Szpakowski 92e79ab609 vulkan: reduce memory usage when many shaders are being used with many draw calls.
Descriptor pools are now shared among shaders that have the same descriptor counts, instead of being unique per shader.
2025-01-26 14:45:51 -04:00
Sasha Szpakowski dd3ebae7a1 vulkan: don't try to enable anisotropic filtering if anisotropy is 1. 2025-01-25 12:50:57 -04:00
Sasha Szpakowski 324b0f831b vulkan: improve error messages 2025-01-25 12:11:58 -04:00
Sasha Szpakowski add3fe3418 vulkan: only debug print that initialization failed if graphics debug mode is enabled. 2025-01-11 14:55:46 -04:00
Sasha Szpakowski 652b012b02 vulkan: improve module initialization code to exit to other backends if there's a device but it's not suitable for love.
Disallow software rendering (CPU devices) with vulkan by default. The environment variable LOVE_GRAPHICS_VULKAN_ALLOW_SOFTWARE can be set to 1 to override that behaviour.
2025-01-11 14:55:23 -04:00
Sasha Szpakowski f0a7a19ebc vulkan: fix crash on quit if no window has been created. 2025-01-04 16:19:30 -04:00
Sasha Szpakowski aa79ed1ad1 Fix typo 2024-12-20 23:45:31 -04:00
Sasha Szpakowski b87aed937c vulkan: clean up framebuffers when textures they reference are deleted
Fixes corruption/crashing in some situations if a new texture's image view has the same pointer as a previously deleted texture's image view.
2024-12-20 23:37:06 -04:00
Sasha Szpakowski da365e2ab9 Add t.graphics.lowpower = true/false love.conf option (defaults to false).
Add love.graphics.isLowPowerPreferred.

It's currently hooked up in the vulkan backend.
#2127
2024-12-20 21:02:20 -04:00
Sasha Szpakowski fe4fc84659 vulkan: implement MSAA textures. 2024-12-01 14:23:13 -04:00
Sasha Szpakowski d73036f44d vulkan: safer cleanup on shutdown 2024-10-20 14:35:23 -03:00
Sasha Szpakowski 337d8fa048 remove source code support for SDL2 2024-10-18 20:22:26 -03:00
Sasha Szpakowski 5383390937 vulkan: fix initialization when SDL3 is used 2024-10-11 18:59:32 -03:00
Sasha Szpakowski 28393cdfd5 Fix compilation on Windows when SDL3 is used 2024-10-06 20:27:59 -03:00
Sasha Szpakowski e986160431 Use SDL3-compatible SDL includes when SDL3 headers are available 2024-10-06 20:27:28 -03:00
Sasha Szpakowski eeec2429e2 vulkan: use subpass dependencies for layout transitions when switching canvases. 2024-09-30 23:04:58 -03:00
Sasha Szpakowski 3a6833ffb5 fix compile error 2024-09-30 20:15:11 -03:00
Sasha Szpakowski 1ee89154c0 vulkan: memory barrier after compute dispatches. 2024-09-30 19:58:45 -03:00
Sasha Szpakowski 8e6efac595 vulkan: fix a crash when the window has no depth or stencil. 2024-09-28 18:30:26 -03:00
Sasha Szpakowski 50ff1e4d2b use location numbers for vertex input attributes, instead of name-based binding.
- add 'location' named field to buffer and mesh vertex format tables, replaces 'name' field.
- location numbers are expected to match 'layout (location = #)' qualifiers in vertex inputs in shader code.
- deprecate vertex inputs in shader code that don't have layout location qualifiers.
- love's default vertex attributes use location 0 for position, 1 for texcoord, and 2 for color.
- add new variants of Mesh:attachAttribute, setAttributeEnabled, and isAttributeEnabled which take location numbers instead of names.

Improves draw performance in vulkan and metal backends.
2024-09-07 18:06:03 -03:00
Sasha Szpakowski 654585ccc2 vulkan: don't try to enable blending with integer canvases. 2024-08-14 21:00:24 -03:00
Sasha Szpakowski 0ca8cb4b41 vulkan: fix negative scissors not being clamped. 2024-08-05 10:21:10 -03:00
Sasha Szpakowski 6acdd5f01f vulkan: fix depth texture compare mode setting. 2024-07-11 21:29:58 -03:00
Sasha Szpakowski 9f18595559 vulkan: reduce memory use in some situations 2024-06-28 21:53:03 -03:00
Sasha Szpakowski b16e1d6e27 vulkan: don't periodically clean up render pass objects.
It's not needed.
2024-06-24 18:41:52 -03:00
Sasha Szpakowski 35f20eb053 vulkan: move cached PSO ownership to shaders.
Fixes issues with state corruption when a shader is created with the same memory address as a recently deleted shader.
2024-06-24 18:31:34 -03:00
Sasha Szpakowski 10c435cfc9 vulkan: fix a crash in setCanvas. 2024-06-22 21:05:37 -03:00
Sasha Szpakowski 54a31ec615 Minimum required opengl version is now OpenGL 3.3 / OpenGL ES 3.0. 2024-06-19 18:08:09 -03:00
Sasha Szpakowski bfc4212f30 Remove NormalMatrix shader uniform.
It doesn't provide much value given its costs. It also didn't work properly with auto-batched draws.
2024-06-17 20:57:28 -03:00
Sasha Szpakowski e180b256b8 vulkan: fix cull mode in quad drawing code 2024-06-17 17:08:31 -03:00
Sasha Szpakowski a894c2f6a4 vulkan: fix validation errors related to scissors when drawing. 2024-05-03 20:24:25 -03:00
Sasha Szpakowski 1f0f2a0781 vulkan: fix detection of linear filter support for pixel formats 2024-04-12 18:00:09 -03:00
Sasha Szpakowski 4b3fdc2317 vulkan: fix a crash in the error screen 2024-04-11 22:44:47 -03:00
Sasha Szpakowski 111bbde32d vulkan: fix shaders with int vertex attributes when nothing using that attribute is drawn. 2024-04-11 22:35:43 -03:00
niki 15c14c69b4 vulkan: correct scissor extent calculation 2024-04-09 18:04:54 +02:00
niki 869cb23314 vulkan: fix incorrect scissor when rendering to a canvas 2024-04-09 17:31:04 +02:00
Sasha Szpakowski 8140817107 vulkan: fix a crash on minimization.
Use a fake backbuffer when the system reports 0 for swap chain dimensions.
2024-04-07 17:25:46 -03:00
Sasha Szpakowski 2bc9777c3b vulkan: limit render pass layout transitions to the active mipmap/layer. 2024-04-07 09:48:54 -03:00
Mark Jansen a689d8e450 Fix building love on Windows for SDL3-3.1.0 2024-04-01 19:26:52 +02:00
Sasha Szpakowski 44a6a81641 vulkan: improve depth/stencil texture support. 2024-03-31 17:56:36 -03:00
Sasha Szpakowski f32b6bde57 vulkan: fix validation error when clearing mid-pass. 2024-03-31 13:28:46 -03:00
Sasha Szpakowski a0ca3c148e vulkan: improve handling of vertex attribute bindings. 2024-03-31 12:55:40 -03:00
Sasha Szpakowski b33afc4371 vulkan: love.graphics.clear fixes.
- Fix love.graphics.clear(color) when multiple canvases are active.
- Fix love.graphics.clear when an integer-format canvas is active.
2024-03-28 19:00:29 -03:00
Sasha Szpakowski d82922f774 vulkan: let the system handle device rotation for us.
We'd need to inject a whole bunch of code into user shaders (for example to rotate derivates) if we wanted to reliably handle it ourselves, which isn't viable.
2024-03-27 20:00:05 -03:00
Sasha Szpakowski 7bfbd647ba Make shader clip space consistent across APIs and projection matrices.
- All shaders are expected to output clip space values that are effectively y-up, with [-1, 1] z, in NDC.
- The transform to a backend's expected clip space values from the above range now happens after user vertex shader code is run, instead of inside a projection matrix.
- Projection matrices no longer need to be flipped when rendering to a canvas versus the main screen.

This means custom projection matrices might need to be altered to account for the more consistent range.
2024-03-23 22:00:02 -03:00
Sasha Szpakowski 9aaeabd6a5 vulkan: fix love_ScreenSize shader variable when a canvas is active. 2024-03-22 23:08:34 -03:00