Commit Graph

36 Commits

Author SHA1 Message Date
Sasha Szpakowski 1084d94f90 Fix missing sRGB<->Linear pixel format swaps for DXT and BC formats. 2024-02-17 13:16:10 -04:00
Sasha Szpakowski 64a30f177f Merge branch 'main' into 12.0-development 2024-02-10 12:24:48 -04:00
Sasha Szpakowski 94d5864144 update year for copyright notice 2024-02-10 12:13:22 -04:00
Sasha Szpakowski 8c13943f64 ImageData can track whether they're meant to be loaded into a Texture with a non-sRGB format when gamma correct rendering is enabled.
Fixes #1556.

* Add ImageData/CompressedImageData:setLinear and ImageData/CompressedImageData:isLinear.
  The flag is used as a hint when loading a texture from the data to determine if the format should not be treated as sRGB-encoded. The 'linear' flag in newImage overrides this.

* love.graphics.readbackTexture automatically sets the linear flag on ImageData it returns when the texture's format is linear.
  This allows an ImageData generated via readback to be fed back into a new Texture and the format will match the original Canvas.

* Also clean up some image decoding code.
2023-10-14 20:48:21 -03:00
Sasha Szpakowski 343d192f10 Compressed texture formats have explicit sRGB variants 2023-10-14 15:01:01 -03:00
Sasha Szpakowski f6cdbdc868 Merge branch 'main' into 12.0-development 2022-12-31 22:46:34 -04:00
Sasha Szpakowski c823dbca96 Update copyright year for 2023 2022-12-31 22:25:49 -04:00
Alex Szpakowski e61a664a8b ImageData: limited support for integer pixel formats.
For now this doesn't support conversions (get/set/mapPixel, etc). Just the ability for ImageData to contain integer pixel contents, for example via Canvas:newImageData.
2022-04-18 10:46:02 -03: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 8e7fd10b6f Update copyright year for 2022 2021-12-31 18:33:40 -04:00
Alex Szpakowski 304b569a39 metal: tag texture formats with compute write support 2021-12-24 17:45:05 -04:00
Alex Szpakowski e63025b74f Merge branch '12.0-development' into metal 2021-12-24 15:34:05 -04:00
Alex Szpakowski 48b3a4e860 Initial support for integer format textures.
They can't be rendered to and ImageData can't use the formats, for now.
2021-08-12 16:38:54 -03:00
Alex Szpakowski 21f5ba86d3 Merge branch 'master' into 12.0-development 2021-04-07 20:33:44 -03:00
Alex Szpakowski f89aabb0bb Update copyright year for 2021 2021-04-04 16:14:45 -03:00
Alex Szpakowski 9765485222 metal: partial implementation of pipeline states.
Add BGRA8 pixel format.
2020-05-03 12:48:43 -03:00
Alex Szpakowski 742a954655 Merge branch '12.0' into metal 2020-02-15 14:18:35 -04:00
Alex Szpakowski 12c90b3dca Merge Image and Canvas GL backend classes into new common Texture class. 2020-02-07 20:29:21 -04:00
Alex Szpakowski b46b3ed552 Move some Canvas code to Texture, devirtualize Texture::draw. 2020-02-03 19:02:58 -04:00
Alex Szpakowski 74cf9b8236 The bones of what will become a Metal backend.
This isn't anywhere close to usable (not even a blank screen will work), let alone complete. It's about 20% done.
2020-01-26 15:46:33 -04:00
Alex Szpakowski 5f9b5a21d0 Merge default into minor
--HG--
branch : minor
2020-01-03 22:45:36 -04:00
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04:00
Alex Szpakowski efa2bd7837 Consolidate some internal graphics state definitions into a new renderstate file.
--HG--
branch : minor
2019-12-26 23:07:51 -05:00
Alex Szpakowski f3b52f66fe Update the internal naming convention for pixel formats.
--HG--
branch : minor
2019-12-23 23:38:04 -04:00
Alex Szpakowski e11d43507e Reorganize ImageData:set/mapPixel code so less of it is in the Lua wrapper and more of it is in the ImageData class itself. 2019-09-21 21:48:03 -03:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Alex Szpakowski 621fb24ba1 Require stencil=true to be specified in setCanvas if stenciling is used while a Canvas is active and there is no custom stencil buffer.
--HG--
branch : minor
2017-04-29 21:29:37 -03:00
Alex Szpakowski a0ef2ac28b Add Depth compare / shadow sampler support. Officially this is only supported in glsl3 shaders.
- Add Texture:setDepthSampleMode(comparemode). Only works on textures with depth pixel formats. A texture with the depth sample mode set will only work with a depth sampler.
- Add DepthImage, DepthArrayImage, and DepthCubeImage sampler keywords to glsl3.

--HG--
branch : minor
2017-04-12 20:26:06 -03:00
Alex Szpakowski c36a53fdcb Add new non-readable Canvas formats: depth16, depth24, depth32f, depth24stencil8, and depth32fstencil8.
--HG--
branch : minor
2017-04-11 18:34:04 -03:00
Alex Szpakowski 018a3831cb Add a new “stencil8” pixel format for Canvases (resolves issue #1003).
Also fixed Canvas MSAA (resolves issue #1271).

stencil-formatted Canvases can’t be drawn, and can only be used as the value for a new ‘depthstencil’ field to the table-argument variant of love.graphics.setCanvas.

--HG--
branch : minor
2017-04-11 00:00:22 -03:00
Alex Szpakowski abb72cb813 Happy new year! 🥂
--HG--
branch : minor
2017-01-02 01:28:29 -04:00
Alex Szpakowski 8aa6725039 Cleaned up some duplicated pixel format-related code in Font files.
--HG--
branch : minor
2016-12-29 02:45:27 -04:00
Alex Szpakowski cc1ea70272 Fix indentation
--HG--
branch : minor
2016-11-27 22:57:23 -04:00
Alex Szpakowski 0a3adc0839 Unify pixel format enums for ImageData, CompressedImageData, and Canvas into a single PixelFormat enum.
Replace love.graphics.getRawImageFormats and love.graphics.getCompressedImageFormats with love.graphics.getImageFormats.

--HG--
branch : minor
2016-11-27 22:53:23 -04:00