-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore/remove bytemuck from renderling shader (#70)
* parted out slab into slabcrab * parted out slab into crabslab * parted out slab into crabslab * Update README.md * readme * WIP part out crabslab, remove non-slab shaders, remove bloom (to be reimplemented later) * WIP * img-diff takes into account pixel threshold and image threshold * fixed problems with the skybox after slabbing * fixed tests to use explicit linear transfer where appropriate
- Loading branch information
Showing
86 changed files
with
2,368 additions
and
3,807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/renderling-derive/Cargo.toml → crates/crabslab-derive/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "renderling-derive" | ||
name = "crabslab-derive" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[package] | ||
name = "crabslab" | ||
version = "0.1.0" | ||
edition = "2021" | ||
description = "Slab allocator focused on GPU compute (rust-gpu)" | ||
repository = "https://github.com/schell/renderling" | ||
license = "MIT OR Apache-2.0" | ||
keywords = ["game", "graphics", "shader", "rendering"] | ||
categories = ["rendering", "game-development", "graphics"] | ||
readme = "README.md" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[features] | ||
default = ["wgpu", "glam", "futures-lite"] | ||
futures-lite = ["dep:futures-lite"] | ||
glam = ["dep:glam"] | ||
wgpu = ["dep:wgpu", "dep:bytemuck", "dep:snafu", "dep:async-channel", "dep:log"] | ||
|
||
[dependencies] | ||
async-channel = {workspace=true, optional=true} | ||
bytemuck = {workspace=true, optional=true} | ||
futures-lite = {workspace=true, optional=true} | ||
log = {workspace=true, optional=true} | ||
crabslab-derive = { version = "0.1.0", path = "../crabslab-derive" } | ||
snafu = {workspace=true, optional=true} | ||
wgpu = {workspace=true, optional=true} | ||
|
||
[target.'cfg(not(target_arch = "spirv"))'.dependencies] | ||
glam = { workspace = true, features = ["std"], optional = true } | ||
|
||
[target.'cfg(target_arch = "spirv")'.dependencies] | ||
glam = { version = "0.24.2", default-features = false, features = ["libm"], optional = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div align="center"> | ||
<img src="crabslab.png" alt="slabcraft for crabs" width="512" /> | ||
</div> | ||
|
||
## what | ||
`crabslab` is a slab implementation focused on marshalling data from CPUs to GPUs. | ||
|
||
## why | ||
### Opinion | ||
Working with shaders is much easier using a slab. | ||
|
||
### rust-gpu | ||
This crate was made to work with [`rust-gpu`](https://github.com/EmbarkStudios/rust-gpu/). | ||
Specifically, using this crate it is possible to pack your types into a buffer on the CPU | ||
and then read your types from the slab on the GPU (in Rust). | ||
|
||
### Other no-std platforms | ||
Even though this crate was written with `rust-gpu` in mind, it should work in other `no-std` | ||
contexts. | ||
|
||
## how | ||
`crabslab` includes: | ||
* a few traits: | ||
- `Slab` | ||
- `GrowableSlab` | ||
- `SlabItem` | ||
* a derive macro for `SlabItem` | ||
* a few structs for working with various slabs | ||
- `Id` | ||
- `Array` | ||
- `Offset` | ||
* a helper struct `CpuSlab` | ||
* a feature-gated helper for using slabs with `wgpu` - `WgpuBuffer` | ||
- [example](src/wgpu_slab.rs#L344) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#![cfg_attr(target_arch = "spirv", no_std)] | ||
//! Creating and crafting a tasty slab of memory. | ||
mod array; | ||
pub use array::*; | ||
|
||
mod id; | ||
pub use id::*; | ||
|
||
mod slab; | ||
pub use slab::*; | ||
|
||
#[cfg(feature = "wgpu")] | ||
mod wgpu_slab; | ||
#[cfg(feature = "wgpu")] | ||
pub use wgpu_slab::*; | ||
|
||
pub use crabslab_derive::SlabItem; |
Oops, something went wrong.