[FIXED] array texture mipmaps#877
Merged
robertosfield merged 3 commits intovsg-dev:masterfrom Jul 20, 2023
Merged
Conversation
Collaborator
|
I have just done a quick review, I will need to investigate the issue further before merging so I understand the issue at hand. Do you have a means for recreating the problem that I could use to test things before/after? There is also similar code in TransferTask.cpp that will need updating as well. Or, we refactor both so they use the same code to avoid divergence. |
added 2 commits
July 18, 2023 20:42
Invalid layerCount was passed to vkCmdBlitImage when generating mipmaps for an array texture. In the code that loops over arrayLayers and blits each layer, layerCount should have been set to 1, not arrayLayers. Fixed by removing the loop. Let Vulkan loop over the image layers using a single blit of baseArrayLayer=0, layerCount=arrayLayers. Test case: auto imageData = vsg::ubvec4Array3D::create(256, 256, 32, vsg::ubvec4(), vsg::Data::Properties(VK_FORMAT_R8G8B8A8_UNORM)); imageData->properties.imageViewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY; sampler->maxLod = 4; // Generate mipmaps
…sferTask Tested dynamic image updates Tested array texture mipmaps
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.
Pull Request Template
Description
Fixed invalid baseArrayLayer and layerCount parameters passed to VkImageBlit when generating array texture mipmaps.
The Vulkan specification states: "The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created." (VUID-vkCmdBlitImage-srcSubresource-01707)
Type of change
How Has This Been Tested?
Tested that array texture mipmaps no longer contain artifacts
Checklist: