Home Coding

For the past few weeks have started coding at home again on the RenderDoc for Mac project. I am using an M1 Mac Book Air as my development platform.

Getting RenderDoc for Mac up and running again locally with a goal to get the automated tests for OpenGL and Vulkan running has involved learning about:

  • cmake 3.19 differences in how it finds the python module compared to earlier cmake versions.
  • cmake configuration for RPATH setup in Mac executables and dynamic libraries
  • Python importing of dynamic libraries (on non-Windows platforms it will only load *.so libraries whereas Mac default is *.dylib).
  • MoltenVk installation
  • nuklear, Cocoa, Metal and OpenGL on Mac to get a minimal framework to run the tests (like GLFW/Xlib/XCB/ but reduced in scope and implemented as a single source and header file).

The current status for the RenderDoc OpenGL automated tests on Mac are the most basic tests are passing on Mac locally (the branch is not merged). Almost all of the OpenGL tests require OpenGL 4.2 or higher however the Mac only supports OpenGL 4.1 which means changing the existing tests to make them run for Mac which is not desirable because of its impact to non-Mac platforms.

The current status for the RenderDoc Vulkan automated tests on Mac is better than the OpenGL tests with over 20 tests passing. The automated tests have found:

  • RenderDoc support for MSAA is not working correctly on Mac (verified when using the RenderDoc UI with a sample vulkan application).
  • crashes in the MoltenVk driver where it tries to de-reference invalid pointers which according to the Vullkan specification should not be accessed (I believe other Vulkan drivers in the past had similar problems).
  • a RenderDoc shutdown crash in the MoltenVk driver where the internal Metal image pointer is null during a clear image command.

Now the automated tests have verified the basic RenderDoc capture and replay code for Mac OpenGl, the next steps are to tackle the RenderDoc UI integration. The immediate challenge is RenderDoc UI has a main thread for all its UI work and a Replay thread which does all of the OpenGL rendering. On Mac calls to the OS windowing libraries must only be made on the main thread which is at odds with how the RenderDoc UI is implemented and wants to work…

Leave a comment