Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

render/vulkan: Refactor image usages for modifiers #3271

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

Joshua-Ashton
Copy link
Contributor

Makes this much more extensible so we could add a storage type in future for compute.

Signed-off-by: Joshua Ashton joshua@froggi.es

@emersion
Copy link
Member

cc @nyorain

free(props->texture_mods);
free(props->render_mods);
for (int i = 0; i < WLR_VK_IMAGE_USAGE_COUNT; i++)
free(props->mods[i]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codestyle nitpick: braces around the free statement

++props->texture_mod_count;

found = true;
wlr_drm_format_set_add(&dev->dmabuf_texture_formats,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You never add to this format_set anymore more if I didn't miss anything. This seems like a problem.

@nyorain
Copy link
Contributor

nyorain commented Oct 19, 2021

The code was repetitive, I agree that this approach is cleaner.


static const VkFormatFeatureFlags mod_set_features[WLR_VK_IMAGE_USAGE_COUNT] = {
[WLR_VK_IMAGE_USAGE_RENDER] = VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit: we don't align continuation lines, we just use one or two tabs.


static const VkImageUsageFlags mod_set_usage[WLR_VK_IMAGE_USAGE_COUNT] = {
[WLR_VK_IMAGE_USAGE_RENDER] = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit: unnecessary newline

if (!props->mods[i]) {
wlr_log_errno(WLR_ERROR, "Allocation failed");
for (int j = 0; j < i; j++)
free(props->mods[j]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit: braces are mandatory

enum wlr_vk_image_usage {
WLR_VK_IMAGE_USAGE_RENDER,
WLR_VK_IMAGE_USAGE_SAMPLED,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit: unnecessary newline

This is a glue file to allow integration with builds.sr.ht.
@emersion
Copy link
Member

emersion commented Nov 1, 2021

wlroots has migrated to gitlab.freedesktop.org. This pull request has been moved to:

https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3271

emersion and others added 16 commits November 1, 2021 18:54
For `required` to disable search the value needs to be of `feature` type.
Checking `gles2` via `in` keyword returns a `bool` but `required: false`
makes the dependency optional instead of disabled.
This allows compositors to handle touch pointer emulation manually,
instead of having Xwayland do it [1].

[1]: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/691
This struct contains additional information for session device
change events, such as the DRM connector ID that has changed.
When a connector ID is specified in a hotplug event, don't scan all
connectors. Only scan the connector that has changed.
Callers can access output->front_buffer instead.
The protocol uses a signed integer here, which is also what the
wlr_input_method_v2_preedit_string struct provides to compositors from
the input method protocol. Sway currently just passes those int32_t
values directly to this function leading to an implicit conversion.
Makes this much more extensible so we could add a storage type in future for compute.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants