Ancestors

Written by Sebastian Schöner on 2024-12-17 at 12:08

I wish I could shut up for a day or two but sometimes you find something and then just want to write it down. Or it finds you and crashes your debugger and leaves you no other choice:

https://blog.s-schoener.com/2024-12-17-unity-blobs/

=> More informations about this toot | More toots from sschoener@mastodon.gamedev.place

Written by Josh Simmons on 2024-12-17 at 12:54

@sschoener I wonder if you could address this by reflecting the members and doing a manual pointer patch at load time, without changing the data.

=> More informations about this toot | More toots from dotstdy@mastodon.social

Written by Sebastian Schöner on 2024-12-17 at 13:02

@dotstdy Not sure I understand what you mean :) - The goal of the blob asset design was to avoid having to do any pointer patchup during streaming, so that solution was explicitly ruled out (but it would work). Or are you suggesting something else?

=> More informations about this toot | More toots from sschoener@mastodon.gamedev.place

Written by Josh Simmons on 2024-12-17 at 13:06

@sschoener right I get that, but you might want to ignore that when debugging for example. But it really depends on how games feed data in I suppose. If it's controlled by the engine it's probably possible, if not, perhaps a struggle.

=> More informations about this toot | More toots from dotstdy@mastodon.social

Written by Josh Simmons on 2024-12-17 at 13:21

@sschoener basically in debugging friendly mode, when you load a blob, allocate it from / copy it into a known (or just highly aligned) base address, and patch the offsets to be base relative, switching the deref code to do the appropriate lookup. It's kinda awful, but maybe kinda awful is better than debugger crashing. Relies on reflection being able to find the refs though, so idk how feasible it would be in practice.

=> More informations about this toot | More toots from dotstdy@mastodon.social

Written by Sebastian Schöner on 2024-12-17 at 13:25

@dotstdy "kinda awful" definitely beats crashing :)

=> More informations about this toot | More toots from sschoener@mastodon.gamedev.place

Toot

Written by Josh Simmons on 2024-12-17 at 13:34

@sschoener I suspect the only good solution would be ref-only types / pinning somehow, which I guess is especially unlikely with the ancient mono :')

=> More informations about this toot | More toots from dotstdy@mastodon.social

Descendants

Written by Sebastian Schöner on 2024-12-17 at 13:49

@dotstdy Even C#'s newer ref-structs don't disallow copying, so that wouldn't help. My solution to this problem so far is "rewrite it in native code."

=> More informations about this toot | More toots from sschoener@mastodon.gamedev.place

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113668422575565534
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
281.773879 milliseconds
Gemini-to-HTML Time
1.909296 milliseconds

This content has been proxied by September (3851b).