# gfx-rs/gfx

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/gfx-rs-gfx).**

5,398 stars · 531 forks · Rust · Apache-2.0

## Links

- GitHub: https://github.com/gfx-rs/gfx
- Homepage: http://gfx-rs.github.io/
- awesome-repositories: https://awesome-repositories.com/repository/gfx-rs-gfx.md

## Topics

`dx11` `dx12` `gfx` `gpu` `graphics` `graphics-apis` `metal` `opengl` `rust` `vulkan`

## Description

gfx is a hardware-agnostic graphics API abstraction that translates a unified set of graphics and compute commands into native instructions for multiple GPU drivers. It provides a common interface for cross-platform rendering and general-purpose GPU compute programming.

The project features an intermediate-representation shader translation system that converts source code and SPIR-V into target-specific languages. It employs a data-driven reference test framework to verify that graphics output remains consistent across different hardware platforms.

Capabilities include parallel command buffer encoding across multiple threads and the encapsulation of pipeline states into single objects to minimize redundant state changes. The system manages low-level GPU resources, including memory allocation, asynchronous buffer mapping, and explicit frame presentation via swapchains. 

The implementation targets native environments and web browsers through WebAssembly, providing translation layers for WebGL and WebGL2.

## Tags

### Graphics & Multimedia

- [Graphics API Abstractions](https://awesome-repositories.com/f/graphics-multimedia/graphics-api-abstractions.md) — Provides a hardware-agnostic graphics API abstraction that translates unified commands into native instructions for multiple GPU drivers.
- [Cross-Platform Graphics Frameworks](https://awesome-repositories.com/f/graphics-multimedia/cross-platform-graphics-frameworks.md) — Provides a unified API for writing graphics applications that run consistently across multiple hardware backends.
- [GPU Resource Management](https://awesome-repositories.com/f/graphics-multimedia/gpu-resource-management.md) — Manages the manual allocation, mapping, and lifecycle of buffers, textures, and shaders on the GPU.
- [Cross-Platform Shader Compilers](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/shaders/cross-platform-shader-compilers.md) — Transforms unified shader code into platform-specific binaries to ensure consistent visual output across hardware.
- [Shader Transpilation](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/shaders/shader-cross-compilation-pipelines/runtime-shader-compilers/shader-transpilation.md) — Translates shader source code across different languages and formats using an intermediate representation for target compatibility. ([source](http://gfx-rs.github.io/2020/08/18/release-0.6.html))
- [Graphics Resource Lifetime Management](https://awesome-repositories.com/f/graphics-multimedia/graphics-resource-lifetime-management.md) — Ensures stable destruction of GPU buffers, textures, and devices within non-deterministic garbage-collected environments. ([source](http://gfx-rs.github.io/2023/11/24/arcanization.html))
- [Pipeline State Definitions](https://awesome-repositories.com/f/graphics-multimedia/pipeline-state-definitions.md) — Provides declarative definitions for shader configurations and render states with compile-time type safety. ([source](http://gfx-rs.github.io/2016/01/22/pso.html))
- [Swapchain Management](https://awesome-repositories.com/f/graphics-multimedia/swapchain-management.md) — Coordinates the acquisition and display of rendered images using swapchains to manage color space and synchronization.
- [Graphics API Abstractions](https://awesome-repositories.com/f/graphics-multimedia/video-encoding-and-decoding/graphics-api-abstractions.md) — Abstracts multiple low-level graphics backends through a standardized set of commands for cross-platform compatibility. ([source](http://gfx-rs.github.io/2021/09/16/deno-webgpu.html))
- [Local State Draw Calls](https://awesome-repositories.com/f/graphics-multimedia/draw-call-batching/local-state-draw-calls.md) — Implements a state-passing mechanism that avoids global mutation by providing resource dependencies directly to the draw call. ([source](http://gfx-rs.github.io/2016/09/14/programming-model.html))
- [GPU Pipeline State Controls](https://awesome-repositories.com/f/graphics-multimedia/gpu-pipeline-state-controls.md) — Provides control over global GPU pipeline settings such as depth testing, blending, and stencil operations. ([source](http://gfx-rs.github.io/2014/07/25/intro.html))
- [Graphics API Translation](https://awesome-repositories.com/f/graphics-multimedia/graphics-api-translation.md) — Translates graphics and compute API calls into native hardware backends to enable consistent cross-platform rendering. ([source](http://gfx-rs.github.io/2018/09/03/rpcs3-dolphin.html))
- [Shader Binding Managers](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/shaders/shader-binding-managers.md) — Manages the mapping of host-side data structures to shader variables and ensures type compatibility for GPU uploads. ([source](http://gfx-rs.github.io/2014/08/27/shader-param.html))
- [Render Cycle Management](https://awesome-repositories.com/f/graphics-multimedia/render-cycle-management.md) — Coordinates the flow of draw calls between the application and the GPU to enable concurrent preparation and execution. ([source](http://gfx-rs.github.io/2014/07/25/intro.html))
- [Resource View Mapping](https://awesome-repositories.com/f/graphics-multimedia/resource-view-mapping.md) — Defines multiple ways to interpret a single underlying memory storage as different resource types for flexible data usage.
- [Resource Views](https://awesome-repositories.com/f/graphics-multimedia/resource-views.md) — Allows a single GPU memory resource to be interpreted as multiple different types for flexible data usage. ([source](http://gfx-rs.github.io/2016/09/14/programming-model.html))
- [Surface Presentation Control](https://awesome-repositories.com/f/graphics-multimedia/surface-presentation-control.md) — Controls how rendered frames are presented to the screen using specific modes and texture formats for color space control. ([source](http://gfx-rs.github.io/2022/06/30/release-0.13.html))
- [Web-Based Graphics Acceleration](https://awesome-repositories.com/f/graphics-multimedia/web-based-graphics-acceleration.md) — Renders hardware-accelerated graphics and compute workloads within web browsers using WebGL and WebGPU standards.
- [WebGL Rendering](https://awesome-repositories.com/f/graphics-multimedia/webgl-rendering.md) — Executes graphics commands in web browsers by translating hardware abstraction calls into the WebGL API. ([source](http://gfx-rs.github.io/2021/12/25/this-year.html))
- [WebGL2 Frameworks](https://awesome-repositories.com/f/graphics-multimedia/webgl2-frameworks.md) — Executes graphics and compute workloads in a web browser using the WebGL2 API. ([source](http://gfx-rs.github.io/2021/10/07/release-0.11.html))
- [WebGPU Implementations](https://awesome-repositories.com/f/graphics-multimedia/webgpu-implementations.md) — Executes a portable version of the WebGPU specification for native applications and browser engines. ([source](http://gfx-rs.github.io/2020/11/16/big-picture.html))

### Software Engineering & Architecture

- [Hardware Abstraction Layers](https://awesome-repositories.com/f/software-engineering-architecture/hardware-abstraction-layers.md) — Provides a hardware-agnostic abstraction layer that translates unified graphics commands into platform-specific GPU instructions. ([source](http://gfx-rs.github.io/2017/07/24/low-level.html))
- [Graphics Pipeline State Objects](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/application-layer-architectures/state-management-architectures/immutable-data-strategies/immutable-state-patterns/graphics-pipeline-state-objects.md) — Groups shaders and fixed-function configurations into immutable objects to minimize redundant state changes and ensure type safety.
- [Frame Presentation Management](https://awesome-repositories.com/f/software-engineering-architecture/task-scheduling/asynchronous-schedulers/cooperative-schedulers/rendering-schedulers/frame-presentation-management.md) — Coordinates the acquisition, rendering, and presentation of images to the screen across different graphics backends. ([source](http://gfx-rs.github.io/2019/10/01/update.html))
- [Explicit Presentation Calls](https://awesome-repositories.com/f/software-engineering-architecture/task-scheduling/asynchronous-schedulers/cooperative-schedulers/rendering-schedulers/frame-presentation-schedulers/explicit-presentation-calls.md) — Triggers the display of a rendered frame to the screen through an explicit call rather than implicit destruction. ([source](http://gfx-rs.github.io/2021/10/07/release-0.11.html))
- [GPU Buffer Mappings](https://awesome-repositories.com/f/software-engineering-architecture/zero-copy-buffers/gpu-buffer-mappings.md) — Implements asynchronous mapping of buffers between CPU and GPU memory using a callback system. ([source](http://gfx-rs.github.io/2022/06/30/release-0.13.html))

### Game Development

- [Deferred Command Encoders](https://awesome-repositories.com/f/game-development/engine-architecture/command-buffers/deferred-command-encoders.md) — Records GPU operations into buffers to decouple application logic from submission to the hardware queue for improved throughput.
- [Multithreaded Command Encoding](https://awesome-repositories.com/f/game-development/engine-architecture/multithreaded-command-encoding.md) — Improves frame performance by recording graphics commands across multiple CPU threads simultaneously before submission.

### Hardware & IoT

- [GPU Computations](https://awesome-repositories.com/f/hardware-iot/integration-performance/gpu-performance/gpu-computations.md) — Enables execution of general-purpose computing tasks and data processing workloads on GPUs across different platforms.

### Operating Systems & Systems Programming

- [GPU Memory Allocators](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management/allocation-strategies/dynamic-memory-allocation/gpu-memory-allocators.md) — Implements high-performance GPU memory allocation and tracking using heuristics optimized for various hardware backends. ([source](http://gfx-rs.github.io/2020/08/18/release-0.6.html))

### Programming Languages & Runtimes

- [Shader Translation](https://awesome-repositories.com/f/programming-languages-runtimes/intermediate-representation-translation/shader-translation.md) — Converts shader source code through a common intermediate format to ensure compatibility across different hardware backends.
- [Multi-threaded Command Encoders](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/execution-models/multi-threaded-execution/multi-threaded-command-encoders.md) — Records graphics operations across multiple CPU threads simultaneously to reduce CPU overhead and improve performance.
- [SPIR-V to Native Translation](https://awesome-repositories.com/f/programming-languages-runtimes/spir-v-translators/spir-v-to-native-translation.md) — Converts SPIR-V source code into platform-specific shader languages to ensure compatibility across different graphics backends. ([source](http://gfx-rs.github.io/2019/07/13/javelin.html))

### Data & Databases

- [Buffer Content Updaters](https://awesome-repositories.com/f/data-databases/data-buffering/gpu-buffer-allocators/buffer-content-updaters.md) — Provides utilities to update contents of GPU-resident buffers and textures without manual staging buffer management. ([source](http://gfx-rs.github.io/2020/08/18/release-0.6.html))

### Development Tools & Productivity

- [Backend Consistency Verification](https://awesome-repositories.com/f/development-tools-productivity/data-driven-testing/backend-consistency-verification.md) — Employs a data-driven reference test framework to verify that graphics output remains consistent across different hardware platforms.

### Testing & Quality Assurance

- [Backend Consistency Verifications](https://awesome-repositories.com/f/testing-quality-assurance/backend-consistency-verifications.md) — Uses a data-driven reference test framework to verify that graphics output remains consistent across different hardware platforms. ([source](https://cdn.jsdelivr.net/gh/gfx-rs/gfx@master/README.md))
- [Shader Validation](https://awesome-repositories.com/f/testing-quality-assurance/shader-validation.md) — Analyzes shader expressions and types to detect errors and provide detailed feedback linked to the original source. ([source](http://gfx-rs.github.io/2021/12/25/this-year.html))

### Web Development

- [WebAssembly Graphics Targeting](https://awesome-repositories.com/f/web-development/webassembly-graphics-targeting.md) — Maps graphics API calls to browser-native implementations for execution within a web page via WebAssembly. ([source](http://gfx-rs.github.io/2020/04/21/wgpu-web.html))
