Skip to content

Potential issue of GenericFeaturesPNextNode fields initalization or misunderstanding #334

Closed
@th3or14

Description

I don't understand why fields in fields[field_capacity] array of GenericFeaturesPNextNode are enabled on initailization by memset, could you please explain?

The comment // Zero out supported features right above memset in VkBootstrap.cpp also points to that memset was supposed to disable fields. But I assume that setting every byte of fields array to UINT8_MAX enables all the fields.

Activity

th3or14

th3or14 commented on Feb 15, 2025

@th3or14
ContributorAuthor

This commit 75db58a shows that once the fields array initalization code was

		for (auto& field : fields) {
			field = 0;
		}

And this pull request #89 introduces memsets for the fields array initialization. I'm pretty sure that the author intended to zero out the data. I would bring back zero initialization. But I would better replace such memsets with explicit assignments to VK_FALSE since valid values of VkBool32 variables are VK_TRUE and VK_FALSE only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Participants

    @th3or14

    Issue actions

      Potential issue of GenericFeaturesPNextNode fields initalization or misunderstanding · Issue #334 · charles-lunarg/vk-bootstrap