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

[Rendering] optimize SSAO & DOF algorithms by using R8-channel texture for computations (reduces bandwidth) #80

Open
MomoDeve opened this issue Jul 2, 2023 · 4 comments
Assignees
Labels
enhancement refactoring or optimization

Comments

@MomoDeve
Copy link
Member

MomoDeve commented Jul 2, 2023

Right now RGBA16F texture is used. This is completely unnecessary and wastes bandwidth, better to have a separate R8 channel texture for such computations

@MomoDeve MomoDeve changed the title [Rendering] optimize SSAO & DOF algorithms by introducing R-channel textures (reduces bandwidth) [Rendering] optimize SSAO & DOF algorithms by introducing R8-channel textures (reduces bandwidth) Jul 2, 2023
@MomoDeve MomoDeve changed the title [Rendering] optimize SSAO & DOF algorithms by introducing R8-channel textures (reduces bandwidth) [Rendering] optimize SSAO & DOF algorithms by using R8-channel texture for computations (reduces bandwidth) Jul 2, 2023
@MomoDeve MomoDeve added the enhancement refactoring or optimization label Jul 2, 2023
@fall2019
Copy link
Member

fall2019 commented Jul 3, 2023

Yeah I will do it after screen space ray tracing and hi-z finished.

@MomoDeve
Copy link
Member Author

MomoDeve commented Jul 3, 2023

@fall2019 btw, I noticed you used RenderToTextureNoClear in ApplyDepthOfFieldEffect. Is it required? Because rendering without clear is slower in general than rendering with clear. If its not required, I can create a separate issue to fix that
UPD: Tested local, seems like it works with clear, if its correct, I can merge that with #78 (8096700)

@fall2019
Copy link
Member

fall2019 commented Jul 3, 2023

Sure.You can just remove that without any problem. I was thinking like if I don't need to clear it why would I call this clear function. 🤣

@MomoDeve
Copy link
Member Author

MomoDeve commented Jul 3, 2023

Sure.You can just remove that without any problem. I was thinking like if I don't need to clear it why would I call this clear function. 🤣

OK) But actually when you are clearing, the gpu can discard the old contents and just write color + draw call data, opposite to retrieving data from memory and then storing it.
In vulkan there is a 3d option - dont_care (aka discard). It is used for the cases like drawing full screen rect, when you guarantee you don't need old content and will fully fill the render target with new data https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkAttachmentLoadOp.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement refactoring or optimization
Projects
None yet
Development

No branches or pull requests

2 participants