Commit Graph

24 Commits

Author SHA1 Message Date
niki dcea056fcb vulkan: properly implement samplers 2022-08-01 18:51:09 +02:00
niki 224b9e84f0 vulkan: add support for 2d array textures 2022-08-01 15:53:31 +02:00
niki 8cf7a79657 vulkan: add missing layout transitions 2022-07-31 23:56:03 +02:00
niki 4686de8ebd vulkan: implement copy Texture <-> buffer methods 2022-07-30 02:17:58 +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 94c58e1599 vulkan: fix video rendering 2022-07-30 00:26:49 +02:00
niki 1096b76054 vulkan: fix clean up
We now don't do any more greedy waiting when destroying vulkan objects.
2022-07-29 22:59:15 +02:00
niki 524e011133 vulkan: make Texture::uploadByteData async
Before this commit we would greedily wait for the upload to be complete
before exiting the function. This is of course not correct, since
we might be changing data that is still being used in a render in
flight. Of course we also need to cleanup the resources asynchronously
after the frame has been rendered fully.
2022-07-29 22:35:35 +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 6d7bd645fc vulkan: use vkCmdClearColorImage to clear texture
using the vulkan functionality probably leads to less bugs.
Until now it was assumed that any image was in the rgba8 format,
which is of course not correct. Clearing a texture to white or black
should now work for any format.
2022-07-24 13:43:48 +02:00
niki ac9d8ec2a0 vulkan: fix canvas rendering
Sometimes canvas commands wouldn't get executed.
This was because when the window gets resized,
the command buffers would get recreated, and would thus
lose the recorded commands.
2022-07-16 15:55:48 +02:00
niki 95952c691d vulkan: implement setRenderTargetsInternal
basic usage of canvases now works.
Colors probably aren't correct yet.
2022-07-15 01:44:07 +02:00
niki 0ae81091d1 vulkan: use dynamic rendering
This vulkan 1.3 feature will make the code simpler when dealing
with off screen render targets (i.e. löve canvases)
2022-07-14 18:01:46 +02:00
niki 9d04ec0030 vulkan: fix all memory leaks
Now now errors regarding resource management appear in the debug output / validation layers.
2022-07-11 13:58:35 +02:00
niki c5327bfc4f vulkan: fix some more memory leaks 2022-07-11 01:47:34 +02:00
niki 0759e8d513 vulkan: fix some memory leaks 2022-07-11 01:13:50 +02:00
niki b1fb5b551e working text rendering 2022-07-10 02:25:28 +02:00
niki 0cea07806f use different uniform buffers for each draw call 2022-06-30 18:42:49 +02:00
niki 7f894e5bf7 some work on drawQuads (not fully working yet) 2022-06-25 23:02:13 +02:00
niki acf0474cc8 Implement drawing very basic textures
With this commit you can draw very simple textures.
The following code will showcase it:

```lua
function love.run()
    local data = love.image.newImageData(40, 40)
    for i = 0,39 do
        for j=0,39 do
            if i <= 20 then
                if j <= 20 then
                    data:setPixel(i, j, 1, 0, 0, 1)
                else
                    data:setPixel(i, j, 0, 1, 0, 1)
                end
            else
                if j <= 20 then
                    data:setPixel(i, j, 0, 0, 1, 1)
                else
                    data:setPixel(i, j, 1, 1, 1, 1)
                end
            end
        end
    end

    local texture
    texture = love.graphics.newTexture(data)

    return function()
        love.event.pump()
        for name, a,b,c,d,e,f in love.event.poll() do
            if name == "quit" then
                if not love.quit or not love.quit() then
                    return a or 0
                end
            end
            love.handlers[name](a,b,c,d,e,f)
        end

        love.graphics.origin()
        love.graphics.clear()

        love.graphics.draw(texture, 50, 500)

        love.graphics.present()
    end
end
```
2022-06-11 20:33:44 +02:00
niki c16c07780f use default texture when rendering primitives 2022-05-08 22:44:32 +02:00
niki 4e8304255d first draft of vulkan texture impl 2022-05-06 16:06:09 +02:00
niki 8f55f093a4 partially implement initCapabilities for vulkan 2022-05-04 23:43:23 +02:00
niki 77f1af598d add skeleton for vulkan texture impl 2022-05-03 18:11:31 +02:00