Skip to content

Commit ff68739

Browse files
committed
make sure to support wlroots-vkfx fork separately
1 parent 16bbb8b commit ff68739

File tree

13 files changed

+35
-22
lines changed

13 files changed

+35
-22
lines changed

config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#mesondefine BUILD_WITH_IMAGEIO
1010
#mesondefine USE_GLES32
1111
#mesondefine WF_HAS_XWAYLAND
12-
#mesondefine WF_HAS_VULKAN
12+
#mesondefine WF_HAS_VULKANFX
1313

1414

1515
#endif /* end of include guard: CONFIG_H */

meson.build

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@ libdl = cpp.find_library('dl')
4545
udev = dependency('libudev')
4646
json = subproject('wf-json', default_options: ['install_header=true']).get_variable('wfjson')
4747

48-
wlroots_base_version = '0.19'
49-
wlroots_dep_name = 'wlroots-' + wlroots_base_version
48+
wlroots_base_version = '0.20'
49+
if get_option('vulkan_effects')
50+
wlroots_dep_name = 'wlroots-vkfx-' + wlroots_base_version
51+
else
52+
wlroots_dep_name = 'wlroots-' + wlroots_base_version
53+
endif
54+
5055
wlroots_min_version = '>=' + wlroots_base_version + '.0'
5156
wlroots_max_version = '<=' + wlroots_base_version + '.99'
5257

@@ -60,7 +65,6 @@ elif get_option('use_system_wlroots').enabled()
6065
wlroots = dependency(wlroots_dep_name, version: [wlroots_min_version, wlroots_max_version], required: true)
6166

6267
elif get_option('use_system_wlroots').auto()
63-
message( 'SEARCHING FOR WLROOTS' )
6468
wlroots = dependency(wlroots_dep_name, version: [wlroots_min_version, wlroots_max_version], required: false)
6569
use_system_wlroots = true
6670
if not wlroots.found()
@@ -195,12 +199,11 @@ else
195199
endif
196200

197201

198-
use_vulkan = vulkan.found() and wlroots_features['vulkan_renderer'] and not get_option('vulkan_effects').disabled()
199-
conf_data.set('WF_SHADER_DIR', join_paths(get_option('prefix'), 'share', 'wayfire', 'shaders'))
202+
use_vulkan = vulkan.found() and wlroots_features['vulkan_renderer'] and get_option('vulkan_effects')
200203
if use_vulkan
201-
conf_data.set('WF_HAS_VULKAN', 1)
204+
conf_data.set('WF_HAS_VULKANFX', 1)
202205
else
203-
conf_data.set('WF_HAS_VULKAN', 0)
206+
conf_data.set('WF_HAS_VULKANFX', 0)
204207
endif
205208

206209
wayfire_conf_inc = include_directories(['.'])
@@ -278,6 +281,7 @@ summary = [
278281
' x11-backend: @0@'.format(wlroots_features['x11_backend']),
279282
' imageio: @0@'.format(conf_data.get('BUILD_WITH_IMAGEIO')),
280283
' gles32: @0@'.format(conf_data.get('USE_GLES32')),
284+
' vulkan effects: @0@'.format(conf_data.get('WF_HAS_VULKANFX')),
281285
' print trace: @0@'.format(print_trace),
282286
' unit tests: @0@'.format(doctest.found()),
283287
'----------------',

meson_options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ option('print_trace', type: 'boolean', value: true, description: 'Print stack tr
88
option('tests', type: 'feature', value: 'auto', description: 'Enable unit tests')
99
option('custom_pch', type: 'boolean', value: false, description: 'Use custom PCH for plugins. May not work with all compilers and setups.')
1010
option('build_locales', type: 'feature', value: 'auto', description: 'Build supported locale translations')
11-
option('vulkan_effects', type: 'feature', value: 'auto', description: 'Build supported Vulkan effects')
11+
option('vulkan_effects', type: 'boolean', value: false, description: 'Build with custom Vulkan effects')

plugins/protocols/input-method-v1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ class wayfire_input_method_v1 : public wf::plugin_interface_t, public wf::text_i
527527
if (enable_text_input_v3)
528528
{
529529
wf::get_core().protocols.text_input = wlr_text_input_manager_v3_create(wf::get_core().display);
530-
on_text_input_v3_created.connect(&wf::get_core().protocols.text_input->events.text_input);
530+
on_text_input_v3_created.connect(&wf::get_core().protocols.text_input->events.new_text_input);
531531
on_text_input_v3_created.set_callback([&] (void *data)
532532
{
533533
handle_text_input_v3_created(static_cast<wlr_text_input_v3*>(data));

plugins/wobbly/wobbly.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,7 @@ class wobbly_render_instance_t :
889889
damage |= self->get_bounding_box();
890890
}
891891

892+
#if WF_HAS_VULKANFX
892893
class vulkan_state_t : public wf::custom_data_t
893894
{
894895
public:
@@ -959,7 +960,6 @@ class wobbly_render_instance_t :
959960
// Try to reuse the vertex buffer if possible, to avoid reallocations.
960961
if (buffer && (buffer->get_size() >= total_size) && (buffer.use_count() == 1))
961962
{
962-
// LOGI("Reuse buffer index ", i);
963963
return buffers[i];
964964
}
965965
}
@@ -969,6 +969,8 @@ class wobbly_render_instance_t :
969969
return buffers[0];
970970
}
971971

972+
#endif
973+
972974
void render(const wf::scene::render_instruction_t& data) override
973975
{
974976
std::vector<float> vert, uv;
@@ -989,6 +991,7 @@ class wobbly_render_instance_t :
989991
}
990992
});
991993

994+
#if WF_HAS_VULKANFX
992995
data.pass->custom_vulkan_subpass([&] (wf::vulkan_render_state_t& state,
993996
wf::vk::command_buffer_t& cmd_buf)
994997
{
@@ -1033,6 +1036,7 @@ class wobbly_render_instance_t :
10331036
vkCmdDraw(cmd_buf, count_triangles * 3, 1, 0, 0);
10341037
});
10351038
});
1039+
#endif
10361040
}
10371041
};
10381042

src/api/wayfire/nonstd/wlroots-full.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern "C"
3636
#include <wlr/render/gles2.h>
3737
#endif
3838

39-
#if WF_HAS_VULKAN
39+
#if WLR_HAS_VULKAN_RENDERER
4040
#include <wlr/render/vulkan.h>
4141
#endif
4242

src/api/wayfire/render.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ class render_pass_t
573573
return false;
574574
}
575575

576-
#if WF_HAS_VULKAN
576+
#if WF_HAS_VULKANFX
577577
template<class F>
578578
bool custom_vulkan_subpass(F&& fn)
579579
{
@@ -591,7 +591,7 @@ class render_pass_t
591591

592592
private:
593593

594-
#if WF_HAS_VULKAN
594+
#if WF_HAS_VULKANFX
595595
vk::command_buffer_t *active_command_buffer = nullptr;
596596
vulkan_render_state_t *prepare_vulkan_subpass();
597597
void end_vulkan_subpass();

src/api/wayfire/vulkan.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <wayfire/config.h>
77
#endif
88

9-
#if WF_HAS_VULKAN
9+
#if WF_HAS_VULKANFX
1010
#include <memory>
1111
#include <map>
1212
#include <string>

src/core/core-impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class compositor_core_impl_t : public compositor_core_t
2222
wlr_egl *egl = NULL;
2323
wlr_compositor *compositor;
2424

25-
#if WF_HAS_VULKAN
25+
#if WF_HAS_VULKANFX
2626
std::unique_ptr<wf::vulkan_render_state_t> vulkan_state;
2727
#endif
2828

src/core/core.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ bool wf::compositor_core_t::is_gles2() const
8484

8585
bool wf::compositor_core_t::is_vulkan() const
8686
{
87-
#if WF_HAS_VULKAN
87+
#if WLR_HAS_VULKAN_RENDERER
8888
return wlr_renderer_is_vk(renderer);
8989
#else
9090
return false;
@@ -251,7 +251,7 @@ void wf::compositor_core_impl_t::init()
251251
OpenGL::init();
252252
}
253253

254-
#if WF_HAS_VULKAN
254+
#if WF_HAS_VULKANFX
255255
if (is_vulkan())
256256
{
257257
this->vulkan_state = std::make_unique<wf::vulkan_render_state_t>(renderer);
@@ -376,7 +376,7 @@ void wf::compositor_core_impl_t::fini()
376376
tx_manager.reset();
377377

378378
OpenGL::fini();
379-
#if WF_HAS_VULKAN
379+
#if WF_HAS_VULKANFX
380380
vulkan_state.reset();
381381
#endif
382382

0 commit comments

Comments
 (0)