Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Validation Errors and Bumpmaps #499

Merged
merged 24 commits into from
Jun 1, 2023
Merged

Conversation

devshgraphicsprogramming
Copy link
Member

@devshgraphicsprogramming devshgraphicsprogramming commented May 30, 2023

Description

Fixes:

  • querying for device properties and limits for extensions that are not supported (dynamic pNext chain construction)
  • querying format usages for formats which are not supported (no extension or vulkan instance version)
  • not generating mip-maps for images that already have defined mip pyramids (like KTX/DDS)
  • only make the mip-pyramid full if there was no mip-pyramid to start with in the first place
  • fix Example 06.Meshloaders black objects on DebugMode #411
  • upstream a bunch of fixes from ditt branch
  • minor issues with compilation of certain examples

Testing

Just running examples, nothing complex like comparing device props and limit structs before and after implementing changes.

TODO list:

Actually fix #472

… image that needs its mips computed

Also stop computing mips for images that have some regions specified already in non-base mip levels
Comment on lines +1567 to +1568
const bool formatGotPromoted = asset::getFormatClass(cpuParams.format)!=asset::getFormatClass(gpuImgParams.format);
params.format = formatGotPromoted ? gpuImgParams.format:cpuParams.format;
Copy link
Member Author

Choose a reason for hiding this comment

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

@Erfan-Ahmadi corrected the thing that would wipe away all views' formats when using Asset Converter

Comment on lines +1569 to +1596
params.subUsages = cpuParams.subUsages;
// TODO: In Asset Converter 2.0 we'd pass through all descriptor sets etc and propagate the adding usages backwards to views, but here we need to trim the image's usages instead
{
IPhysicalDevice::SFormatImageUsages::SUsage validUsages(gpuImgParams.usage);
if (params.image->getTiling()!=IGPUImage::ET_LINEAR)
validUsages = validUsages & optimalUsages[params.format];
else
validUsages = validUsages & linearUsages[params.format];
// add them after trimming
if (validUsages.sampledImage)
params.subUsages |= IGPUImage::EUF_SAMPLED_BIT;
if (validUsages.storageImage)
params.subUsages |= IGPUImage::EUF_STORAGE_BIT;
if (validUsages.attachment)
{
if (asset::isDepthOrStencilFormat(params.format))
params.subUsages |= IGPUImage::EUF_DEPTH_STENCIL_ATTACHMENT_BIT;
else
params.subUsages |= IGPUImage::EUF_COLOR_ATTACHMENT_BIT;
}
if (validUsages.transferSrc)
params.subUsages |= IGPUImage::EUF_TRANSFER_SRC_BIT;
if (validUsages.transferDst)
params.subUsages |= IGPUImage::EUF_TRANSFER_DST_BIT;
// stuff thats not dependent on device caps
const auto uncappedUsages = IGPUImage::EUF_TRANSIENT_ATTACHMENT_BIT|IGPUImage::EUF_INPUT_ATTACHMENT_BIT|IGPUImage::EUF_SHADING_RATE_IMAGE_BIT_NV|IGPUImage::EUF_FRAGMENT_DENSITY_MAP_BIT_EXT;
params.subUsages |= gpuImgParams.usage&uncappedUsages;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@Hazardu for future reference


// TODO: make sure there is no leak due to MaxChannels!
base_t::template onDecode(inFormat, state, srcPix, sample, swizzledSample, inBlockCoord.x, inBlockCoord.y);
base_t::template onDecode(inFormat, state, srcPix, preSwizzleSample, sample, inBlockCoord.x, inBlockCoord.y);
Copy link
Member Author

Choose a reason for hiding this comment

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

@achalpandeyy before the swizzledSample wouldn't get used at all which would mess with Derivative Map from Heightmap generation

@devshgraphicsprogramming devshgraphicsprogramming mentioned this pull request May 31, 2023
10 tasks
@devshgraphicsprogramming devshgraphicsprogramming changed the title Validation Error Fixes and Threadsafety Fix Validation Errors and Bumpmaps Jun 1, 2023
@devshgraphicsprogramming devshgraphicsprogramming merged commit 64da18c into master Jun 1, 2023
@devshgraphicsprogramming devshgraphicsprogramming deleted the fix_472 branch June 1, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants