Clearly I’ve not been posting

sitelogoBut I have been doing stuff.

I’ve been spending my time refactoring and just cleaning up the code in Gorgon.  I made the mistake of getting Resharper and it put me on this crusade of cleaning up the code because apparently I’m just awful.  Also, I’ve been finishing up the primary graphics API (not the 2D stuff) by adding a bunch of new things to it like geometry shaders, compute shaders, and hull/domain shaders for tesselation (this one is cool, if not a little baffling).  I also made the API a little closer to Direct 3D 11 by adding views to resource object types.

Wait, what are views?  Well, I’m glad you didn’t ask.  Basically it’s a view of a resource from the shader.  You can take view of a resource, or just a piece of the resource and even change the resource format (a little, not very much, basically if you have R8G8B8A8 you can do R8G8B8A8_Float or R8G8B8A8_UInt, but it’s better than nothing).  You can also create multiple views for a resource and for shader resource views you can bind them at the same time (provided it’s a different sub resource).  Included with these are shader resource views which allow us to bind a texture or buffer to a shader (even vertex/index buffers).  You can also create unordered access views which allow you to write back to the resource.  This allows for some fun things with textures.  Then there’s also a render target view which are used with render target textures, but can also be used with buffers and finally depth stencil views.

The render target system got an overhaul.  Render targets are now inherited from textures and you can have 1D/2D/3D render targets (or render targets that use an arbitrary buffer).  These targets can be casted between the texture type and the render target type.  Swap chains are a special case and can be used as a render target view and casted to a render target/2D texture.

The depth/stencil buffers also got an overhaul and 1D/2D depth/stencil buffers are inherited from 1D/2D textures and can be casted between textures and depth/stencil types.

Render targets, textures, buffers and swap chains are also implicitly castable to views because they can be created with default views (textures/render targets always have one unless they’re staging resources).

This was/is a monumental amount of work, and is not done yet.  I have most of the D3D 11 API mapped to my graphics API and I have 2 major features to put in:

  • Stream output – Allows the sending of geometry data back to a buffer.
  • Deferred contexts – Allows the graphics commands to be deferred until they’re needed, thereby saving some performance.

Once that’s done I plan on getting back to finishing up my code clean up in the other APIs, finishing up the editor and adding examples to the library.  Hopefully it’ll be done before Microsoft fucks everything else up and we’re all off using Linux or some other equally nightmarish operating system.

 

3 thoughts on “Clearly I’ve not been posting

  1. Chris Threlfo

    This is awesome news. I haven’t checked out the code since March, so I am looking forward to checking out the improvements.

    I have been using Resharper since version 2, and back then it was worth the instability (it was bad) just for the edit-time compile-error checking. Now it is something else, especially once you get comfortable with the method-insertion shortcuts.

    I know exactly what you mean about the picky nun. I’m as touchy about naming and code style as Resharper is, so we get on pretty great.

    1. Tape_Worm Post author

      Honestly I wish there were a nun smacking the hands of programmers around the world. I’ve witnessed some truly horrid code out there in production environments (Gorgon included).

      Resharper is actually a great tool. Since I’ve been using it I’ve been able to identify bugs that I hadn’t noticed before, and preemptively dealt with issues that had yet to manifest themselves. Also my code is a lot cleaner and easier to read now because of it. It even helped correct some assumptions I had about .NET code that was utterly incorrect. And finally, and most importantly for Gorgon, the performance of the graphics API jumped up a little after combing through most of the code with Resharper (and also the static code analysis, a.k.a fxcop).

      My only issue is that I get a little obsessed when I see warnings regarding my code, so I have to deal with every last one of them… and this takes time.

Comments are closed.