Update ToVkImageViewType to support VK_IMAGE_VIEW_TYPE_2D_ARRAY - #9220
Merged
tomspilman merged 1 commit intoFeb 12, 2026
Merged
Conversation
…to determine whether the supplied MGTextureType is a 2D array or 2D image
Contributor
Author
|
I forgot to change the PR name and it doesn't appear as though I'm able to do so. If it matters, |
tomspilman
approved these changes
Feb 12, 2026
This was referenced Jul 19, 2026
Closed
Closed
Closed
Closed
zignd
pushed a commit
to zigrok/MonoGame
that referenced
this pull request
Jul 30, 2026
MonoGame#9220) Fixes MonoGame#9212 ### Description of Change This PR addresses an issue on the Vulkan where textures that were 2D arrays were getting mapped to `VK_IMAGE_VIEW_TYPE_2D` instead of `VK_IMAGE_VIEW_TYPE_2D_ARRAY`. On MacOS, this mismatch causes an application crash. The approach chosen was to add an additional optional `layerCount` parameter to `ToVkImageViewType` that can be used to distinguish between 2D and 2D Array types. Note that there is a similarly named `ToVkImageType` that performs a conversion between `MGTextureType` and Vulkan constants. It does not include this new switching logic because it doesn't seem to affect the MacOS runtime problem which is what motivated the creation of MonoGame#9212. ### Contributor Declaration - [x] I certify that no LLM's were used to generate any code or documentation in this contribution. Co-authored-by: Adam Carter <[email protected]>
This was referenced Aug 16, 2026
Open
Open
Open
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9212
Description of Change
This PR addresses an issue on the Vulkan where textures that were 2D arrays were getting mapped to
VK_IMAGE_VIEW_TYPE_2Dinstead ofVK_IMAGE_VIEW_TYPE_2D_ARRAY. On MacOS, this mismatch causes an application crash.The approach chosen was to add an additional optional
layerCountparameter toToVkImageViewTypethat can be used to distinguish between 2D and 2D Array types.Note that there is a similarly named
ToVkImageTypethat performs a conversion betweenMGTextureTypeand Vulkan constants. It does not include this new switching logic because it doesn't seem to affect the MacOS runtime problem which is what motivated the creation of #9212.Contributor Declaration