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

bloom vkCmdBlitImage extents violates valid usage #104

Closed
AaronHaganAMD opened this issue Jan 27, 2021 · 1 comment
Closed

bloom vkCmdBlitImage extents violates valid usage #104

AaronHaganAMD opened this issue Jan 27, 2021 · 1 comment

Comments

@AaronHaganAMD
Copy link

extent.width = (extent.width + 3) & ~3;

// Round the extent up to a multiple of 4 to make the downscale blits behave well
extent.width = (extent.width + 3) & ~3;
extent.height = (extent.height + 3) & ~3;

It looks like the blit_mip_0_to_1.srcOffsets[1] is bigger than the size of the src image which is a spec violation.

• VUID-vkCmdBlitImage-pRegions-00215
The source region specified by each element of pRegions must be a region that is
contained within srcImage

What is not behaving well about it ?

@apanteleev
Copy link
Collaborator

Thanks for pointing this out!

What is not behaving well about it ?

When the downscale blit input size is not exactly 2x its output size (which happens when the input size is odd), it doesn't do a 2:1 downscale with each output pixel being exactly in the middle of the 4 input pixels. Which breaks the sampling math in the blur pass that follows. To clearly observe this behavior, use these settings:

  • drs_enable 1
  • drs_target set to something high enough to force lower than 100% render scale
  • flt_taa 1 to make post-processing run in render resolution and not output resolution
  • bloom_intensity 1.0 and bloom_sigma 0.01 just to make it more obvious

But it's a good point that specifying the extents larger than the texture is a spec violation. I guess that only happens when the output resolution (i.e. window size) is not multiple of 4, which is uncommon. Still, this should be fixed - and I think the right way to fix this would be to do the downscaling in a single compute shader instead of two blits.

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

No branches or pull requests

2 participants