AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing DiligentGraphics/DiligentCore in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewDiligent Core Diligent Core is a modern, cross-platform low-level graphics API that forms the foundation of Diligent Engine. It provides implementations for Direct3D11, Direct3D12, OpenGL, OpenGLES, Vulkan, and WebGPU rendering backends. A Metal backend is also available for commercial clients. In addition, the module includes essential platform-specific utilities. Diligent Core is fully self-contained and can be built independently of the rest of the engine. For details on supported platforms, features, and build instructions, please refer to the main repository. | Platform | Build Status | | ---------------------| ------------- | | Win32 | | | Universal Windows | | | Linux | | | Android | | | MacOS | | | iOS | | | tvOS | | | Web | | Table of Contents • Cloning the Repository • API Basics • Initializing the Engine • Win32 • Universal Windows Platform • Linux • MacOS • Android • iOS • Web • Destroying the Engine • Creating Resources • Creating Shaders • Initializing Pipeline State • Pipeline Resource Layout • Binding Shader Resources • Setting the Pipeline State and Invoking Draw Command • Low-level API interoperability • NuGet package build instructions • License • Contributing • Release History Cloning the Repository To get the repository and all submodules, use the following command: To build the module, see build instructions in the master repository. API Basics Initializing the Engine Before you can use any functionality provided by the engine, you need to create a render device, an immediate context and a swap chain. Win32 On Win32 platform, you can create OpenGL, Direct3D11, Direct3D12 or Vulkan device as shown below: On Windows, the engine can be statically linked to the application or built as a separate DLL. In the first case, factory functions , , , and can be called directly. In the second case, you need to load the DLL into the process's address space using , , , or function. Each function loads appropriate dynamic library and imports the functions required to initialize the engine. You need to include the following headers: You also need to add the following directories to the include search paths: • • • • As an alternative, you may only add the path to the root folder and then use include paths relative to it. Enable namespace: , , and functions can also create a specified number of immediate and deferred contexts, which can be used for asynchronous rendering and multi-threaded command recording. The contexts may only be created during the initialization of the engine. The function populates an array of pointers to the contexts, where the immediates contexts go first, followed by all deferred contexts. For more details, take a look at Tutorial00_HelloWin32.cpp file. Universal Windows Platform On Universal Windows Platform, you can create Direct3D11 or Direct3D12 device. Initialization is performed the same way as on Win32 Platform. The difference is that you first create the render device and device contexts by calling or . The swap chain is created later by a call to or . Please look at SampleAppUWP.cpp file for more details. Linux On Linux platform, the engine supports OpenGL and Vulkan backends. Initialization of GL context on Linux is tightly coupled with window creation. As a result, Diligent Engine does not initialize the context, but attaches to the one initialized by the app. An example of the engine initialization on Linux can be found in Tutorial00_HelloLinux.cpp. MacOS On MacOS, Diligent Engine supports OpenGL, Vulkan and Metal backends. Initialization of GL context on MacOS is performed by the application, and the engine attaches to the context created by the app; see GLView.mm for details. Vulkan backend is initialized similar to other platforms. See MetalView.mm. Android On Android, you can create OpenGLES or Vulkan device. The following code snippet shows an example: If the engine is built as dynamic library, the library needs to be loaded by the native activity. The following code shows one possible way: iOS iOS implementation supports OpenGLES, Vulkan and Metal backend. Initialization of GL context on iOS is performed by the application, and the engine attaches to the context initialized by the app; see EAGLView.mm for details. Web On the Web, you can create OpenGLES or WebGPU device. The following code snippet shows an example: If you are using SDL or GLFW with existing context, you can provide null as the native window handle: Destroying the Engine The engine performs automatic reference counting and shuts down when the last reference to an engine object is released. Creating Resources Device resources are created by the render device. The two main resource types are buffers, which represent linear memory, and textures, which use memory layouts optimized for fast filtering. To create a buffer, you need to populate structure and call . The following code creates a uniform (constant) buffer: Similar, to create a texture, populate structure and call as in the following example: There is only one function that is capable of creating all types of textures. Type, format, array size and all other parameters are specified by the members of the structure. For every bind flag specified during the texture creation time, the texture object creates a default view. Default shader resource view addresses the entire texture, default render target and depth stencil views reference all array slices in the most detailed mip level, and unordered access view references the entire texture. To get a default view from the texture, use function. Note that this function does not increment the reference counter of the returned interface. You can create additional texture views using . Use to create additional views of a buffer. Creating Shaders To create a shader, populate structure: There are three ways to create a shader. The first way is to provide a pointer to the shader source code through member. The second way is to provide a file…