Commit Graph

106 Commits

Author SHA1 Message Date
niki f01457a610 vulkan: remove internal Shader::attach call
Shader::attach() should not be called internally
by a graphics backend.
2023-01-27 14:10:19 +01:00
niki a2466a4a1b vulkan: use temporary pipeline cache 2023-01-22 00:17:42 +01:00
niki 7e7d2884c8 vulkan: fix shader crash 2023-01-09 16:37:12 +01: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 ccca355664 vulkan: fix love.window.setVsync 2022-12-22 01:27:05 +01:00
niki 30bdb03f3b vulkan: code styling 2022-12-21 17:20:13 +01:00
niki 97a7042143 vulkan: remove instanceVersion class member
This is not actually needed. The api version specified when creating
the vulkan instance should be the highest api version that might
be used by the application, which can be higher than the supported
instance version. VMA can make use of vulkan 1.3 features so this
can be hardcoded to VK_API_VERSION_1_3.
2022-11-12 03:24:07 +01:00
niki f4bdc57fb3 vulkan: keep track of device/instance api version 2022-10-16 03:33:09 +02:00
niki a95ff597d5 vulkan: remove unnecessary code
Since we supply the vulkan headers ourselves
we can be sure that all the definitions used are there.
2022-10-06 01:18:27 +02: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 58c801be58 vulkan: fix incorrect samplers 2022-09-19 19:51:48 +02:00
niki ba759f5bc0 vulkan: use SamplerState::toKey for caching 2022-09-19 14:23:46 +02:00
niki 40ff636d6c vulkan: fix c++11 compatibility 2022-09-18 16:50:12 +02:00
niki 9af9bb5bd5 vulkan: keep track of window stencil buffer 2022-09-18 14:16:42 +02:00
niki bf6915ae73 vulkan: garbage collect unused objects 2022-09-18 02:57:29 +02:00
niki cf099946a1 vulkan: fix depth stencil textures 2022-09-18 00:18:32 +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 d1da47dbf0 vulkan: implement screenshots 2022-09-14 17:31:53 +02:00
niki 4e59b563a4 vulkan: implement texture msaa 2022-09-14 14:15:57 +02:00
niki 7866dde319 vulkan: use sdl to dynamically load vulkan 2022-09-14 13:31:09 +02:00
niki 46598480c4 vulkan: try fix github actions linux build 2022-09-13 14:34:11 +02:00
niki 6a2d1a9edd vulkan: use dynamic loading
If Vulkan ist not available on a system the program will still run,
and it will fallback to opengl.
2022-09-13 14:11:24 +02:00
niki fb44ddb546 vulkan: document change in changes.txt 2022-09-13 13:09:57 +02:00
niki faeca1c4bc vulkan: fix wrong image layout validation warnings 2022-09-12 13:46:03 +02:00
niki 76199688f6 vulkan: implement discard 2022-09-11 17:09:38 +02:00
niki fd951909c0 vulkan: add more optional extensions
VK_KHR_dedicated_allocation, VK_KHR_buffer_device_address,
and VK_EXT_memory_budget can get used by VMA.
VK_KHR_spirv_1_4 can get used by the Shader.

VK_KHR_spirv_1_4 depends on VK_KHR_shader_float_controls.
VK_KHR_dedicated_allocation depends on VK_KHR_get_memory_requirements2
2022-09-11 15:03:40 +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 816e3f01a2 vulkan: correctly order gpu commands 2022-09-10 19:21:31 +02:00
niki a93d153792 vulkan: adjust code styling 2022-09-10 17:40:46 +02:00
niki 8807c3dd37 vulkan: fix case where msaa = 1 2022-09-09 23:14:44 +02:00
nikeinikei adc02a4939 vulkan: optionally use VK_KHR_PUSH_DESCRIPTOR 2022-09-01 15:01:40 +02:00
niki 7185d7356f vulkan: fix enabling extensions 2022-08-31 19:50:03 +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 e409770be1 vulkan: fix some validation warnings 2022-08-30 20:28:18 +02:00
niki ec5a3a50f9 vulkan: implement graphics readback 2022-08-30 17:11:59 +02:00
niki a69d4a38dd vulkan: optionally use extended dynamic state
This should cut down on the number of pipeline permutations
needed when this extension is available.
2022-08-30 03:20:33 +02:00
niki d123021e26 vulkan: fix canvas rendering (on android)
Before this patch, sometimes rendering a texture
on an android device would result in random things
appearing in the canvas, apart from the stuff
that has been drawn properly.
With these changes this does not seem to appear anymore.
2022-08-29 17:43:54 +02:00
niki c5a2e47714 vulkan: implement multi canvas rendering 2022-08-28 03:35:06 +02:00
niki 18221beb25 vulkan: fix canvas rendering on android 2022-08-27 20:58:17 +02:00
niki 77f75648e8 vulkan: default renderpass and framebuffers
Since these objects basically get used every frame
we shouldn't store them in a hashmap with potentially
worse performance.
Instead storing them in member variables should be better.
2022-08-25 18:15:18 +02:00
niki a577be8a6d vulkan: fix a few bugs in Shader 2022-08-23 01:38:47 +02:00
niki a08395e12d vulkan: implement msaa 2022-08-22 23:09:21 +02:00
niki 62148790a8 vulkan: fix scissor on android 2022-08-22 17:40:27 +02:00
niki 7cc6ed40be vulkan: implement depth and stencil 2022-08-21 17:42:39 +02:00
niki 665614b9b9 vulkan: fix crash when recreating swapchain 2022-08-20 21:33:09 +02:00
niki 5f2fdc0dd0 vulkan: android: fix display orientation 2022-08-20 21:03:49 +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