Commit Graph

29 Commits

Author SHA1 Message Date
Sasha Szpakowski 78f8cfc4dc Add Shader:getBufferFormat.
Returns a table with the same setup as the data format table used with love.graphics.newBuffer.
2024-06-16 17:07:34 -03: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 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 dbcdbc47d5 Add debugname field to shader options table. 2023-12-29 16:51:24 +01:00
Sasha Szpakowski f6cdbdc868 Merge branch 'main' into 12.0-development 2022-12-31 22:46:34 -04:00
Sasha Szpakowski 0b75f6cfa5 Missed some files... 2022-12-31 22:36:48 -04:00
Alex Szpakowski 7f3538d2ba Merge branch 'main' into 12.0-development 2022-01-05 21:10:27 -04:00
Alex Szpakowski 041aa2fc23 Revert Shader:send to cause a Lua error instead of returning false,
if the given variable doesn't exist or is optimized out in the shader.
2021-11-06 10:43:43 -03:00
Alex Szpakowski a551fcd492 Initial support for writing to textures in compute shaders. 2021-08-13 14:43:03 -03:00
bjorn b28e61d00d Shader:getLocalThreadgroupSize; 2021-07-17 19:54:54 -07:00
bjorn a1c79c45d8 Shader:hasStage; 2021-07-17 19:38:46 -07:00
Alex Szpakowski 9b4aea8f17 Missed some copyright date updates 2021-04-07 20:34:24 -03:00
Alex Szpakowski 50ff86bd92 Graphics Buffers can be used as Shader Storage Buffers. 2021-01-10 17:53:12 -04:00
Alex Szpakowski b011487a3e Add new texel buffer type.
GLSL 3+ shaders can read from texel buffers by declaring a uniform samplerBuffer variable and calling texelFetch with a 0-based index, in the shader code. All attributes in a texel buffer's format array must have the same data format (e.g. all 'floatvec4' formats).

Shader:send accepts a texel Buffer for samplerBuffer uniforms.

Added 'texelbuffer' to love.graphics.getSupported (requires GLSL 3+ and desktop OpenGL).
Added 'texelbuffersize' to love.graphics.getSystemLimits. Returns the max number of values in a texel buffer (array length multiplied by the number of attributes declared in the buffer's format array).
2020-07-28 20:44:36 -03:00
Alex Szpakowski f848b201ae Merge branch 'master' into 12.0-development 2020-07-18 21:29:36 -03:00
Alex Szpakowski 50eeed7bb1 Fix Shader:send's Data variant when a matrix layout arg is used.
Also add a second more consistent Data+matrix layout variant of Shader:send which matches the argument order of the table+matrix layout variant - Shader:send(name, matrixlayout, data, ...).
2020-07-10 22:52:23 -03:00
Alex Szpakowski b95788c104 Shader:send now returns false if the uniform doesn't exist
It also returns false if the uniform exists but was optimized out by the shader compiler. Previously it would cause a Lua error in both situations.
2020-02-27 20:19:55 -04:00
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04: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 6dea2ab714 Clamp all color arguments to [0, 1] in cases where values outside that range don't make sense (fixed-point color values & sRGB colors). Closes issue #1315.
--HG--
branch : minor
2017-11-21 19:49:52 -04:00
Bart van Strien 9e4374935d Show (short) list of possible enum values when an invalid value is encountered (resolves #1318)
All enum errors have (hopefully) been changed to a luax_enumerror, which has a
fixed error message. If additionally a list of valid options is passed, it
lists that in the error message. For every enum error with few options I've
implemented this using a getConstants call.

This solution has been designed specifically to reduce the number of template
instantiations (as I've been told that was a concern). All new template code
happens in places where there already was an instantiation of the relevant
StringMap. Of course there is still std::vector<std::string>...

--HG--
branch : minor
2017-10-02 17:11:53 +02:00
Alex Szpakowski 5f64737956 Shader:send now optionally accepts a Data object (with optional byte offset and size parameters). Resolves issue #1343.
Also changed the optional 'columnMajor' argument of the matrix variant of Shader:send and Transform:setMatrix to accept enum constants instead. Valid values are "row" and "column".

--HG--
branch : minor
2017-09-23 19:47:57 -03:00
Alex Szpakowski fee157b6b9 Functions that take a boolean argument now properly type-check for it.
--HG--
branch : minor
2017-08-14 22:56:20 -03:00
Alex Szpakowski 73fd45558b Implement Array, Cubemap, and Volume texture types (issue #1111).
- Add love.graphics.newArrayImage, newCubeImage, and newVolumeImage.
- Add love.graphics.newCanvas(w, h, layers) and newCanvas(w, h, layers, settings). Add ‘type’ field to the settings table of newCanvas.

- Add new love.graphics.setCanvas variants: setCanvas(canvas, slice), and setCanvas(canvastable) where canvastable is in the format: {{canvas1, layer=2}, {canvas2, face=5}}

- Add Texture:getTextureType, getDepth, getLayerCount, getMipmapCount, and getFormat.

- Remove Image:getData and Image:refresh.
- Add Image:replacePixels(imagedata [, slice] [, mipmap]).

- Update Canvas:newImageData to accept a slice argument.

- Add love.image.newCubeFaces(imagedata).

--HG--
branch : minor
2017-02-20 14:58:13 -04:00
Alex Szpakowski 8899c03651 Add C++ side support for unsigned int shader uniforms. Note that the shader languages love currently supports (glsl 1.20, glsl es 1.00) don’t support uints at the moment.
--HG--
branch : minor
2017-01-02 20:41:07 -04:00
Alex Szpakowski abb72cb813 Happy new year! 🥂
--HG--
branch : minor
2017-01-02 01:28:29 -04:00
Alex Szpakowski f12596dd19 More code restructuring.
Move all love.graphics functionality that doesn’t call OpenGL out of the OpenGL backend Graphics class.

--HG--
branch : minor
2016-12-30 18:36:54 -04:00