Sasha Szpakowski
8d360113f8
update code for some recent SDL3 renames
2024-03-25 20:55:28 -03:00
Sasha Szpakowski
2bdadf51d4
Merge branch 'main' into SDL3
2024-03-24 18:53:08 -03:00
Sasha Szpakowski
21b71d02b5
Add love.graphics.setCustomProjection.
...
The active projection matrix is reset when changing canvases, and when the window is resized if no canvas is active at the time.
2024-03-24 10:46:29 -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
698d305212
Remove love.graphics.setOrthoProjection and setPerspectiveProjection
2024-03-23 17:58:34 -03:00
Sasha Szpakowski
565eab4ae1
samplers use mediump instead of lowp by default in GLSL ES.
2024-03-23 09:50:48 -03:00
Sasha Szpakowski
1e657ea0bf
metal: fix love_ScreenSize shader variable when rendering to a non-default mipmap level of a Canvas.
2024-03-22 23:15:09 -03:00
Sasha Szpakowski
9aaeabd6a5
vulkan: fix love_ScreenSize shader variable when a canvas is active.
2024-03-22 23:08:34 -03:00
Sasha Szpakowski
17cb64c45f
vulkan: fix validation errors in love.graphics.getTextureFormats.
2024-03-21 21:43:45 -03:00
Sasha Szpakowski
bbaa55f8b8
vulkan: fix validation errors in layout transitions for depth-only and stencil-only images.
2024-03-21 21:32:03 -03:00
Sasha Szpakowski
95796caa06
improve performance of love.graphics.draw's Lua binding code.
2024-03-20 18:36:59 -03:00
Miku AuahDark
9eacd483c6
Android: Fixed assets/game.love fusing not being recognized.
...
Fixes love2d/love-android#267 .
2024-03-19 22:24:45 +08:00
Sasha Szpakowski
4d1865fe1a
opengl: attempt to fix the Android workaround for r8 pixel format support.
2024-03-17 13:54:40 -03:00
Sasha Szpakowski
60911c5181
vulkan: remove some newly dead code
2024-03-17 00:01:10 -03:00
Sasha Szpakowski
48aefd91fa
vulkan: captureScreenshot improvements.
...
- Don't create several persistent screen-sized images and buffers for screenshots, only create one temporary buffer during a frame that requests a screenshot.
- Attempt to handle more out-of-memory situations.
- Make sure the final screenshot is opaque.
- Swap R and B channels in the screenshot ImageData when the backbuffer is BGRA.
2024-03-16 23:51:40 -03:00
Sasha Szpakowski
f3887361e5
Merge pull request #2037 from nikeinikei/main
...
vk: unify local uniform buffer
2024-03-13 18:33:56 -03:00
niki
07c5c44ea3
vulkan: simplify code with alignUp
2024-03-13 22:16:33 +01:00
Sasha Szpakowski
f8859358c3
allow graphics debug output when OpenGL ES 3.2 is used.
2024-03-12 18:28:26 -03:00
Sasha Szpakowski
930053d81d
opengl: ignore debug notifications when debug output is enabled.
2024-03-12 18:27:49 -03:00
Sasha Szpakowski
63aba28d18
metal: fix shader compilation when using void effect() with MRTs.
2024-03-11 19:14:25 -03:00
niki
295fb214d5
vulkan: remove unused constant and use correct sizes for mapping
...
the local uniform stream buffer
2024-03-11 13:47:43 +01:00
Sasha Szpakowski
c91101d2e4
Fix texel buffer detection in shaders.
2024-03-10 21:24:10 -03:00
Sasha Szpakowski
ec9fb6eb28
Improve Windows vulkan draw performance by reducing the size of a struct.
2024-03-10 14:33:29 -03:00
Sasha Szpakowski
b12ecf49d8
Fix compile errors
2024-03-10 13:51:33 -03:00
Sasha Szpakowski
9e00ce0973
metal: fix uniform data corruption
...
The wrong buffer binding offset was being used in 2/3rds of frames.
2024-03-10 13:38:28 -03:00
Sasha Szpakowski
75fd2fa06e
metal: add debug labels for internal buffers.
2024-03-10 13:08:04 -03:00
niki
54f27a8277
vulkan: unify local uniform buffer
2024-03-10 14:41:37 +01:00
Sasha Szpakowski
b6c47cd3ec
vulkan: fix typo preventing storage textures in shaders from working.
2024-03-09 16:09:26 -04:00
Sasha Szpakowski
b08f35d341
vulkan: only set cubemap compatibility for array textures with >= 6 layers.
2024-03-09 16:01:26 -04:00
Sasha Szpakowski
892411a737
don't error during newShader if a buffer is unused.
2024-03-09 13:22:39 -04:00
Sasha Szpakowski
10565e9967
vulkan: improve draw performance via Shader::cmdPushDescriptorSets.
2024-03-09 13:22:15 -04:00
Sasha Szpakowski
be377601f7
vulkan: shader binding mapper works with arrays of resources
2024-03-09 13:07:23 -04:00
Sasha Szpakowski
51d5773b93
vulkan: optimize vertex buffer binding code
2024-03-09 00:15:13 -04:00
Sasha Szpakowski
52f33041a5
Fix Shader:send with storage buffers.
2024-03-08 17:52:48 -04:00
niki
ca0264e906
vulkan: fix #2032
...
when using the low level vertexmain and pixelmain entry points
it can happen that there are no local uniforms used.
2024-03-08 13:42:05 +01:00
Sasha Szpakowski
8dae72b88e
vulkan: fix shader:send(texture|buffer) not calling love.graphics.flushBatch.
2024-03-07 23:04:22 -04:00
Sasha Szpakowski
c35b9cba4a
vulkan: fix a potential error during draws.
2024-03-07 22:31:05 -04:00
Sasha Szpakowski
321143755f
metal: clean up some shader resource binding code
2024-03-07 21:53:40 -04:00
Sasha Szpakowski
ad42570cef
Fix compile errors on Linux/Android
2024-03-07 21:37:21 -04:00
Sasha Szpakowski
2079f657e7
graphics: most uniform reflection is handled at a higher level instead of backend code.
...
Fixes boolean uniforms when Metal is used.
2024-03-07 21:24:11 -04:00
Sasha Szpakowski
3509e651fd
Fix Texture:getWidth for texture views.
2024-03-06 14:23:18 -04:00
Sasha Szpakowski
32e777c156
vulkan: fix a crash.
2024-03-05 23:03:55 -04:00
Sasha Szpakowski
01fbedb225
vulkan: improve some error messages when shader compilation fails.
2024-03-03 12:40:23 -04:00
Sasha Szpakowski
fe56f88f8e
opengl es: expand support for rendering to floating point formats.
2024-02-28 17:55:37 -04:00
Sasha Szpakowski
8ba72d8cf1
opengl: the computewrite flag isn't supported for sRGB textures.
2024-02-28 13:20:11 -04:00
Sasha Szpakowski
ff06718f8a
opengl: only populate Shader:getWarnings string when there are warnings.
2024-02-27 23:17:24 -04:00
Sasha Szpakowski
ed6a50178c
Filled polygons have texture coordinates computed from their bounds.
...
Fixes #1951 .
2024-02-25 20:09:06 -04:00
Sasha Szpakowski
476e520969
Fix pointer alignment of default random generator object.
2024-02-25 11:51:33 -04:00
Sasha Szpakowski
e20f018272
Change the 'viewformats' texture setting field to be a list of pixel formats.
...
Replace Texture:hasViewFormats with Texture:getViewFormats.
2024-02-24 23:42:28 -04:00
Sasha Szpakowski
42812ad521
Add texture views. Fixes #2022 .
...
Add love.graphics.newTextureView(basetexture, viewsettings). Requires GLSL4 support.
Add 'viewformats' boolean setting to texture setting tables.
Add Texture:hasViewFormats.
The viewsettings table has the following fields:
format = nil, -- set this to a pixel format to override the base format. It must have the same number of bytes per pixel as the original, and the 'viewformats' setting on the original texture must be true for this to work. Cannot be used for compressed or depth/stencil textures.
type = nil, -- set this to a texture type to override the base texture type. 2d base textures can make [2d, array] views. [array, cube] base textures can make [2d, array, cube] views.
mipmapstart = nil, -- set to a number to use a less detailed mipmap level as a base.
mipmapcount = nil, -- set to a number to override the number of mipmaps in the texture view.
layerstart = nil, -- set to a number to use a specific layer or cube face as a base.
layers = nil, -- set to a number to override the number of layers in an array texture view.
2024-02-24 15:45:43 -04:00