-
Notifications
You must be signed in to change notification settings - Fork 59
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
Conversation
… image that needs its mips computed Also stop computing mips for images that have some regions specified already in non-base mip levels
…changed a few flags into `core::bitfield`
…xtended usages of the source image, @achalpandeyy I'm ready for your compute blits! P.S. Also fixed the setting of IGPUImageView's format to always match IGPUImages, now only if format got promoted.
const bool formatGotPromoted = asset::getFormatClass(cpuParams.format)!=asset::getFormatClass(gpuImgParams.format); | ||
params.format = formatGotPromoted ? gpuImgParams.format:cpuParams.format; |
There was a problem hiding this comment.
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
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; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hazardu for future reference
…ut on the verbosity
normalmaps are usually encoded in [0,255] UNORM then decoded via 2x-1 therefore there's no way to express a 0.0, meaning 127 got interpreted as (0.003,-0.003,1.0), added an epsilon to produce 0 len normals.
|
||
// 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); |
There was a problem hiding this comment.
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
…d some nice defaults to the creation parameters
Description
Fixes:
ditt
branchTesting
Just running examples, nothing complex like comparing device props and limit structs before and after implementing changes.
TODO list:
Actually fix #472