Commit Graph

40 Commits

Author SHA1 Message Date
niki e08ade86b5 vulkan: simplify shader code slightly 2023-07-25 16:26:26 +02:00
niki 332b456131 vulkan: remove getDefaultTexture 2023-07-18 13:54:06 +02:00
Sasha Szpakowski f6cdbdc868 Merge branch 'main' into 12.0-development 2022-12-31 22:46:34 -04:00
niki 8694c44207 vulkan: fix incorrect textures in shader uniforms 2022-12-24 22:37:58 +01:00
niki 30bdb03f3b vulkan: code styling 2022-12-21 17:20:13 +01:00
slime 95bfd948ca vulkan: move StreamBuffer frame management to StreamBuffer implementation
Fixes crashes with lots of auto-batched draws in a frame.
2022-09-25 17:40:53 -03:00
niki 40ff636d6c vulkan: fix c++11 compatibility 2022-09-18 16:50:12 +02:00
niki cf099946a1 vulkan: fix depth stencil textures 2022-09-18 00:18:32 +02:00
niki ccf8cb45c9 vulkan: implement storage and texel buffers 2022-09-16 00:30:26 +02:00
niki f4c38eb00a Revert "vulkan: use push constants for builtin uniforms"
This reverts commit 47e3fc85d2.
2022-09-15 15:55:47 +02:00
niki 47e3fc85d2 vulkan: use push constants for builtin uniforms
when available
2022-09-15 15:17:06 +02:00
niki ef80e11b4d vulkan: add support for uniform texture arrays 2022-09-11 13:02:38 +02:00
niki 294761713f vulkan: fix bug: incorrect uniform values 2022-09-11 04:20:45 +02:00
niki 1658c89f3d vulkan: add support for custom depth/stencil tex 2022-09-11 01:57:23 +02:00
niki a93d153792 vulkan: adjust code styling 2022-09-10 17:40:46 +02:00
niki 57207606c0 vulkan: implement Shader::getVertexAttributeIndex 2022-09-10 15:27:45 +02:00
niki 9025631231 vulkan: modify descriptor set allocation
Setting the size of each descriptor pool to one
was a hack introduced to make the code work on android.
Changing the code to now allocate all descriptor sets at once
should fix the previous crash.
Not tested yet.
2022-09-09 12:02:30 +02:00
nikeinikei adc02a4939 vulkan: optionally use VK_KHR_PUSH_DESCRIPTOR 2022-09-01 15:01:40 +02:00
niki a0ee9f7b9b vulkan: implement compute shaders
A lot of stuff probably isn't implemented yet, however the
following code already works:

```lua
local shader = love.graphics.newComputeShader [[
    layout (local_size_x = 1, local_size_y = 1) in;

    layout(r32f) uniform highp image2D out_tex;

    uniform float time;

    void computemain() {
        imageStore(out_tex, ivec2(love_GlobalThreadID.xy), vec4(time, 1.0, 1.0, 1.0));
    }
]]

local tex = love.graphics.newTexture(64, 64, {computewrite = true,format = "r32f"})

function love.draw()
    shader:send("out_tex", tex)
    shader:send("time", love.timer.getTime() % 1)
    love.graphics.dispatchThreadgroups(shader, 64, 64, 1)

    love.graphics.print("compute shader test")
    love.graphics.draw(tex, 25, 25)
end
```
2022-08-31 02:07:46 +02:00
niki a577be8a6d vulkan: fix a few bugs in Shader 2022-08-23 01:38:47 +02:00
niki 23666b1fde vulkan: fix android build
It compiles now, but it's not working correctly yet
2022-08-20 19:38:59 +02:00
niki be8778b4eb vulkan: remove dep on VK_KHR_push_descriptor
It's not sure if this extension is supported everywhere
This commit uses normal descriptor pools, sets and writes,
which are all availabel in base vulkan.
2022-08-19 16:44:59 +02:00
niki bc0b5f81f5 vulkan: uniforms in custom shaders
things like `uniform float time;` or `uniform sampler2D tex` now work
2022-08-14 22:15:24 +02:00
niki 84df8fee03 vulkan: fix video rendering
When rewriting the shader part rendering videos was broken.
This commit fixes that again.
2022-08-14 20:45:57 +02:00
niki f9ad1842b5 vulkan: first iteration for generic uniforms
Until now we only considered the builtin uniform variables.
This commit attempts to make the code in the vulkan Shader
implementation more general, as to allow for custom uniforms.
This is not possible yet, but should be easier to implement now.
2022-08-14 04:56:20 +02:00
niki 1647f6c9c2 vulkan: remove unnecessary quadindex code 2022-08-01 19:30:08 +02:00
niki 845fd16b4b vulkan: dynamically increase size of available memory for uniforms 2022-07-31 03:31:35 +02:00
niki 7bbc042fce vulkan: remove redundant tabs
this makes reading the source files easier
and is more in line with the rest of the löve codebase
2022-07-30 01:16:56 +02:00
niki 7a3e9ed71e vulkan: fix uniform buffer descriptor
There was a bug where the count of used builtin uniform buffer objects
was not advanced. This caused another problem since vulkan requires
a certain alignment for the buffer. This commit fixes both of those
things.
2022-07-29 21:04:35 +02:00
niki fb6457f57d vulkan: move descriptor set logic into Shader
Using the extension VK_KHR_push_descriptor makes the code a lot easier.
Using it makes us able to set set descriptor sets dynamically.
2022-07-19 02:36:02 +02:00
niki 00974b5820 vulkan: move shader compilation into Shader 2022-07-18 22:28:41 +02:00
niki 6916182a79 vulkan: implement getAPIStats 2022-07-16 23:46:03 +02:00
niki 4c33d0aa36 vulkan: fix Shader::attach() 2022-07-16 17:52:29 +02:00
niki 0834408b90 vulkan: implement draw(DrawCommand)
Now love.graphics.point and love.graphics.line works
2022-07-13 13:56:00 +02:00
niki c996860602 Use löve's uniform data object for vulkan shader 2022-06-13 16:50:12 +02:00
niki 8f55f093a4 partially implement initCapabilities for vulkan 2022-05-04 23:43:23 +02:00
niki 158052c52c implement basic per frame uniform variables 2022-03-22 14:31:50 +01:00
niki 197dfb9738 start implementing vulkan Shader type 2022-02-06 22:56:24 +01:00
niki 1267f2a7bb make vulkan::Shder non abstract 2022-02-04 23:48:36 +01:00
niki 65074dae15 hello world triangle 2022-02-04 23:45:58 +01:00