Resolves#1879.
- Add an 'indirectdraw' boolean field to the graphics feature support table returned by love.graphics.getSupported. This is almost always supported when compute shaders are supported, except on a few older phones.
- Add an 'indirectarguments' boolean field to the settings table in love.graphics.newBuffer.
- Add love.graphics.dispatchIndirect(shader, argumentsbuffer [, argumentsindex = 1]).
The compute dispatch's threadgroup width, height, and depth values are fetched from the buffer (as 3 uints) instead of coming from function parameters.
- Add love.graphics.drawIndirect(mesh, argumentsbuffer, argumentsindex, x, y, ....).
Vertex or index count, instance count, and other related parameters for drawing the mesh are fetched from the buffer (as 4 or 5 uints depending on whether the mesh has an index buffer) instead of coming from function parameters. It's usually a good idea to keep parameters other than the instance count in sync with what the mesh should be using.
- Add love.graphics.drawFromShaderIndirect(drawmode, argumentsbuffer [, argumentsindex = 1] [, maintexture = nil]) and drawFromShaderIndirect(indexbuffer, argumentsbuffer [, argumentsindex] [, maintexture = nil]).
Vertex or index count, instance count, and other related parameters are fetched from the buffer as 4 or 5 uints, as above.
For the dispatch indirect arguments buffer, it has to have 3 uint32 elements: { uint threadgroupsX, uint threadgroupsY, uint threadgroupsZ }.
For non-indexed draws, the arguments buffer has to have 4 uint32 elements: { uint vertexCount, uint instanceCount, uint baseVertex, uint baseInstance }. Note that baseInstance should always be set to 0 as many drivers don't support non-zero values.
For draws which use an index buffer, the arguments buffer has to have 5 uint32 elements: { uint indexCount, uint instanceCount, uint firstIndex, uint baseVertex, uint baseInstance }. As above, the baseInstance value should always be 0.
A buffer can be created to have an array of those structures, which can be used with the argumentsindex parameter of the Indirect dispatch/draw functions.
When creating a texture with user-specified mipmaps, it no longer errors if all mipmaps down to 1x1 aren't present.
Added a 'mipmapcount' field to the settings table in newImage and friends (only used when mipmaps are enabled for the texture.) If it's set, only mipmap levels up to the specified count will be created instead of always creating the full range.
Old OpenGL ES 2 devices don't support loading a mipmapped texture without the full mipmap range, so there's a new 'mipmaprange' boolean field in the table returned by love.graphics.getSupported.
Previously it would discard them, which needed the user to call love.graphics.clear afterward to get them into a valid state.
The current code has suboptimal performance if the user still calls clear after setCanvas (a common situation), so more optimizations will probably be needed.
Fixes#1843.
This a significant refactor / rewrite of much of the love.graphics Font code.
Text positioning is now split into TextShaper classes in the love.font module. This isn't exposed to users yet.
BMFonts and ImageFonts use the same text shaping as before (in the new TextShaper API). Fonts loaded via FreeType now use Harfbuzz for text shaping.
The new code isn't at feature-parity with the old code yet. Harfbuzz-based text shaping enables kerning support in more fonts, character combining into ligature glyphs, and directions other than left-to-right (this isn't supported in love yet).
The only field currently read from the table is 'defines', which can contain either an array of define names, or name-value pairs.
For example: newShader(file, {defines={"MYFEATURE_ENABLED", MYSETTING=1}})
Fixes#1577
- 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.
- Added love.graphics.setOrthoProjection.
- Added love.graphics.setPerspectiveProjection.
- Added love.graphics.resetProjection.
Note that the projection is reset whenever the canvas changes.
- 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.
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.
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.