Commit Graph

3544 Commits

Author SHA1 Message Date
Alex Szpakowski b3d37e5fc2 metal: Apple Silicon macs support PVRTC/ETC/ASTC textures. 2022-01-24 21:09:33 -04:00
Alex Szpakowski e4020e439a metal: lowdpi on macOS uses nearest instead of linear upscaling.
Matches the behaviour of the OpenGL backend on macOS.
2022-01-23 12:55:06 -04:00
Alex Szpakowski a5351e5046 metal: improve detection of rgba32f format filter and MSAA support. 2022-01-23 11:28:09 -04:00
Alex Szpakowski 6dbb7fa5de Add love.graphics.setStencilMode. Remove old stencil API.
- Add setStencilMode(drawaction, comparemode, value = 0, readmask = 0xFF, writemask = 0xFF).
- Add getStencilMode.
- Remove love.graphics.stencil.
- Remove love.graphics.set/getStencilTest.

Note that the new setStencilMode API does not clear the stencil buffer, and does not turn off color writes (it can still be done manually), unlike love.graphics.stencil.

Fixes #1161.
Fixes #1251.
2022-01-22 23:36:07 -04:00
Alex Szpakowski 173fe3dab5 Add a love.graphics.setColorMask variant which accepts a single bool.
Remove the variant which accepted no args - it would be too confusing because setColorMask(false) does the opposite of what setColorMask(nil) used to do.
2022-01-22 23:27:53 -04:00
Alex Szpakowski c26f6ed94f metal: improve performance of auto depth/stencil in setCanvas. 2022-01-22 23:12:42 -04:00
Alex Szpakowski 4c3c875aa9 metal: clean up some code around render pipeline states. 2022-01-22 21:29:57 -04:00
Alex Szpakowski 87592513a2 metal: fix automatic depth/stencil with setCanvas. 2022-01-22 20:57:06 -04:00
Alex Szpakowski 8c496d60e5 metal: add a couple comments clarifying depth format fallbacks. 2022-01-22 14:51:37 -04:00
Alex Szpakowski 1cf0073cf4 metal: use a fallback for fonts when luminance-alpha isn't supported. 2022-01-22 14:41:42 -04:00
Alex Szpakowski 62de8f62c7 metal: hook up emulated 'fan' mesh draw mode. 2022-01-22 12:59:09 -04:00
Alex Szpakowski 3ecae61189 metal: improve texture initialization. 2022-01-16 14:18:34 -04:00
Alex Szpakowski 44d87ff7ce metal: fix textures not being tagged with compute-write flags. 2022-01-16 13:47:18 -04:00
Alex Szpakowski 4e1c4a6afe metal: some fixes for MSAA 2022-01-16 13:44:29 -04:00
Alex Szpakowski d96e1636b1 Improve setCanvas validation of volume texture layer + mipmap values. 2022-01-16 13:00:12 -04:00
Alex Szpakowski f78db47d0e opengl: allow glTexStorage on Android devices. 2022-01-16 12:00:16 -04:00
Alex Szpakowski a7c4e56a41 Merge branch 'main' into 12.0-development 2022-01-16 11:58:07 -04:00
Alex Szpakowski 65667c0f18 Fix sRGB texture internal formats in OpenGL ES 3. 2022-01-16 10:30:56 -04:00
Alex Szpakowski 4ca3535cd2 Metal: fix clamp-to-one texture wrap mode detection. 2022-01-15 23:31:07 -04:00
Alex Szpakowski de35999de3 Prevent meshes with the 'fan' draw mode from using an index buffer. 2022-01-15 21:23:15 -04:00
Alex Szpakowski 5c3f391136 update metal backend for projection changes. 2022-01-12 18:31:32 -04:00
Alex Szpakowski f93d167a47 Merge branch '12.0-development' into metal 2022-01-12 18:23:23 -04:00
Alex Szpakowski f7f5290693 love.graphics.newMesh: DrawMode arg no longer defaults to 'fan'. 2022-01-09 14:37:33 -04:00
Alex Szpakowski ff83ee6a9c Add basic ortho and perspective projection APIs to love.graphics.
- Added love.graphics.setOrthoProjection.
- Added love.graphics.setPerspectiveProjection.
- Added love.graphics.resetProjection.

Note that the projection is reset whenever the canvas changes.
2022-01-08 22:56:21 -04:00
Alex Szpakowski cdafe5a931 opengl: explicitly don't support BGRA pixel formats.
They're only used internally, by the metal backend.
2022-01-06 17:53:32 -04:00
Alex Szpakowski 425537ad5e Metal view creation failure shows a relevant error message. 2022-01-06 17:37:56 -04:00
Alex Szpakowski a76606e76e metal: fix some define checks. 2022-01-06 17:34:20 -04:00
Alex Szpakowski c373fb2e82 Fix compilation on macOS/iOS 2022-01-05 21:28:47 -04:00
Alex Szpakowski cf57c3eedf update copyright year for metal files 2022-01-05 21:13:53 -04:00
Alex Szpakowski d51e012812 Merge branch '12.0-development' into metal 2022-01-05 21:12:22 -04:00
Alex Szpakowski 7f3538d2ba Merge branch 'main' into 12.0-development 2022-01-05 21:10:27 -04:00
Alex Szpakowski 5426be4252 Prefer OpenGL to Metal (for now) 2022-01-05 20:58:38 -04:00
Alex Szpakowski 44a434604a t.renderers/excluderenderers doesn't affect renderer order. 2022-01-05 20:52:17 -04:00
Alex Szpakowski 674143175f metal: fix Shader:send with matrices and arrays. 2022-01-05 20:33:08 -04:00
Alex Szpakowski 5864d83c31 Add ability to configure which renderers are used by love.graphics.
- Add t.renderers and t.excluderenderers love.conf fields. They can be an array of renderer names.
- Add --renderers a,list,of,renderernames and --excluderenderers more,renderers argument options.
2022-01-04 21:29:56 -04:00
Alex Szpakowski ecbc5ca7f6 Add love.graphics.getQuadIndexBuffer.
love's pre-generated quad index buffer is useful when combined with drawShaderVertices. Note that it uses 16 bit indices so it can only draw up to 16k quads in a single call.
2022-01-03 16:22:08 -04:00
Alex Szpakowski 42e8df1489 Add a GraphicsFeature support enum for 32 bit index buffers.
Some old OpenGL ES 2 systems don't support them.
2022-01-03 16:09:38 -04:00
Alex Szpakowski ac8f5374c2 Fix a minor validation bug. 2022-01-03 14:36:22 -04:00
Alex Szpakowski 0c4be3d5e3 Add love.graphics.drawShaderVertices (name subject to change).
It draws a number of vertices, or a number of indices from an index buffer, without using any vertex data from a vertex buffer. A custom shader is required while using it.

It is useful when a custom GLSL3 vertex shader which uses love_VertexID is used to pull or compute per-vertex information from other sources.
2022-01-03 14:33:54 -04:00
Alex Szpakowski de89f5a9eb love.graphics.apply/replaceTransform can accept x,y,angle,etc. args. 2022-01-03 11:57:05 -04:00
Alex Szpakowski 91cb845f31 #pragma language glsl4 in shaders maps to GLES 3.2 instead of 3.1. 2022-01-02 14:02:55 -04:00
Alex Szpakowski 59f532fdfa Add amazon luna and google stadia enums to Joystick:getGamepadType. 2022-01-01 18:15:27 -04:00
Alex Szpakowski f88eecf482 Allow texel buffers in OpenGL ES, when supported by the system. 2022-01-01 18:06:50 -04:00
Alex Szpakowski 9709f95194 metal: fix structs in uniforms. 2022-01-01 17:41:23 -04:00
Alex Szpakowski e2c397355c metal: implement copyBufferToTexture and copyTextureToBuffer. 2022-01-01 15:48:43 -04:00
Alex Szpakowski 40aa50662a Merge branch '12.0-development' into metal 2022-01-01 15:36:57 -04:00
Alex Szpakowski e602f08c24 metal: support constant initializer values for local uniforms. 2022-01-01 15:28:42 -04:00
Alex Szpakowski 8e7fd10b6f Update copyright year for 2022 2021-12-31 18:33:40 -04:00
Miku AuahDark 78a915c8f4 Update dr_flac to 0.12.33 2021-12-31 10:09:36 +08:00
Alex Szpakowski 813c9d1781 Fix GL version check for arbitrary texture-to-buffer copy support.
love never creates a GL4.5 context, so we also need to check for the extension that provides the same functionality.
2021-12-30 19:25:10 -04:00