Skip to content

Commit

Permalink
Switch from distill to hydrate (#256)
Browse files Browse the repository at this point in the history
 - Implement new importers/builders for hydrate, remove distill importers/builders
 - Remove basic mesh rendering path, not planning to re-implemented new importers/builders for it
  • Loading branch information
aclysma authored Mar 2, 2024
1 parent 65c5dc3 commit 544110e
Show file tree
Hide file tree
Showing 641 changed files with 11,698 additions and 13,013 deletions.
52 changes: 20 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,99 +4,87 @@ on: [push, pull_request]

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0

jobs:
build:
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta]
os: [windows-2019, ubuntu-20.04, macos-11]
os: [windows-2022, ubuntu-22.04, macos-12]
exclude:
- os: macos-11
- os: macos-12
toolchain: beta
- os: windows-2019
- os: windows-2022
toolchain: beta

runs-on: ${{ matrix.os }}
needs: clean
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
override: true

- uses: actions/cache@v2
with:
path: |
target
key: ${{ runner.os }}-cargo-check-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- uses: Swatinem/rust-cache@v2

- name: Install XCB and GL dependencies
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install libx11-xcb-dev libgl1-mesa-dev
if: contains(matrix.os, 'ubuntu')
- name: Build
run: cargo check --features "rafx-vulkan" --manifest-path demo/Cargo.toml
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"

- name: Build
run: cargo check --no-default-features --features "rafx-vulkan,basic-pipeline,use-egui" --manifest-path demo/Cargo.toml
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"

- name: Run tests (vulkan)
run: cargo test --workspace --features "rafx-vulkan" --manifest-path demo/Cargo.toml
if: ${{ runner.os == 'Linux' && matrix.toolchain == 'stable' }}
run: cargo test --workspace --features "rafx-vulkan" --manifest-path demo/Cargo.toml
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"

- name: Run tests (metal)
run: cargo test --workspace --features "rafx-metal" --manifest-path demo/Cargo.toml
if: ${{ runner.os == 'macOS' && matrix.toolchain == 'stable' }}
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
run: cargo test --workspace --features "rafx-metal" --manifest-path demo/Cargo.toml
# SDL2 does not build warning-free on macos so we can't use -D warnings

- name: Run tests (gles2)
run: cargo test --workspace --features "rafx-gles2,basic-pipeline,cli/basic-pipeline" --manifest-path demo/Cargo.toml
if: ${{ runner.os == 'Linux' && matrix.toolchain == 'stable' }}
run: cargo test --workspace --features "rafx-gles2,basic-pipeline" --manifest-path demo/Cargo.toml
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"

- name: Run tests (gles3)
run: cargo test --workspace --features "rafx-gles3,basic-pipeline,cli/basic-pipeline" --manifest-path demo/Cargo.toml
if: ${{ runner.os == 'Linux' && matrix.toolchain == 'stable' }}
run: cargo test --workspace --features "rafx-gles3,basic-pipeline" --manifest-path demo/Cargo.toml
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"


deny-check:
name: cargo-deny
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}

clean:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
override: true

- name: Check the format
run: cargo fmt --all -- --check
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Cargo.lock
/demo/assets_unprocessed/private
/demo/art/bistro/**
/demo/assets/bistro/*/*
/rafx-plugins/processed_shaders/**
/rafx-plugins/processed_shaders/**
/demo-editor/data/
40 changes: 24 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ members = [
"rafx-assets",
"rafx-plugins",
"demo",
"demo/cli",
"demo-schema",
"demo-editor",
"demo-web"
]

exclude = [

]

# Example of overriding a single crate. Doesn't affect dependencies though so it's of limited value
#[profile.dev.package.image]
#opt-level = 2
resolver = "2"

# Set the default for dependencies.
# Optimize external crates by default, even in debug
[profile.dev.package."*"]
opt-level = 2

# Don't optimize hydrate packages in dev
[profile.dev.package.hydrate-loader]
opt-level = 0
[profile.dev.package.hydrate-base]
opt-level = 0

# Set the settings for build scripts and proc-macros.
[profile.dev.build-override]
opt-level = 2
Expand All @@ -34,20 +39,23 @@ opt-level = 2
[profile.dev]
split-debuginfo = "unpacked"

# Required for https://github.com/gltf-rs/gltf/pull/288
#[patch.crates-io]
#gltf = { path = "gltf" }

#[patch."https://github.com/amethyst/distill"]

[patch.crates-io]
#raw-gl-context = { git = "https://github.com/aclysma/raw-gl-context.git", branch = "rafx" }
#basis-universal = { path = "../basis-universal-rs/basis-universal" }
#basis-universal-sys = { path = "../basis-universal-rs/basis-universal-sys" }

#distill = { path = "../distill" }
#distill = { git = "https://github.com/amethyst/distill.git", rev = "852e48272ab3dad76c7490fce8df52461f94ebc0" }
distill = { git = "https://github.com/aclysma/distill.git", rev = "9e127ca9d034e0c7dffb747f8aae3a2607b0e1e8" }

#spirv_cross = { path = "../spirv_cross/spirv_cross" }
spirv_cross = { git = "https://github.com/aclysma/spirv_cross.git", branch = "rafx-support" }
#spirv_cross = { git = "https://github.com/aclysma/spirv_cross.git", branch = "rafx-support" }
#spirv_cross = { path = "../aclysma_spirv_cross/spirv_cross", package = "aclysma_spirv_cross" }

#hydrate-base = { path = "../hydrate/hydrate-base" }
#hydrate-schema = { path = "../hydrate/hydrate-schema" }
#hydrate-data = { path = "../hydrate/hydrate-data" }
#hydrate-model = { path = "../hydrate/hydrate-model" }
#hydrate-pipeline = { path = "../hydrate/hydrate-pipeline" }
#hydrate-editor = { path = "../hydrate/hydrate-editor" }
#hydrate-loader = { path = "../hydrate/hydrate-loader" }
#hydrate-codegen = { path = "../hydrate/hydrate-codegen" }
#hydrate = { path = "../hydrate/hydrate" }


22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ This crate contains several layers:
* `rafx-renderer`: A pipelined renderer with a plugin system for customizing it
* `rafx-plugins`: Implementations of many basic and advanced rendering techniques and features

Rafx also provides tools for building shaders and packing assets.
Rafx also provides tools for building shaders and assets.

### [**Documentation**](docs/index.md)

[![Build Status](https://github.com/aclysma/rafx/workflows/CI/badge.svg)](https://github.com/aclysma/rafx/actions)

[![Sci-fi Base Screenshot](docs/screenshots/scifi_base_screenshot_thumb.jpg)](docs/screenshots/scifi_base_screenshot.png)

![Editor](docs/screenshots/editor.png)

[![Amazon Lumberyard Bistro Screenshot](docs/screenshots/bistro_screenshot_thumb.jpg)](docs/screenshots/bistro_screenshot.png)

Amazon Lumberyard Bistro scene (Original assets: https://developer.nvidia.com/orca/amazon-lumberyard-bistro)
Expand All @@ -38,20 +40,20 @@ Amazon Lumberyard Bistro scene (Original assets: https://developer.nvidia.com/or

Rafx supports most mainstream platforms. Proprietary platforms can be supported by adding an additional backend.

| Platform | Vulkan | Metal | GL ES 2.0 (4,6) | GL ES 3.0 (4,5,6) |
| --------- | -------- | ----- | --------------- | ----------------- |
| Windows || | ||
| macOS ||| ||
| Linux | ✅ (1) | | ✅ (1) | ✅ (1) |
| iOS ||| 🟥 (3) | 🟥 (3) |
| Android | 🟨 (2) | | 🟥 (3) | 🟥 (3) |
| WebGL (6) | | | ||
| Platform | Vulkan | Metal | DX12 | GL ES 3.0 (4,5,6) |
| --------- | -------- | ----- |-----| ----------------- |
| Windows || | ||
| macOS ||| ||
| Linux | ✅ (1) | | | ✅ (1) |
| iOS ||| | 🟥 (3) |
| Android | 🟨 (2) | | | 🟥 (3) |
| WebGL (6) | | | ||

**Caveats**:
1. Some backend/driver/window manager combinations might not work. Most recently tested with Ubuntu 20.04 LTS.
2. Android might work with vulkan but has not been tested. (It likely can be made to work)
3. Mobile OpenGL devices might work but may need improvements to create the initial OpenGL graphics context.
4. Limitations in the OpenGL ES 2.0/3.0 API prevent full implementation. The main demo does not work in GL ES 2.0/3.0.
4. Limitations in the OpenGL ES 3.0 API prevent full implementation. The main demo does not fully work in GL ES 2.0/3.0.
5. OpenGL ES 3.0 backend still uses 2.0 paths for some functionality. There is room for improvement!
6. OpenGL/WebGL will not receive much improvement/support going forward.

Expand Down
42 changes: 42 additions & 0 deletions demo-editor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[package]
name = "demo-editor"
version = "0.0.15"
authors = ["Philip Degarmo <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
# This is a demo crate, we shouldn't publish it
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
hydrate = { version = "0.0.2", features = ["editor"] }
rafx = { path = "../rafx", features = ["renderer", "basis-universal", "dds"] }
rafx-plugins = { path = "../rafx-plugins", features = ["legion", "egui", "egui-winit", "modern-pipeline", "meshopt"] }

log = "0.4"
env_logger = "0.6"

profiling = "1.0.1"

[features]
default = [
# Profiling options
#"profile-with-puffin",
#"profile-with-optick",
#"profile-with-tracy",
#"profile-with-tracy-memory", # Cannot be enabled with "stats_alloc".
#"profile-with-superluminal"
]

profile-with-optick = [
"profiling/profile-with-optick",
]
profile-with-superluminal = [
"profiling/profile-with-superluminal",
]
profile-with-tracy = ["profiling/profile-with-tracy"]
profile-with-tracy-memory = [
"profiling/profile-with-tracy",
"profile-with-tracy"
]
Loading

0 comments on commit 544110e

Please sign in to comment.