Skip to content

Commit 40aac70

Browse files
committed
fixup! tmp wobbly
1 parent b577ef4 commit 40aac70

File tree

6 files changed

+25
-20
lines changed

6 files changed

+25
-20
lines changed

plugins/wobbly/wobbly.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,8 @@ class wobbly_render_instance_t :
913913

914914
params.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
915915
params.vertexInputDescription = {{
916-
.binding = 0,
917-
.stride = sizeof(float) * 4,
916+
.binding = 0,
917+
.stride = sizeof(float) * 4,
918918
.inputRate = VK_VERTEX_INPUT_RATE_VERTEX,
919919
}};
920920
params.vertexAttributeDescription = {
@@ -959,7 +959,7 @@ class wobbly_render_instance_t :
959959
// Try to reuse the vertex buffer if possible, to avoid reallocations.
960960
if (buffer && (buffer->get_size() >= total_size) && (buffer.use_count() == 1))
961961
{
962-
//LOGI("Reuse buffer index ", i);
962+
// LOGI("Reuse buffer index ", i);
963963
return buffers[i];
964964
}
965965
}
@@ -990,7 +990,7 @@ class wobbly_render_instance_t :
990990
});
991991

992992
data.pass->custom_vulkan_subpass([&] (wf::vulkan_render_state_t& state,
993-
wf::vk::command_buffer_t& cmd_buf)
993+
wf::vk::command_buffer_t& cmd_buf)
994994
{
995995
auto& our_state = ensure_vk(state);
996996

@@ -1002,6 +1002,7 @@ class wobbly_render_instance_t :
10021002
unified_buffer.push_back(uv[2 * i]);
10031003
unified_buffer.push_back(uv[2 * i + 1]);
10041004
}
1005+
10051006
VkDeviceSize total_size = unified_buffer.size() * sizeof(float);
10061007

10071008
auto buffer = find_buffer(state.get_context(), total_size);
@@ -1020,7 +1021,6 @@ class wobbly_render_instance_t :
10201021
vkCmdPushConstants(cmd_buf, our_state.pipeline->layout(), VK_SHADER_STAGE_VERTEX_BIT,
10211022
0, sizeof(glm::mat4), &transform);
10221023

1023-
10241024
cmd_buf.bind_buffer(buffer);
10251025
VkDeviceSize offset = 0;
10261026
vkCmdBindVertexBuffers(cmd_buf, 0, 1, &buffer->get_buffer(), &offset);

src/api/wayfire/render.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ struct color_transform_t
3131
{
3232
wlr_color_transfer_function transfer_function = WLR_COLOR_TRANSFER_FUNCTION_EXT_LINEAR;
3333
wlr_color_named_primaries primaries = WLR_COLOR_NAMED_PRIMARIES_SRGB;
34-
wlr_color_encoding color_encoding = WLR_COLOR_ENCODING_NONE;
35-
wlr_color_range color_range = WLR_COLOR_RANGE_NONE;
34+
wlr_color_encoding color_encoding = WLR_COLOR_ENCODING_NONE;
35+
wlr_color_range color_range = WLR_COLOR_RANGE_NONE;
3636

3737
bool operator ==(const color_transform_t& other) const;
3838
bool operator !=(const color_transform_t& other) const;

src/api/wayfire/vulkan.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class gpu_buffer_t : public std::enable_shared_from_this<gpu_buffer_t>
177177
std::shared_ptr<context_t> context;
178178
VkBuffer buffer = VK_NULL_HANDLE;
179179
VkDeviceMemory memory = VK_NULL_HANDLE;
180-
VkDeviceSize size = 0;
180+
VkDeviceSize size = 0;
181181
};
182182

183183
class image_descriptor_set_pool_t : public std::enable_shared_from_this<image_descriptor_set_pool_t>

src/core/vulkan.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bool gpu_buffer_t::write(const void *data, VkDeviceSize data_size, VkDeviceSize
104104
return true;
105105
}
106106

107-
void *gpu_buffer_t::map(VkDeviceSize offset, VkDeviceSize map_size)
107+
void*gpu_buffer_t::map(VkDeviceSize offset, VkDeviceSize map_size)
108108
{
109109
void *mapped = nullptr;
110110
if (vkMapMemory(context->get_device(), memory, offset, map_size, 0, &mapped) != VK_SUCCESS)
@@ -254,8 +254,8 @@ VkDescriptorSet image_descriptor_set_pool_t::get_descriptor_set(
254254
entry.image_view = VK_NULL_HANDLE;
255255
}
256256

257-
if (auto it = lookup_table.find(entry.last_texture->get_wlr_texture());
258-
it != lookup_table.end() && it->second == index)
257+
if ((auto it = lookup_table.find(entry.last_texture->get_wlr_texture());
258+
it != lookup_table.end()) && (it->second == index))
259259
{
260260
lookup_table.erase(it);
261261
}
@@ -353,7 +353,7 @@ command_buffer_t::~command_buffer_t()
353353
static void handle_release_resources(void *user_data)
354354
{
355355
auto *cmd_buf = static_cast<command_buffer_t*>(user_data);
356-
//LOGI("Render pass is releasing resources, deleting command buffer");
356+
// LOGI("Render pass is releasing resources, deleting command buffer");
357357
delete cmd_buf;
358358
}
359359

src/render.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ void wf::render_pass_t::add_texture(const std::shared_ptr<wf::texture_t>& textur
621621
opts.color_encoding = ct->color_encoding;
622622
opts.color_range = ct->color_range;
623623
wlr_color_primaries_from_named(&primaries, ct->primaries);
624-
opts.primaries = &primaries;
624+
opts.primaries = &primaries;
625625
opts.transfer_function = ct->transfer_function;
626626
}
627627

src/view/wlr-surface-node.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ wf::scene::surface_state_t& wf::scene::surface_state_t::operator =(surface_state
3434
accumulated_damage = other.accumulated_damage;
3535
seq = other.seq;
3636
size = other.size;
37-
src_viewport = other.src_viewport;
38-
transform = other.transform;
37+
src_viewport = other.src_viewport;
38+
transform = other.transform;
3939
color_transform = other.color_transform;
4040

4141
other.current_buffer = NULL;
@@ -77,21 +77,26 @@ void wf::scene::surface_state_t::merge_state(wlr_surface *surface)
7777
this->color_transform->transfer_function = WLR_COLOR_TRANSFER_FUNCTION_GAMMA22;
7878
const wlr_image_description_v1_data *img_desc =
7979
wlr_surface_get_image_description_v1_data(surface);
80-
if (img_desc != NULL) {
80+
if (img_desc != NULL)
81+
{
8182
this->color_transform->transfer_function = wlr_color_manager_v1_transfer_function_to_wlr(
82-
(wp_color_manager_v1_transfer_function)img_desc->tf_named);
83+
(wp_color_manager_v1_transfer_function)img_desc->tf_named);
8384
this->color_transform->primaries = wlr_color_manager_v1_primaries_to_wlr(
8485
(wp_color_manager_v1_primaries)img_desc->primaries_named);
8586
}
8687

8788
const wlr_color_representation_v1_surface_state *color_repr =
8889
wlr_color_representation_v1_get_surface_state(surface);
89-
if (color_repr != NULL) {
90-
if (color_repr->coefficients != 0) {
90+
if (color_repr != NULL)
91+
{
92+
if (color_repr->coefficients != 0)
93+
{
9194
this->color_transform->color_encoding = wlr_color_representation_v1_color_encoding_to_wlr(
9295
(wp_color_representation_surface_v1_coefficients)color_repr->coefficients);
9396
}
94-
if (color_repr->range != 0) {
97+
98+
if (color_repr->range != 0)
99+
{
95100
this->color_transform->color_range = wlr_color_representation_v1_color_range_to_wlr(
96101
(wp_color_representation_surface_v1_range)color_repr->range);
97102
}

0 commit comments

Comments
 (0)