Category: Blog

Blog posts, rambles, yaps.

  • Rust wgpu Exploration

    Recently, I’ve been playing around with the wpgu crate in rust, I’ve always loved low level rendering and the idea of memory safety from rust while being compiled down into very fast system code with complete control over memory lifetime. Love C#, but leaving everything to the garbage collector is just clearly not using our resources to the max.

    Anyways, this project that I setup is just drawing a classic triangle, seems the minimum setup you need is:
    winit for windowing
    pollster for async to sync quick conversion
    wgpu for rasterizing the crispest triangles

    Something interesting I came across is the startup time for different back-ends, wgpu allows you to choose default which goes through and does some validation with each one and chooses one, this actually takes around 2-3s in release for me every time you start up the app, which I know is not a lot but kind also… it is just one triangle. I looked into each individual back-end on its own and got the following timings for the different steps of my current pipeline:

    YAML
    GL: 
    instance: 115.6532ms 
    surface: 63.1µs 
    adapter: 225.3µs 
    device: 70.7764ms
    
    VULKAN: 
    instance: 1.446542s 
    surface: 106.5µs 
    adapter: 22.0682ms 
    device: 26.9581ms
    
    DX12: 
    instance: 26.1963ms 
    surface: 59.8µs 
    adapter: 935.0428ms 
    device: 60.9835ms

    GL for the win?!

    I will probably be using that as my back-end for initial iterative testing and building because I love a quick and responsive rerun. It’s also a classic to support so not bad to test with.

    Then when fancier features are required or we can benchmark multiple triangles, direct x or vulkan can be utilized!

    Tune in for the next post.

  • The Cycle of Hosting

    This website isn’t even fully up and built yet but I already wanted to write a blog post about how funny it is this is a word press website.

    Working our way back, my last website was using a C# standalone webassembly project. This was interesting to me because I had started using a lot of C# at work, so I was hoping it would make developing a website fun. Unfortunately I think that whole technology chain is cool, but overly bloated and conplicated for what I was trying to do, as well as not achieving what I really wanted. I did not realize it at the time but I really did want a dynamic website, because writing a blog post in some hybrid razor language on my desktop before building and pushing to github was not a workflow that encouraged posting a lot, it was a hassle and I did not feel like cleaning up my pages. Immediately wordpress is better in all aspects for this because its built with blog posting in mind, even from mobile(!).

    Before that I used hugo to write html pages, and it allowed html reuse through some snippet system (I forgot the proper terminology). This may have actually been nicer if you want a completely free way to host a blog as it comes with themes and a way to insert markdown blog posts as pages. It has the same core issue as the C# website, and if I were to go back to staticslly generated only, I would expore other generators like Jekyll, as everything for web development really is easier done in html/css/js.

    Before that it was a manually coded static site also hosted on github pages, this is the most flexible if you want to explore the languages from scratch, and I think it was really worthwhile, but not sustainable, I will be interested in how flexible wordpress is for presenting more raw html and javascript for if I want to showcase old or external web projects.

    And to complete the cycle, I do remember my first website was actually hosted on wordpress.com (very different from self hosted which you download from wordpress.org). So how we have come back to where we started…