mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-08 13:29:45 -05:00
render/vulkan: add Vulkan renderer
This new renderer is implemented with the existing wlr_renderer API (which is known to be sub-optimal for some operations). It's not used by default, but users can opt-in by setting WLR_RENDERER=vulkan. The renderer depends on VK_EXT_image_drm_format_modifier and VK_EXT_physical_device_drm. Co-authored-by: Simon Ser <contact@emersion.fr> Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
This commit is contained in:
parent
2edf468aeb
commit
8e34692250
21 changed files with 3704 additions and 2 deletions
25
render/vulkan/shaders/common.vert
Normal file
25
render/vulkan/shaders/common.vert
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#version 450
|
||||
|
||||
// we use a mat4 since it uses the same size as mat3 due to
|
||||
// alignment. Easier to deal with (tighly-packed) mat4 though.
|
||||
layout(push_constant, row_major) uniform UBO {
|
||||
mat4 proj;
|
||||
vec2 uv_offset;
|
||||
vec2 uv_size;
|
||||
} data;
|
||||
|
||||
layout(location = 0) out vec2 uv;
|
||||
|
||||
// 4 outlining points and uv coords
|
||||
const vec2[] values = {
|
||||
{0, 0},
|
||||
{1, 0},
|
||||
{1, 1},
|
||||
{0, 1},
|
||||
};
|
||||
|
||||
void main() {
|
||||
vec2 pos = values[gl_VertexIndex % 4];
|
||||
uv = data.uv_offset + pos * data.uv_size;
|
||||
gl_Position = data.proj * vec4(pos, 0.0, 1.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue