Skip to content

Fix format aspects validation for DRM format modifier images#2766

Merged
marc0246 merged 1 commit intovulkano-rs:masterfrom
cadubentzen:drm-modifiers-fix
Feb 5, 2026
Merged

Fix format aspects validation for DRM format modifier images#2766
marc0246 merged 1 commit intovulkano-rs:masterfrom
cadubentzen:drm-modifiers-fix

Conversation

@cadubentzen
Copy link
Copy Markdown
Contributor

@cadubentzen cadubentzen commented Jan 31, 2026

  1. Update documentation to reflect any user-facing changes - in this repository.

  2. Make sure that the changes are covered by unit-tests.

  3. Run cargo clippy on the changes.

  4. Run cargo +nightly fmt on the changes.

  5. Please put changelog entries in the description of this Pull Request
    if knowledge of this change could be valuable to users. No need to put the
    entries to the changelog directly, they will be transferred to the changelog
    file by maintainers right after the Pull Request merge.

    Please remove any items from the template below that are not applicable.

  6. Describe in common words what is the purpose of this change, related
    GitHub Issues, and highlight important implementation aspects.

    When calling subresource_layout() on a RawImage that uses DRM format modifiers (ImageTiling::DrmFormatModifier), the validation would fall through into the format-aspects checks after correctly validating the MemoryPlane aspect. This caused spurious validation errors because DRM format modifier images use MemoryPlane aspects, not the usual format aspects (Color, Depth, Stencil, Plane0, etc.).

    The fix adds an extra self.tiling != ImageTiling::DrmFormatModifier around the validation which was previously failing.

Changelog:

### Bugs fixed
- `RawImage::subresource_layout` validation incorrectly rejected valid `MemoryPlane` aspects for DRM format modifier images.

@marc0246
Copy link
Copy Markdown
Contributor

marc0246 commented Feb 5, 2026

Thank you! However, an early return in validation is something we don't do. And I wouldn't want to start doing it because it's inevitably going to be overlooked in the future. There even is commented-out validation later down pertaining to DRM format modifier. So instead, please put the other validation later down in an if self.tiling != ImageTiling::DrmFormatModifier block instead.

@cadubentzen
Copy link
Copy Markdown
Contributor Author

Thanks for the review! Done.

@marc0246
Copy link
Copy Markdown
Contributor

marc0246 commented Feb 5, 2026

Thank you for the fix!

@marc0246 marc0246 added this pull request to the merge queue Feb 5, 2026
Merged via the queue into vulkano-rs:master with commit ae4010b Feb 5, 2026
8 checks passed
marc0246 added a commit that referenced this pull request Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants