• self@awful.systemsM
    link
    fedilink
    arrow-up
    4
    ·
    7 months ago

    there are so many good bits and pieces about writing modern graphics drivers in there!

    AMD also bakes state into shaders… with a twist. They divide the hardware binary into three parts: a prolog, the shader, and an epilog. Confining dynamic state to the periphery eliminates shader variants. They compile prologs and epilogs on the fly, but that’s fast and doesn’t stutter. Linking shader parts is a quick concatenation, or long jumps avoid linking altogether. This strategy works for the M1, too.

    For Honeykrisp, let’s follow NVK’s lead and treat all state as dynamic. No other Vulkan driver has implemented full dynamic state and shader objects this early on, but it avoids refactoring later. Today we add the code to build, compile, and cache prologs and epilogs.

    I’ve still got no idea why Apple’s clinging to Metal officially, but it’s awesome that performant Vulkan’s quickly becoming a thing for at least some Mac computers now