-
Notifications
You must be signed in to change notification settings - Fork 18
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
Manual buffer management #59
Comments
We use Pfim for loading textures from DDS files, but we also support loading textures from other image formats, so Pfim is "one library among others". The common denominator is an engine-specific structure that temporarily holds image data. Because of a multi-threaded scenario, this data is only used after Pfim loading has finished. So the use case would be:
To access the loaded data in a world without
Explicitly taking ownership of the data could be a way around this. Not having |
I've been mulling this over to see if I can modify one of the samples to demonstrate this use case without seeming too contrived, but then I remembered #45 and was curious how you would expect interactions too work. For instance, if the Mipmap data was stored in the same array then it wouldn't complicate this feature (as there still would be only one buffer to manually manage), but if Mipmap was split off then it may open the flood gates for what can be expected of the user to manually manage. 🤔 |
I'd expect all mipmaps to be stored in a single buffer, preferably in sequence from largest to smallest. When choosing not to decode DDS data, that's to my knowledge already how the (compressed) data will be laid out in the buffer, so the default behavior of decoding the DDS data into uncompressed data would not introduce something entirely new. For uncompressed data and a known mipmap / image order, it shouldn't be too much of an issue to calculate the data offsets inside the buffer on the user side when needed, but Pfim could at some point provide explicit data layout information for the provided buffer as well. |
Pfim 0.7.0 introduced
IImageAllocator
so now code can look like thisIn #47, @adamkvd mentioned that it would be nice to have an allocator but be able to take ownership of the pixel data. Something along the lines of:
Before something like this is implemented, I'm curious if a small, straightforward sample can demonstrate the benefits of this override.
The text was updated successfully, but these errors were encountered: