Commit Graph

65 Commits

Author SHA1 Message Date
niki dcea056fcb vulkan: properly implement samplers 2022-08-01 18:51:09 +02:00
niki 7bbc2888e2 vulkan: remove unnecessary recreation on resize 2022-08-01 17:38:23 +02:00
niki 98ebdd7871 vulkan: fix wireframe validation error 2022-08-01 16:07:37 +02:00
niki 224b9e84f0 vulkan: add support for 2d array textures 2022-08-01 15:53:31 +02:00
niki 29dcf3e8c0 vulkan: use hashing to determine pipeline
Until now we did a linear search in a vector to find the cashed
pipeline given a certain configuration. This is of course not a very
efficient way. This commit now uses a hashmap which should still be
fast even when there are a lot of pipelines already created.
2022-07-31 01:42:48 +02:00
niki ad8243f257 vulkan: implement Buffer::copyTo 2022-07-30 01:41:37 +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 506cf8c210 vulkan: fix colors 2022-07-30 00:48:46 +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 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 a544d51c22 vulkan: implement instanced draw 2022-07-17 00:28:41 +02:00
niki 6916182a79 vulkan: implement getAPIStats 2022-07-16 23:46:03 +02:00
niki 913aab0226 vulkan: implement setActive 2022-07-16 23:27:54 +02:00
niki 9b7cfef5ef vulkan: implement setScissor 2022-07-16 23:19:24 +02:00
niki 974c50c751 vulkan: partially implement clear
Only works for color attachments for now.
2022-07-16 21:45:27 +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 38f15ae97d vulkan: implement cull and winding 2022-07-13 17:27:11 +02:00
niki c6d79ae87e vulkan: implement setColorMask 2022-07-13 16:50:28 +02:00
niki a591b2b99e vulkan: implement setBlendState 2022-07-13 16:37:16 +02:00
niki 04fb789649 vulkan: implement setPointSize 2022-07-13 16:05:12 +02:00
niki 4190807a20 vulkan: implement setWireframe 2022-07-13 15:55:14 +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 14b8abeef5 vulkan: implement setColor 2022-07-11 17:17:32 +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 7fe2a2d821 vulkan: fix vertex format 2022-07-10 22:52:03 +02:00
niki ef08282f0d vulkan: implement getRendererInfo 2022-07-10 19:13:10 +02:00
niki b1fb5b551e working text rendering 2022-07-10 02:25:28 +02:00
niki 73348e5012 enable alpha blending 2022-07-01 13:43:51 +02:00
niki 2a65ea5fb1 cleanup some debug code 2022-06-30 20:16:40 +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 efdc2b8ee2 fix crash on exit 2022-06-16 02:25:55 +02:00
niki b5ba2b65b5 stop hardcoding vulkan vertex layouts 2022-06-16 01:16:23 +02:00
niki 2bf7c35220 use constant color for VertexColor 2022-06-14 23:30:51 +02:00
niki c996860602 Use löve's uniform data object for vulkan shader 2022-06-13 16:50:12 +02:00
niki 3a4058d750 allow drawing more than one texture 2022-06-12 02:00:30 +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 d0aaddfef6 cleanup redundant initialization code 2022-05-08 22:51:11 +02:00
niki c16c07780f use default texture when rendering primitives 2022-05-08 22:44:32 +02:00
niki 75a6bc9b5d Merge remote-tracking branch 'origin/12.0-development' into vulkan 2022-05-06 16:46:55 +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