# NGFX Graphics Framework
NGFX is a low level graphics framework, providing an abstraction API on
top of Vulkan, DirectX12, and Metal. It exposes the benefits of
next-generation graphics technology via a common platform abstraction
API, with minimal programming complexity. It also supports optional
access to the backend data structures, enabling platform specific
optimizations.
---
## Source Code
<https://github.com/gopro/ngfx>
---
## High Level Architecture
![High Level Architecture](doc/high_level_arch.svg)
---
## Low Level Architecture
![Low Level Architecture](doc/low_level_arch.svg)
The ngfx graphics classes provide high-level abstractions on top of
various graphics objects, including Buffer, Texture, Renderpass,
Swapchain, Surface, CommandBuffer, etc. Each backend (Vulkan, Metal,
DirectX12) is responsible for implementing the high-level abstraction
interface via a subclass.
The user can construct 3D graphics commands using these high-level
abstractions. Optionally, the user can access the backend-specific
data by casting the high-level object to a backend-specific subclass.
For example:
```
Buffer *buffer = Buffer::create(...);
VKBuffer *vkBuffer = (VKBuffer*)buffer;
```
From there, the user can access platform specific data, including the
underlying Vulkan buffer object, etc. This provides a high degree of
flexibility, where the user can primarily use platform-agnostic code,
while still being able to use platform-specific code for
high-performance optimizations, and for achieving optimal interaction
with the platform.
## Modules
![Modules](doc/low_level_arch_2.svg)
| Module | Description |
| ------ | ----------- |
| ComputePipeline | Programs the modules on the GPU related to compute operations. In particular, defines the compute shader input and various portions of the GPU pipeline layout.
| ComputeShader | Defines a programmable shader that can perform arbitrary computation.
| ComputeOp | Defines the base interface for compute operations. Provides support for performing one or more compute operations. Describes the inputs, outputs, intermediate buffers, and layout transitions.
| ComputeApplication | A helper class for creating an application that performs compute operations.
| GraphicsPipeline | Defines the input to the shader stages (vertex, fragment, geometry, tessellation, etc), and GPU pipeline layout.
| DrawOp | Defines the base class for draw operations.
| RenderPass | Provides support for performing one or more draw operations. Describes the inputs, outputs, intermediate buffers, and layout transitions.
| GraphicsCore | Defines various graphics data types such as BlendOp, BlendFactor, etc.
| FilterOp | Defines the base interface for image filters.
| MeshData | Defines the data for a 3D mesh.
| MeshUtil | Provides various mesh utility functions.
| Graphics | Defines various graphics commands via a high level abstraction API. Also provides various profiling functions.
| Surface | Defines a high-level abstraction for a platform surface. A surface is essentially a buffer of memory along with an associated pixel format.
| Texture | Defines a high-level abstraction for a GPU texture. A texture consists of an organized array of texels along with the texture format. In addition, a texture supports random sampling on the GPU. Supports various types of textures including 2D, 3D, 2D arrays, cubemaps, etc. Also supports mipmapping.
| Pipeline | Programs the GPU pipeline modules, including the input assembler, shader stages, rasterizer, blend parameters, etc.
| Fence | Supports GPU-CPU synchronization. Notifies the CPU when some operation on the GPU is completed.
| Camera | Provides an orbital camera that supports pan / tilt / zoom. Supports keyboard, mouse, and touch input
| ShaderModule | Defines the base class for programmable shader modules. A programmable shader allows the user to write code in a high-level shading language that performs arbitrary graphics or computation on the GPU. Supports precompiled shaders for optimal performance. Also supports runtime shader compilation although this usage is discouraged. Supports GLSL (in Vulkan backend), HLSL (in DirectX12 backend) and MSL (in Metal backend), along with the associated precompiled formats (spirv, dxc, metallib). The user can either program in a platform-specific shading language, or program in GLSL and the code can be auto-converted to HLSL / MSL for other platforms (see ShaderTools).
| ShaderTools | Provides support for auto-converting GLSL to HLSL / MSL. Uses spirv-cross internally to convert the shaders. Supports offline shader conversion for optimal performance and more importantly, validation. Also supports runtime shader conversion although this usage is discouraged.
| VertexShaderModule | Defines the shader input to the vertex shader module.
| FragmentShaderModule | Defines the shader input to the fragment shader module.
| ComputeShaderModule | Defines the shader input to the compute shader module
| Semaphore | Support GPU-GPU synchronization. Synchronizes GPU operations within or across command queues. The main difference between fences and semaphores is that fences can be accessed from your program (on the CPU) while semaphores are only accessible within the GPU.
| Barrier |
| GraphicsContext |
| Device | Defines a logical abstraction for a GPU device. Also has logic to query the devices in the system and choose the device based on capabilities, although this logic will probably be moved.
| Queue | Defines a logical abstraction for a GPU queue. Commands are recorded to CommandBuffers and submitted to the GPU via queues. Queues can support up to 3 uses: compute, transfer, and graphics.
| Swapchain | Manages a set of images (typically 2 or 3) that are presented to the display. Supports various present modes.
| Framebuffer | Supports rendering to one or more textures via attachments.
| Window | Provides a high-level window abstraction, and has logic for creating the window and handling resizing, input events, etc. NGFX currently supports various window backends: glfw, Windows, appkit, etc. NGFX also supports rendering directly to a surface (which can be existing window surface or an offscreen surface).
| CommandBuffer | Supports recording multiple commands and submitting them to the GPU. Supports both primary and secondary command buffers. Secondary command buffers can be recorded in parallel, using multiple threads, and added to a primary command buffer.
| Buffer | Supports GPU buffers. A buffer is an unorganized block of data. The same buffer can support multiple usage scenarios, including storing uniform data, vertex buffer data, index buffer data, etc. On shared memory architectures, supports shared CPU/GPU access. For discrete GPUs, supports uploading / downloading to dedicated GPU memory.
| BufferUtil | Provides various helper functions for creating specialized buffers.
| Config | Defines various configuration options.
| Application | Defines the base class for an application interface, which is an optional module that simplifies creating an application.
| File | Supports file operations.
| StringUtil | Supports various string operations.
| RegexUtil | Provides various regex utility functions.
| Timer | Provides a basic timer that measures elapsed time.
| FPSCounter | Supports measing FPS (frames per second).
| Util | Various utility functions.
| InputListener | Defines the base interface for an object that can respond to input events.
| InputMap | Provides a common abstraction for input codes (such as key codes).
---
## Build Instructions
**1) Install Dependencies**
1.1) Install Platform-Specific Dependencies
*On Windows 10 (or newer):*
Install Microsoft Visual Studio 2019 (or newer)
Install PowerShell Core version 7.1.3 (or newer)
*On Linux (Ubuntu 20.04.1 or newer, other Linux dist
没有合适的资源?快使用搜索试试~ 我知道了~
基于 Vulkan、DirectX 12 和 Metal 的高性能图形抽象 API,具有简化的编程模型 .zip
共382个文件
h:164个
cpp:105个
png:37个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 139 浏览量
2024-11-27
20:03:43
上传
评论
收藏 648KB ZIP 举报
温馨提示
基于 Vulkan、DirectX 12 和 Metal 的高性能图形抽象 API,具有简化的编程模型。NGFX 图形框架NGFX 是一个低级图形框架,在 Vulkan、DirectX12 和 Metal 之上提供抽象 API。它通过通用平台抽象 API 展示了下一代图形技术的优势,同时将编程复杂性降至最低。它还支持对后端数据结构的可选访问,从而实现特定于平台的优化。源代码https://github.com/gopro/ngfx高级架构低级架构ngfx 图形类在各种图形对象之上提供高级抽象,包括 Buffer、Texture、Renderpass、Swapchain、Surface、CommandBuffer 等。每个后端(Vulkan、Metal、DirectX12)负责通过子类实现高级抽象接口。用户可以使用这些高级抽象构造 3D 图形命令。或者,用户可以通过将高级对象转换为后端特定的子类来访问后端特定的数据。例如Buffer *buffer = Buffer::create(...);VKBuffer *vkBuffer = (VKBuff
资源推荐
资源详情
资源评论
收起资源包目录
基于 Vulkan、DirectX 12 和 Metal 的高性能图形抽象 API,具有简化的编程模型 .zip (382个子文件)
matrixMultiply.comp 949B
convolve.comp 809B
testComputeSum.comp 523B
testTranspose.comp 397B
ShaderTools.cpp 32KB
D3DTexture.cpp 27KB
D3DGraphics.cpp 19KB
VKTexture.cpp 18KB
VKGraphicsContext.cpp 16KB
D3DGraphicsPipeline.cpp 12KB
Main.cpp 11KB
VKGraphicsPipeline.cpp 11KB
D3DGraphicsContext.cpp 11KB
VKGraphics.cpp 11KB
Main.cpp 11KB
VKSwapchain.cpp 8KB
D3DBuffer.cpp 7KB
WWindow.cpp 7KB
VKDevice.cpp 6KB
VKBuffer.cpp 6KB
VKPhysicalDevice.cpp 5KB
ShaderModule.cpp 5KB
FileUtil.cpp 5KB
Main.cpp 5KB
D3DFramebuffer.cpp 5KB
BaseApplication.cpp 5KB
VKImage.cpp 5KB
D3DBlitOp.cpp 4KB
D3DPipelineUtil.cpp 4KB
VKQueue.cpp 4KB
Main.cpp 4KB
D3DSwapchain.cpp 4KB
GLFWWindow.cpp 4KB
D3DShaderModule.cpp 4KB
Main.cpp 4KB
D3DComputePipeline.cpp 3KB
DrawMeshOp.cpp 3KB
Main.cpp 3KB
FilterOp.cpp 3KB
DrawTextureOp.cpp 3KB
VKInstance.cpp 3KB
VKComputePipeline.cpp 3KB
MatrixMultiplyGPUOp.cpp 3KB
VKFramebuffer.cpp 3KB
D3DDescriptorHeap.cpp 3KB
VKDebugMessenger.cpp 3KB
MeshUtil.cpp 3KB
VKShaderModule.cpp 3KB
MatrixMultiplyCPUOp.cpp 3KB
D3DCommandQueue.cpp 3KB
DrawColorOp.cpp 2KB
ConvolveGPUOp.cpp 2KB
GraphicsPipeline.cpp 2KB
TextureUtil.cpp 2KB
BlendUtil.cpp 2KB
ComputeApplication.cpp 2KB
VKDescriptorSetLayoutCache.cpp 2KB
D3DDevice.cpp 2KB
ComputeUtil.cpp 2KB
RDGPUCapture.cpp 2KB
D3DPipeline.cpp 2KB
VKDebugUtil.cpp 2KB
VKRenderPass.cpp 2KB
Main.cpp 2KB
MeshTool.cpp 2KB
Camera.cpp 2KB
D3DRenderPass.cpp 2KB
VKBlit.cpp 2KB
D3DFence.cpp 2KB
VKImageView.cpp 2KB
VKSemaphore.cpp 2KB
VKCommandBuffer.cpp 2KB
D3DCommandList.cpp 2KB
ImageUtil.cpp 2KB
FormatUtil.cpp 2KB
VKPipeline.cpp 2KB
Main.cpp 2KB
D3DSampler.cpp 2KB
VKFence.cpp 2KB
UnitTest.cpp 2KB
VKCommandPool.cpp 1KB
D3DSamplerDesc.cpp 1KB
File.cpp 1KB
Main.cpp 1KB
VKPipelineCache.cpp 1KB
VKQueryPool.cpp 1KB
RegexUtil.cpp 1KB
StringUtil.cpp 1KB
D3DReadbackBuffer.cpp 1KB
D3DQueryHeap.cpp 1KB
Main.cpp 1KB
VKSurface.cpp 1KB
Timer.cpp 1KB
PipelineCache.cpp 1KB
FilterUtil.cpp 1KB
FPSCounter.cpp 1KB
ComputePipeline.cpp 1KB
D3DSurface.cpp 1KB
compile_shaders_dx12.cpp 1KB
ProcessUtil.cpp 1KB
共 382 条
- 1
- 2
- 3
- 4
资源评论
徐浪老师
- 粉丝: 8209
- 资源: 9366
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功