-
Notifications
You must be signed in to change notification settings - Fork 13
Implementing streamed tiles system for big georeferenced images #205
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
base: master
Are you sure you want to change the base?
Conversation
…d to VkBufferImageCopy used to upload tiles)
} | ||
|
||
// Generate upload data | ||
auto uploadData = generateTileUploadData(cachedImageRecord->type, NDCToWorld, cachedImageRecord->georeferencedImageState.get()); |
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.
It seems like it's caculating tiles to load and then requesting loading them.
maybe a better name along "computeTilesAndLoad"
my thought process out loud:
I'm also thinking about if separating this into two function "compute" + "load" would do us any benefit when we use futures (instead of actually loading them on demand)
but I don't think so, this function can just return a bunch of futures to hold onto and wait upon...
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.
I'll leave this one open so that we remember there's this option when we introduce futures
|
||
DrawResourcesFiller::TileUploadData DrawResourcesFiller::generateTileUploadData(const ImageType imageType, const float64_t3x3& NDCToWorld, GeoreferencedImageStreamingState* imageStreamingState) | ||
{ | ||
// I think eventually it's better to just transform georeferenced images that aren't big enough into static images and forget about them |
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.
Good idea! let's try to have similar logic in n4ce codebase as well when we integrate and make it not go through georeferenced paths if image is small enough
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.
the criteria should be: the memory the image consumes is smaller than the GPU-resident image used for streaming
62_CAD/DrawResourcesFiller.cpp
Outdated
{ | ||
// Decide whether the image can reside fully into memory rather than get streamed. | ||
// TODO: Improve logic, currently just a simple check to see if the full-screen image has more pixels that viewport or not | ||
// TODO: add criterial that the size of the full-res image shouldn't consume more than 30% of the total memory arena for images (if we allowed larger than viewport extents) | ||
const bool betterToResideFullyInMem = georeferencedImageParams.imageExtents.x * georeferencedImageParams.imageExtents.y <= georeferencedImageParams.viewportExtents.x * georeferencedImageParams.viewportExtents.y; | ||
const bool betterToResideFullyInMem = params.imageExtents.x * params.imageExtents.y <= params.viewportExtents.x * params.viewportExtents.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.
I just hit a problem where params.imageExtent was 2^17 and the multiplication resulted in 0 because it's uint32_t.
change original imageExtents to be uint64_t (only on cpu side ofcourse) and make sure you're not limited by uint64_t and modify the check to :
if params.imageExtent.x < 2^14 && params.imageExtent.y < 2^14 && imagePixels <= viewportPixels
to make sure we're doing "Streamed" if the image extent is larger than a certain threshold unrelated to the viewport.
Check if we're getting similar issues with uint32_t2 imageExtents being large.
…t since there's some numerical shenaningans I couldn't figure out
Run on this branch:
https://github.com/Devsh-Graphics-Programming/Nabla/tree/geotex_streaming