mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-07-03 08:19:17 +00:00
Compare commits
2 Commits
993bf1db53
...
e4f609e421
Author | SHA1 | Date | |
---|---|---|---|
|
e4f609e421 | ||
|
a6ba64bbc4 |
|
@ -172,6 +172,40 @@ simple_clients = [
|
|||
},
|
||||
]
|
||||
|
||||
dep_vulkan = dependency('vulkan', required: false)
|
||||
prog_glslang = find_program('glslangValidator', required : false)
|
||||
|
||||
if dep_vulkan.found() and prog_glslang.found()
|
||||
gen = generator(prog_glslang, output : '@PLAINNAME@.spv.h',
|
||||
arguments : [ '@INPUT@', '--quiet', '-V', '-x', '-o', '@OUTPUT@' ] )
|
||||
spirv_files = gen.process('simple-vulkan.vert', 'simple-vulkan.frag')
|
||||
|
||||
simple_clients += {
|
||||
'name': 'vulkan',
|
||||
'sources': [
|
||||
'simple-vulkan.c',
|
||||
spirv_files,
|
||||
fractional_scale_v1_client_protocol_h,
|
||||
fractional_scale_v1_protocol_c,
|
||||
tearing_control_v1_client_protocol_h,
|
||||
tearing_control_v1_protocol_c,
|
||||
viewporter_client_protocol_h,
|
||||
viewporter_protocol_c,
|
||||
xdg_shell_client_protocol_h,
|
||||
xdg_shell_protocol_c,
|
||||
],
|
||||
'dep_objs': [
|
||||
dep_vulkan,
|
||||
dep_libm,
|
||||
dep_libshared,
|
||||
dep_matrix_c,
|
||||
dep_wayland_client,
|
||||
],
|
||||
'deps': [ 'vulkan', 'wayland-cursor' ],
|
||||
'options': [ 'renderer-gl' ]
|
||||
}
|
||||
endif
|
||||
|
||||
foreach t : simple_clients
|
||||
if simple_build_all or simple_clients_enabled.contains(t.get('name'))
|
||||
t_name = 'weston-simple-' + t.get('name')
|
||||
|
|
1866
clients/simple-vulkan.c
Normal file
1866
clients/simple-vulkan.c
Normal file
File diff suppressed because it is too large
Load Diff
9
clients/simple-vulkan.frag
Normal file
9
clients/simple-vulkan.frag
Normal file
|
@ -0,0 +1,9 @@
|
|||
#version 420 core
|
||||
|
||||
layout(location = 0) in vec4 vVaryingColor;
|
||||
layout(location = 0) out vec4 f_color;
|
||||
|
||||
void main()
|
||||
{
|
||||
f_color = vVaryingColor;
|
||||
}
|
17
clients/simple-vulkan.vert
Normal file
17
clients/simple-vulkan.vert
Normal file
|
@ -0,0 +1,17 @@
|
|||
#version 420 core
|
||||
|
||||
layout(std140, set = 0, binding = 0) uniform block {
|
||||
uniform mat4 rotation;
|
||||
};
|
||||
|
||||
layout(location = 0) in vec4 in_position;
|
||||
layout(location = 1) in vec4 in_color;
|
||||
|
||||
layout(location = 0) out vec4 vVaryingColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = rotation * in_position;
|
||||
gl_Position.z = 0.0; // Hack to avoid negative z clipping, is there a better way to do this?
|
||||
vVaryingColor = vec4(in_color.rgba);
|
||||
}
|
Loading…
Reference in New Issue
Block a user