{"id":13732344,"url":"https://github.com/amethyst/rendy","last_synced_at":"2025-05-14T19:10:20.558Z","repository":{"id":32704566,"uuid":"140871078","full_name":"amethyst/rendy","owner":"amethyst","description":"State of the art \"build your own engine\" kit powered by gfx-hal","archived":false,"fork":false,"pushed_at":"2022-11-14T14:04:02.000Z","size":2069,"stargazers_count":820,"open_issues_count":54,"forks_count":98,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-05-14T08:57:33.697Z","etag":null,"topics":["ash","gamedev","gfx-rs","graphics","renderer","rust","vulkan"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amethyst.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://amethyst.rs/donate"],"open_collective":"amethyst"}},"created_at":"2018-07-13T16:43:38.000Z","updated_at":"2025-05-09T22:13:46.000Z","dependencies_parsed_at":"2023-01-14T21:59:41.147Z","dependency_job_id":null,"html_url":"https://github.com/amethyst/rendy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Frendy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Frendy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Frendy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amethyst%2Frendy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amethyst","download_url":"https://codeload.github.com/amethyst/rendy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254131260,"owners_count":22019910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ash","gamedev","gfx-rs","graphics","renderer","rust","vulkan"],"created_at":"2024-08-03T02:01:53.751Z","updated_at":"2025-05-14T19:10:18.719Z","avatar_url":"https://github.com/amethyst.png","language":"Rust","readme":"\n\n\u003cp align=\"left\"\u003e\n  \u003cimg src=\"docs/logo.png\" width=\"128px\"/\u003e\n\u003c/p\u003e\n\n[![Build Status][s1]][tc]\n[![Crates.io][s2]][ci]\n[![docs page][docs-badge]][docs]\n[![MIT/Apache][s3]][li]\n![Lines of Code][s4]\n\n[s1]: https://travis-ci.org/amethyst/rendy.svg?branch=master\n[s2]: https://img.shields.io/crates/v/rendy.svg\n[docs-badge]: https://img.shields.io/badge/docs-website-blue.svg\n[docs]: https://docs.rs/rendy\n[s3]: https://img.shields.io/badge/license-MIT%2FApache-blue.svg\n[s4]: https://tokei.rs/b1/github/amethyst/rendy?category=code\n[tc]: https://travis-ci.org/amethyst/rendy\n[ci]: https://crates.io/crates/rendy/\n[li]: COPYING\n\nA rendering engine based on [`gfx-hal`], which mimics the [`Vulkan`] API.\n\n## Building\n\nThis library requires standard build tools for the target platforms, except in the case of windows - the spirv-compiler feature requires Ninja to be installed for compilation. https://ninja-build.org\n\n## Features\n\nMost importantly `rendy` features safer API by checking important states and invariants.\nIt checks invariants statically using marker types and dynamically with stored values.\n\n### Capability\n\nQueue family capability defines what operation queues of the family supports.\n`rendy` provides simple mechanisms to prevent recording unsupported commands.\nA queue's capability level can be stored statically by marking the `Family` type with one of capability types: `Transfer`, `Graphics`, `Compute` or `General` (`Graphics` and `Compute` combined).\nAlternatively the `Capability` type can be used instead of the marker type, this way actual capability level can be checked dynamically.\n\n### Command buffer\n\n`rendy` provides a handy wrapper named `CommandBuffer`. In contrast to its raw counterpart this wrapper\nencodes crucial information about its state directly into the type.\nThis means users can't accidentally:\n* record commands unsupported by queue family it belongs to.\n* record commands when a command buffer is not in recording state.\n* record render pass commands outside renderpass.\n* forget to finish recording a buffer before submitting.\n* resubmit a command buffer which was created for one time use.\n* record execution of a primary buffer into a secondary buffer.\n* etc\n\n### Memory manager\n\n`rendy`'s memory manager is called `Heaps`.\n`Heaps` provides convenient methods to sub-allocate device-visible memory based on usage and visibility requirements. It also handles mapping for specific usage types.\n**It is possible for [`gfx-hal`] to adopt [VMA]. In which case `rendy` will use it**\n\n### Rendergraph\n\n`rendy`'s rendergraph allows writing rendering code in simple modular style.\nNote that this is not a scene graph offered by high-level graphics libraries, where nodes in\nthe graph correspond to complex objects in the world.  Instead it is a graph of render passes\nwith different properties.\nThis makes it much easier to compose a complex frame from simple parts.\nA user defines nodes which declare which buffers and images it reads and writes and\nthe rendergraph takes responsibility for transient resource allocation and execution synchronization.\nThe user is responsible only for intra-node synchronization.\n\n`DynNode` implementation - `RenderPassNode` can be constructed from `RenderGroup`s collected into subpasses.\n`RenderPassNode` will do all work for render pass creating and inter-subpass synchronization.\nThere will be more `Node`, `DynNode` and `RenderGroup` implementations to further simplify usage and reduce boilerplate code required for various use cases.\n\n### Cirques\n\nThis hybrid of circus and queue simplifies synchronizing host access to resources.\n`Cirque` allocates copies of the resource from resource specific allocator\n(e.g. `CommandPool` for `CommandBuffer`s, `Factory` for `Buffer`s)\nand gives access to the unused copy.\n\n### CPU-GPU data flow\n\nRendy can help to send data between device and host.\nThe `Factory` type can upload data to the device local memory choosing most appropriate technique for that.\n* Memory mapping will be used if device local memory happens to be cpu-visible.\n* Relatively small data will be uploaded directly to buffers.\n* Staging buffer will be used for bigger uploads or any image uploads.\n`Factory` will automatically insert synchronization commands according to user request.\n\n### GPU-CPU data flow - **Not yet implemented**\n\n### Data driven pipelines - **WIP**\n\nWe think it is possible in many common cases to feed GPU with data in semi-automatic mode.\n`rendy::graph::node::render::RenderGroup` implementation will use `spirv-reflect` (or similar crate) to read layout information directly from shaders\nand use it to automatically populate descriptors and set index/vertex buffers based on registered data encoders and provided scene instance.\nCurrent *WIP* implementation will use `specs::World` as scene to render.\n\n### Declarative pipelines - ***Planned***\n\nPipelines and descriptor sets has declarative nature and it is much easier to define them declaratively.\n`rendy` provides a trait for this called `DescriptorSet`.\nDeriving it will automatically generate code necessary for set creation, writing and binding.\nDeriving the `GraphicsPipeline` trait will generate code for graphics pipeline creation and usage.\nA similar `ComputePipeline` trait exists for compute pipelines.\n\n#### Example\n\n```rust\n#[derive(DescriptorSet)]\nstruct Example {\n    /// This field will be associated with binding 1 of type `VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER`.\n    /// Actual `Buffer` will be allocated and kept updated by `Set\u003cExample\u003e`.\n    #[descriptor(UniformBlock)]\n    transform: mat4,\n\n    /// This field will be associated with binding 2 of type `VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE`.\n    /// `ImageView` will be fetched from `Texture` which implements `Borrow\u003cImageView\u003e`.\n    #[descriptor(SampledImage)]\n    texture: Texture,\n\n    /// Raw `gfx-hal` objects can be used as well.\n    /// But this field will make binding `Set\u003cExample\u003e` to a command buffer an unsafe operation\n    /// since it is the user's job to ensure that this raw image view is valid during command buffer execution.\n    #[descriptor(unsafe, SampledImage)]\n    foo: RawImageView,\n}\n```\n\n### Modularity\n\nMost of the features provided by rendy can be used independently from each other\nThis helps to keep API clean and hopefully sound.\nThe top-level umbrella crate `rendy` has features for each subcrate so that they could be\nenabled separately (enabling a subcrate will also enable its dependencies).\n\n## [Changelog]\n\n## Who is using it?\n\n* The [`Amethyst`](https://github.com/amethyst/) project\n* [wgpu-rs](https://github.com/gfx-rs/wgpu-rs)\n\nKindly open a PR or issue if you're aware of other projects using `rendy`.\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0, ([license/APACHE](license/APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n* MIT license ([license/MIT](license/MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n[`gfx-hal`]: https://github.com/gfx-rs/gfx\n[`gfx-memory`]: https://github.com/gfx-rs/gfx-memory\n[`gfx-render`]: https://github.com/gfx-rs/gfx-render\n[`gfx-mesh`]: https://github.com/omni-viral/gfx-mesh\n[`gfx-texture`]: https://github.com/omni-viral/gfx-texture\n[`xfg`]: https://github.com/omni-viral/xfg-rs\n[`Vulkan`]: https://www.khronos.org/vulkan/\n[`Vulkan`-portability]: https://www.khronos.org/vulkan/portability-initiative\n[`Amethyst`]: https://github.com/amethyst/amethyst\n[VMA]: https://gpuopen.com/gaming-product/vulkan-memory-allocator/\n[Changelog]: CHANGELOG.md\n","funding_links":["https://amethyst.rs/donate","https://opencollective.com/amethyst"],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famethyst%2Frendy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famethyst%2Frendy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famethyst%2Frendy/lists"}