Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Graphics Today's journey into the d3d12 native rendering plugin interface~!

Discussion in '5.4 Beta' started by Pyromuffin, May 23, 2016.

  1. Pyromuffin


    Aug 5, 2012
    holy crap after spending all day screwing around with unity's native dx12 rendering plugin interface, I finally have something rendering!~ drawing red into that quad's texture through a compute shader.

    I'm posting this here just in case someone else is trying to do this, and runs into some of the same issues I had.
    I'll answer any question's you've got if you'd like more clarification.

    the pitfalls i overcame today (in roughly chronological order):
    • trying to find unity's 5.4 beta native plugin interface headers for d3d12
    • forcing unity into d3d12 mode when the editor options seem to have no effect
    • figuring out how to debug a dll running in an app I don't have source access to
    • no unbounded UAV arrays in resource binding tier 2 (my fault for trying to do unbounded bindless on a gtx 980)
    • creating my own compute command queue without any possibility of unity telling me the state of resources im using (i suppose this means I won't be able use multi-engine features with unity's native plugin interface)
    • not having any idea how to actually compile shaders
    • figuring out how to compile shaders, putting the bytecode in a header file, then... not knowing how to get the header file into an included directory
    • undoing unity's weird custom build steps for shaders i'm not using
    • including the d3d12 lib so i can serialize pipeline state blobs at runtime?!
    • not creating a texture with unordered write flags set (has to be done through a unity script)
    • forcing d3d12 debug layer through the dx control panel
    • trying to start the graphics debugger while creating a texture that is way too large
    • thinking unity was not creating resource barriers for me when it was, even when the timeline seems reversed
    • writing to a UAV array without dereferencing it first even if there is only one UAV set in the descriptor heap (bindless fail #2)

    now the real work starts of porting my fluid sim to DX12 for cheap readback!

    Attached Files:

  2. duck


    Unity Technologies

    Oct 21, 2008
    Hi Pyromuffin! Sounds like a lot of work, glad to hear you got past all those hurdles. I'm on Unity's docs team - if there are any particular steps where you feel like the docs should be improved based on your experience, please drop us a note in the docs forum.

    Thanks :)