Commit Graph

461 Commits

Author SHA1 Message Date
Alex Szpakowski 95ab4054ff Fix a freeze on Intel drivers when using mipmapped Canvases
Fixes #1585

Also disallow generateMipmaps on depth/stencil canvases because it's not really supported.
2020-12-26 16:37:37 -04:00
Alex Szpakowski fe23c16198 Disable gamma correction on Windows + Intel HD 2/3000 / Intel HD Graphics
It's completely broken there. Closes #1592
2020-12-24 20:31:33 -04:00
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04:00
Alex Szpakowski c3be5c4682 Fix a crash when Canvas:newImageData is called and the width multiplied by the canvas format's pixel byte size is not a multiple of 4, for example a 3x3 r16f canvas (thanks Max!) 2019-11-12 21:27:46 -04:00
Alex Szpakowski 55d4dc0f9e Restructure some internal vertex buffer binding code to be closer to how graphics APIs actually behave. 2019-08-25 16:50:15 -03:00
Alex Szpakowski 09cd3b68c9 Explicitly disable color FBO attachments where possible for depth/stencil canvases. Potentially fixes issue #1470 2019-04-02 21:13:01 -03:00
Alex Szpakowski 74dcc41b38 Cleaned up love.graphics Image code for determining whether the image's pixel format is supported. 2019-01-16 19:30:21 -04:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
Alex Szpakowski 364718fa46 Android: potentially work around a Qualcomm Adreno driver bug which prevented videos from being loaded into vram. 2018-12-31 21:02:02 -04:00
Alex Szpakowski 93372b87a8 Fix love.graphics.clear(colortable) when no Canvas is active. 2018-04-03 20:12:41 -03:00
Alex Szpakowski cfa30167ca Fix hash map collisions when setting canvases. 2018-04-02 15:58:38 -03:00
Alex Szpakowski 39201af79f Improve the error message when an invalid layer or face index is given in love.graphics.setMode. 2018-01-14 19:15:24 -04:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Alex Szpakowski dd59803ad3 Error when invalid setting names are used in the tables passed to love.graphics.newCanvas and newImage. See issue #1312. 2017-12-28 23:16:51 -04:00
Alex Szpakowski 065f4a8e9b Fix SpriteBatch:setDrawRange. 2017-12-24 22:31:58 -04:00
Alex Szpakowski a31b500b03 Simplify quad drawing code, and use glDrawElementsBaseVertex when available. 2017-12-24 22:05:10 -04:00
Alex Szpakowski 3fb621af95 Always use a 16 bit index array for quad indices, with multiple draws when necessary. See issue #1356. 2017-12-24 15:54:03 -04:00
Alex Szpakowski 3a8390ceff Fix a couple bugs with love.graphics.clear. 2017-12-10 14:40:08 -04:00
Alex Szpakowski 7354de2059 Add (low level) functionality to allow rendering 3D Meshes.
- Add love.graphics.setDepthMode(testcomparison, enablewrites).
- Add love.graphics.setMeshCullMode.
- Add love.graphics.setFrontFaceWinding.

Depth testing and depth writes require a depth buffer to work. The mesh cull mode controls whether front/back faces of a mesh are culled. The front face winding determines whether a clockwise or counterclockwise-oriented face in a mesh is considered front facing.

--HG--
branch : minor
2017-12-09 23:34:08 -04:00
Alex Szpakowski e099e57052 Cleaned up some internal love.graphics code.
--HG--
branch : minor
2017-12-03 23:04:40 -04:00
Alex Szpakowski cbcb1a8606 Allow a depth/stencil canvas to be active without a color canvas.
--HG--
branch : minor
2017-12-03 19:33:48 -04:00
Alex Szpakowski b8c4b07edf Clean up unused temporary Canvases after a few frames.
--HG--
branch : minor
2017-11-13 19:45:18 -04:00
Alex Szpakowski 7f88037d94 Move the implementation for Graphics::flushStreamDraws out of the opengl backend
--HG--
branch : minor
2017-10-26 21:05:15 -03:00
Alex Szpakowski e3fd489373 Abstracted lower level drawing code, moved all type-specific drawing code out of opengl backend, deleted obsolete files
--HG--
branch : minor
2017-10-26 20:58:19 -03:00
Alex Szpakowski 15cc540e4c Make internal vertex attribute code less OpenGL-specific.
--HG--
branch : minor
2017-10-25 23:12:39 -03:00
Alex Szpakowski 7a2e52b12d Cleaned up some vertex data-related code.
--HG--
branch : minor
2017-10-22 12:33:47 -03:00
Alex Szpakowski e5b0d96b27 Restructured some Shader code. Added runtime temporary caching and sharing of shader stages. Resolves issue #1235.
--HG--
branch : minor
2017-10-21 03:08:18 -03:00
Alex Szpakowski 8068b0f1d4 Add variant of love.graphics.captureScreenshot which takes a Channel argument.
--HG--
branch : minor
2017-09-30 10:25:14 -03:00
Alex Szpakowski 844900db39 Rename all cases of 'pixel density' to 'DPI scale' in love's APIs.
--HG--
branch : minor
2017-09-24 16:09:05 -03:00
Alex Szpakowski b4f8f08b70 Enable (when available) and improve performance of persistently mapped buffer path for the vertex/index buffers used with automatic batching.
--HG--
branch : minor
2017-09-03 18:23:54 -03:00
Alex Szpakowski de28c6e6a8 Add the ability to have formally deprecated functions.
Functions which are deprecated will print out a message and show up in a small dialog on-screen, when they're first called. Deprecation output is disabled in fused mode by default, and can be modified with love.setDeprecationOutput(enable).

--HG--
branch : minor
2017-08-27 13:46:31 -03:00
Alex Szpakowski b3d4443f9d Added 'drawcallsbatched' field to the table returned by love.graphics.getStats.
It has the number of draw calls that were saved by auto-batching.

--HG--
branch : minor
2017-07-23 01:58:25 -03:00
Alex Szpakowski 864147c38c love.graphics: move more platform-independent code out of the opengl backend
--HG--
branch : minor
2017-07-22 23:34:39 -03:00
Alex Szpakowski 025201d0c2 Hopefully work around Array Texture intel GMA driver bug on windows (resolves issue #1265).
--HG--
branch : minor
2017-07-09 17:31:07 -03:00
Alex Szpakowski 34f25bd6c8 ESSL: always enable standard derivative functionality (dFdx, dFdy, fwidth) when available. Added 'shaderderivatives' graphics feature enum.
--HG--
branch : minor
2017-07-09 16:55:21 -03:00
Alex Szpakowski 54a049e206 Restructured internal code for graphics capabilities. Added love.graphics.getTextureTypes which returns a table of Texture Type to boolean supported fields.
--HG--
branch : minor
2017-06-27 22:26:30 -03:00
Alex Szpakowski 45de7cebb6 Cleaned up some graphics code.
--HG--
branch : minor
2017-06-10 15:09:33 -03:00
Alex Szpakowski 9fe81ad922 Allow a temporary/internal depth buffer to be used when a Canvas is active, similar to how temporary stencil buffers are allowed.
Syntax is setCanvas{canvas [, depth=true, stencil=true]} or setCanvas{canvas, depthstencil=true}.

--HG--
branch : minor
2017-06-10 14:25:22 -03:00
Alex Szpakowski 30a63b6642 Fix crashes on OpenGL ES (thanks xenthral!)
--HG--
branch : minor
2017-06-08 21:10:17 -03:00
Alex Szpakowski e03c763215 Fix love.graphics.drawLayer.
--HG--
branch : minor
2017-05-20 15:37:29 -03:00
Alex Szpakowski b019a4a64c Cleaned up texture VRAM usage tracking.
--HG--
branch : minor
2017-05-06 23:56:10 -03: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 70b32c47ce Error if a non-2D/affine matrix is used with auto-batched draws, since they perform CPU-side matrix transforms on 2-component vectors.
--HG--
branch : minor
2017-04-23 00:12:57 -03:00
Alex Szpakowski 7161d600b7 Add mipmapping support to Canvases.
- Added an optional mipmap index argument to the non-table variant of love.graphics.setCanvas, and an optional ‘mipmap’ field to the table variant.
- Canvas:setMipmapFilter now works.
- Added Canvas:generateMipmaps.
- Added Canvas:getMipmapMode.
- Added a new ‘mipmaps’ enum field to the table passed into love.graphics.newCanvas. Accepted values are “none” (default), “manual”, and “auto”.

If a Canvas has the manual mipmap mode, you will either need to render to a mipmap level or call Canvas:generateMipmaps. If it has the auto mode, mipmaps will be automatically generated after rendering to that Canvas. Generating mipmaps is not free.

--HG--
branch : minor
2017-04-15 01:58:03 -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 0001b4695e Add new variants of love.graphics.clear for controlling how the depth and stencil buffers are cleared.
- Add love.graphics.clear(r, g, b, a [, stencilvalue, depthvalue]).
- Add love.graphics.clear(color1, color2, …, [, stencilvalue, depthvalue]).
- Add love.graphics.clear(false, stencilvalue, depthvalue).

stencilvalue and depthvalue are either true, false, or a number. True is the default behaviour and clears that buffer to the default value (0 for stencil, 1 for depth), false prevents clearing.

The third variant listed above only clears the depth and/or stencil buffers and not the color buffer.

--HG--
branch : minor
2017-04-11 22:32:40 -03:00
Alex Szpakowski 43172bd3f6 Add optional ‘readable’ boolean field to the table passed into love.graphics.newCanvas. Added new variant of love.graphics.getCanvasFormats which takes a ‘readable’ boolean.
--HG--
branch : minor
2017-04-11 19:03:13 -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 ceb9cd1c0b Rename internal “GLSLES” references to “ESSL”.
--HG--
branch : minor
2017-03-07 21:03:23 -04:00
Alex Szpakowski cb9aa857d7 Don’t try to create the standard/default array texture shader if array textures are not supported.
--HG--
branch : minor
2017-03-01 21:19:37 -04:00