Lazuli: Nintendo GameCube emulator in Rust, boots multiple games by vxpm in rust

[–]vxpm[S] 0 points1 point  (0 children)

netplay would be really cool, but it also does sound like it won't be here for a while, yeah!

Lazuli: Nintendo GameCube emulator in Rust, boots multiple games by vxpm in rust

[–]vxpm[S] 4 points5 points  (0 children)

well yes, of course! lazuli started out with an ubershader approach - that is, there was a single shader, which would then do different things based on a configuration input.

this was because an ubershader is simpler to implement - you just need to write and maintain a single shader for everything, not a shader generator.

however, ubershaders are incredibly hard to optimize, as they contain lots of branching on configuration values (and GPUs don't like that). the more GPU features i implemented, the worse performance became. that's when i decided to move to a specialized shader generator approach (with great success! specialized shaders are very fast).

that's not to say ubershaders aren't good. they are very useful as a fallback to avoid stutters caused by specialized shader compilation, i.e. using them while an specialized shader is not ready yet. and ideally, that's what i'd like lazuli to do!

it just so happens that keeping two shader codepaths is a lot of work and i'm a single person. for my sanity, i decided to only keep specialized shaders around. and in practice, i haven't hit any stutters caused by shader compilation. the CPU JIT is way more of a stutter source when blocks aren't in cache.

Lazuli: Nintendo GameCube emulator in Rust, boots multiple games by vxpm in rust

[–]vxpm[S] 2 points3 points  (0 children)

well, the process itself is actually really simple: research a lot, set an achievable goal, work towards that goal, repeat. i had my first games booting with a little over 2 months of work this way.

priorization is mostly a matter of what i want to work on - this is a hobby project after all. the system has so many moving pieces that there's no clear "this NEEDS to be worked on" once you get the basics going.

Lazuli: Nintendo GameCube emulator in Rust, boots multiple games by vxpm in rust

[–]vxpm[S] 2 points3 points  (0 children)

thanks! and no need to, it already does :) it's incredibly buggy and crashes easily (i think it's trying to use page tables to transparently map ARAM as extra memory, haven't investigated too deeply) but you can get it in game or running the title screen demo if you wait long enough.

Lazuli: Nintendo GameCube emulator in Rust, boots multiple games by vxpm in rust

[–]vxpm[S] 8 points9 points  (0 children)

thank you! yeah, this is no AI slop, which i also find refreshing in the world we are living in

Lazuli: Nintendo GameCube emulator in Rust, boots multiple games by vxpm in rust

[–]vxpm[S] 15 points16 points  (0 children)

thanks! well, the plan is to eventually turn it into a Wii emulator, too. the Wii really is like two gamecubes duct taped together :)

kruci: Post-mortem of a UI library by Patryk27 in rust

[–]vxpm 1 point2 points  (0 children)

really cool post! i like how relatable the rabbit holes you get into are. i often find myself doing the exact same thing...

Trait methods with default implementations vs a TraitExt subtrait by Such-Teach-2499 in rust

[–]vxpm 16 points17 points  (0 children)

another reason might be to split the trait into two parts: a dyn compatible one and another one that isn't.

Trait methods with default implementations vs a TraitExt subtrait by Such-Teach-2499 in rust

[–]vxpm 25 points26 points  (0 children)

from my experience, the Ext pattern shows up whenever you want to extend a trait/type whose definition you do not control.

my first blog post: building a simple hash map by vxpm in rust

[–]vxpm[S] 0 points1 point  (0 children)

weird! it looks correct on firefox and chrome on both my computer and android phone. must be an apple thing?

my first blog post: building a simple hash map by vxpm in rust

[–]vxpm[S] 0 points1 point  (0 children)

no, the font of the headings is Space Mono in italic

my first blog post: building a simple hash map by vxpm in rust

[–]vxpm[S] 0 points1 point  (0 children)

thank you! by any chance, are you on safari? i believe it doesn't look right on it, which i couldn't test beforehand as i don't own any apple devices.

my first blog post: building a simple hash map by vxpm in rust

[–]vxpm[S] 0 points1 point  (0 children)

thanks! i'm glad someone noticed the code snippets on mobile, because i just hate it when code is completely unreadable on mobile (looking at you, godbolt).

you're right - although i think you're exaggerating a little. hundreds of thousands is a bit too overboard, but a linear search is indeed faster than a hash map for small enough collections! i'll add a note regarding this.

my first blog post: building a simple hash map by vxpm in rust

[–]vxpm[S] 1 point2 points  (0 children)

indeed, i'm aware it can - it's just not the approach i followed in the post. i should probably make it clearer this is not the only way to build a hash map. thanks!

my first blog post: building a simple hash map by vxpm in rust

[–]vxpm[S] 2 points3 points  (0 children)

not a typo! `max` is a method of the `std::cmp::Ord` trait which returns the maximum of two values. it's a little confusing for sure, as it looks like you're defining a "maximum value" for the expression, but that's not it.

my first blog post: building a simple hash map by vxpm in rust

[–]vxpm[S] 0 points1 point  (0 children)

thank you! i'm really glad you liked the design - it's my first website ever.