Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
542439c
- macos compiling and shader building with metal backend
polymonster Nov 3, 2025
488a855
- build config macos
polymonster Feb 26, 2026
9e4d1a9
- fix conflicts
polymonster Feb 26, 2026
83dc742
- compo fixes
polymonster Feb 26, 2026
1d22ba4
- bindful working with incorrect offset applied due to push constants
polymonster Feb 26, 2026
212fe7e
- separated vs/ps binding offsets@
polymonster Feb 26, 2026
f3694d6
- bindful working, bindless missing textures
polymonster Feb 26, 2026
598858a
- bindless working
polymonster Feb 26, 2026
3eecd07
- add limit on descriptor size
polymonster Feb 26, 2026
32c37e5
- properly obtain push constants slot in imgui
polymonster Feb 26, 2026
91f35b9
- imgui almost
polymonster Feb 26, 2026
26a1c39
- imgui is working
polymonster Feb 26, 2026
9f217ac
- refactor to contain all bindings in a single descriptor set
polymonster Feb 27, 2026
f763eec
- add provision for handling buffer vs texture bindings
polymonster Feb 27, 2026
c3f9c41
- formatting
polymonster Feb 27, 2026
5ce2e60
- mouse / keyboard in macos backend
polymonster Feb 27, 2026
027a736
- fix imgui cleanup issue
polymonster Feb 27, 2026
e060813
- move htwv into repo
polymonster Feb 27, 2026
d0f6d64
- client and plugins compiling, running and crashing
polymonster Feb 27, 2026
2e380dd
draw.rs, almost
polymonster Feb 27, 2026
30c62b8
- correctly setup use of different heaps
polymonster Feb 27, 2026
0b0481a
- binding architecture
polymonster Feb 27, 2026
08b1224
- fix input issue in client macos
polymonster Feb 27, 2026
0811c4a
- fist couple of 3d samples working
polymonster Feb 28, 2026
a043c55
- row major
polymonster Feb 28, 2026
276d8f9
- update to main, fix grid rendering
polymonster Feb 28, 2026
4c031ac
- refactoring binding encoding
polymonster Feb 28, 2026
fc1afaf
- testing push constanbts sample
polymonster Mar 2, 2026
b64f1b4
- push constants bindings
polymonster Mar 2, 2026
7592c2d
- stage binding refactor 2
polymonster Mar 2, 2026
54715df
- cleanup unused stuff
polymonster Mar 2, 2026
aa2df3f
- push constants optimisation
polymonster Mar 3, 2026
0c8e644
- clean up slot_lookup
polymonster Mar 3, 2026
bd9d31d
- merge master and fix up push constants
polymonster Mar 4, 2026
d608c51
- remove ensure pmfx
polymonster Mar 4, 2026
d7909f9
- fix conflicts
polymonster Mar 4, 2026
339423c
- add raster states and vertex buffer instancing (not fully working, …
polymonster Mar 4, 2026
3401131
vb instancing, point lights working
polymonster Mar 8, 2026
54dac20
- bindless texture working
polymonster Mar 8, 2026
ae2a051
- textures working (cubemaps, arrays)
polymonster Mar 8, 2026
fc3d8d5
- improve handling of constant buffer type name matching spirv cross …
polymonster Mar 9, 2026
2cbce6a
- bindless working for multiple sub bindings, spots and points workin…
polymonster Mar 9, 2026
142c787
- sync fixes... still issues@
polymonster May 17, 2026
3bfe2dc
- fix flickering / sync issues, mtl id offset, required|
polymonster May 18, 2026
292ebec
move htwv crate to hotline-data
polymonster May 18, 2026
4baab3c
- supress cargo clippy warning
polymonster May 18, 2026
de6ac23
Merge branch 'master' into macos-rework
polymonster May 18, 2026
7d606df
- improve handling of bindings
polymonster May 18, 2026
fbed560
- fix window pos restore, improve shader error output
polymonster May 19, 2026
62ffc19
- update submodule
polymonster May 19, 2026
d55d26a
- all shaders compiling, cleanup shader console spew, dynamic cubemap…
polymonster May 20, 2026
e4c647d
- handling null pixel shader case
polymonster May 20, 2026
f10a09f
- add compute support macos, plus basic example, improve rw texture demo
polymonster May 21, 2026
152515b
- mrt, msaa and mips working
polymonster May 21, 2026
9dd41e7
- update hotline data
polymonster May 21, 2026
5e55228
- move handling of resolve and downsample to be driven by barriers, i…
polymonster May 21, 2026
6cded14
- gpu timestamps, fix validation MSAA resolve depth stencil
polymonster May 22, 2026
dc9f44a
- bindless materials working and rolled back to 1 spv descriptor set …
polymonster May 22, 2026
d224751
- update hotline data
polymonster May 22, 2026
a147b29
- shadow sampler working
polymonster May 22, 2026
0bc3523
- integration fixes for win32/d3d/hlsl
polymonster Jul 4, 2026
dc2fe2c
- cbuffer instancing to structured buffer
polymonster Jul 4, 2026
c8cdebd
- conditional spirv case to omit groupshared in the mip generation sh…
polymonster Jul 4, 2026
357f062
- change location of pmfx
polymonster Jul 5, 2026
e765d41
- update hotline-data
polymonster Jul 5, 2026
1ba4fa7
- fix pmfx test since macos changes for metal
polymonster Jul 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build]
rustflags = ["-A", "unused"]

[env]
MACOSX_DEPLOYMENT_TARGET = "15.0"
14 changes: 13 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
"allow": [
"Bash(dir:*)",
"Bash(grep:*)",
"Bash(cargo build:*)"
"Bash(cargo build:*)",
"Bash(ls:*)",
"Bash(python3:*)",
"Bash(cargo check:*)",
"Bash(cargo tree:*)",
"Bash(xargs:*)",
"Bash(cargo doc:*)",
"Bash(curl -s \"https://crates.io/api/v1/crates/winit\")",
"Bash(cargo add *)",
"Bash(sed -i '' 's/winit = \"0.29.1\"/winit = \"0.30\"/' Cargo.toml)",
"Bash(cargo fetch *)",
"Bash(ls ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ | grep winit)",
"Read(//Users/alex.dixon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/**)"
]
}
}
44 changes: 44 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,50 @@
"console": "externalTerminal",
"preLaunchTask": "examples"
},
{
"name": "bindful (macOS|Debug)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/target/debug/examples/bindful",
"args": [],
"stopAtEntry": false,
// "cwd": "${fileDirname}",
"environment": [],
"console": "externalTerminal",
// "preLaunchTask": "examples"
},
{
"name": "bindless (macOS|Debug)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/target/debug/examples/bindless",
"args": [],
"stopAtEntry": false,
// "cwd": "${fileDirname}",
"environment": [],
"console": "externalTerminal",
// "preLaunchTask": "examples"
},
{
"name": "imgui_demo (macOS|Debug)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/target/debug/examples/imgui_demo",
"args": [],
"stopAtEntry": false,
"environment": [],
"console": "externalTerminal",
},
{
"name": "client (macOS|Debug)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/target/debug/client",
"args": [],
"stopAtEntry": false,
"environment": [],
"console": "externalTerminal",
},
{
"name": "imgui_demo (Win32|Debug)",
"type": "cppvsdbg",
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@
"xtree": "cpp",
"xutility": "cpp"
},
"rust-analyzer.showUnlinkedFileNotification": false
"rust-analyzer.showUnlinkedFileNotification": false,
"rust-analyzer.checkOnSave": false
}
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ libloading = "0.7.4"
bevy_ecs.workspace = true
ddsfile = "0.5.1"

[build-dependencies]
htwv = { path = "hotline-data/htwv" }

[dependencies.imgui-sys]
version = "0.9.0"
features = ["docking"]

[target.'cfg(target_os = "macos")'.dependencies]
metal = "0.28.0"
winit = "0.29.1"
winit = "0.30"
objc = "0.2.4"
cocoa = "0.25.0"
core-graphics-types = "0.1.3"
Expand Down Expand Up @@ -97,6 +100,10 @@ default = ["build_data", "client"]
name = "bindless"
crate-type = ["bin"]

[[example]]
name = "compute"
crate-type = ["bin"]

[[example]]
name = "imgui_demo"
crate-type = ["bin"]
Expand Down
32 changes: 32 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use htwv;

use std::process::Command;

#[cfg(target_os = "windows")]
fn main() {
println!("cargo:rerun-if-changed=shaders");

if std::env::var("CARGO_FEATURE_BUILD_DATA").is_ok() {
let pmbuild = "hotline-data\\pmbuild.cmd";

Expand All @@ -14,3 +19,30 @@ fn main() {
}
}
}

#[cfg(target_os = "macos")]
fn main() {
use std::path::Path;

println!("cargo:rerun-if-changed=shaders");

if std::env::var("CARGO_FEATURE_BUILD_DATA").is_ok() {
let output_dir = Path::new("target/data/shaders");

let pmbuild = "pmbuild";
let status = Command::new(pmbuild)
.args(["mac-data"])
.status()
.unwrap_or_else(|e| panic!("failed to run '{pmbuild}': {e}"));

if !status.success() {
panic!("pmbuild mac-data failed with status: {status}");
}

println!("cargo:warning=Compiling shaders...");
match htwv::compile_dir("shaders", "target/data/shaders") {
Ok(_) => println!("cargo:warning=Shader compilation succeeded"),
Err(e) => println!("cargo:warning=Shader compilation errors:\n{e}"),
}
}
}
17 changes: 17 additions & 0 deletions client/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
use hotline_rs::*;
use hotline_rs::prelude::*;

#[cfg(target_os = "macos")]
fn platform_dpi_aware() -> bool {
false
}

#[cfg(not(target_os = "macos"))]
fn platform_dpi_aware() -> bool {
true
}

fn main() -> Result<(), hotline_rs::Error> {

std::panic::set_hook(Box::new(|info| {
let bt = std::backtrace::Backtrace::force_capture();
eprintln!("PANIC: {info}\n{bt}");
std::process::abort();
}));

// create client
let ctx : Client<gfx_platform::Device, os_platform::App> = Client::create(HotlineInfo {
dpi_aware: platform_dpi_aware(),
..Default::default()
})?;

Expand Down
42 changes: 19 additions & 23 deletions config.jsn
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
// configure build tools
tools<windows>: {
pmfx: "hotline-data/bin/win32/pmfx/pmfx.exe"
pmfx: "py -3 hotline-data/pmfx-shader/pmfx.py"
texturec: "hotline-data/bin/win32/texturec/texturec.exe"
pmfx_dev: "py -3 ../pmfx-shader/pmfx.py"
pmfx_dev: "py -3 hotline-data/pmfx-shader/pmfx.py"
}

tools<mac>: {
pmfx_dev: "python3 hotline-data/pmfx-shader/pmfx.py"
texturec: "hotline-data/bin/macos/texturec"
}

tools_help: {
Expand All @@ -15,7 +20,7 @@
}
pmfx_dev(pmfx): {}
}

tools_update: {
pmfx: {
tag_name: latest
Expand Down Expand Up @@ -121,11 +126,10 @@

// windows specific data, will also build (base)
win32-data(base): {
pmfx: {
pmfx_dev: {
args: [
"-shader_platform hlsl"
"-shader_version 6_5"

"-i ${src_shader_dir}/"
"-o ${data_dir}/shaders"
"-t ${temp_dir}/shaders"
Expand All @@ -137,12 +141,19 @@
"-Od"
]
}
}

mac-data(base): {
pmfx_dev: {
explicit: true
args: [
"-shader_platform hlsl"
"-shader_version 6_5"
"-i ${src_shader_dir}/"
"-shader_platform metal"
"-shader_version 6_0"
"-metal_version 2.3"
"-metal_sdk macosx"
"-discrete_binding 0"
"-discrete_binding 1"
"-i ${src_shader_dir}"
"-o ${data_dir}/shaders"
"-t ${temp_dir}/shaders"
"-num_threads 1"
Expand All @@ -153,21 +164,6 @@
}
}

rt_shaders: {
jsn_vars: {
output_dir: "target/data/shaders"
}
shell: {
commands: [
"hotline-data\\bin\\win32\\pmfx\\bin\\dxc\\dxc.exe -T lib_6_3 -E MyRaygenShader -Fo ${output_dir}/raygen.cso -I . shaders/raytracing_example.hlsl"
"hotline-data\\bin\\win32\\pmfx\\bin\\dxc\\dxc.exe -T lib_6_3 -E MyClosestHitShader -Fo ${output_dir}/closesthit.cso -I . shaders/raytracing_example.hlsl"
"hotline-data\\bin\\win32\\pmfx\\bin\\dxc\\dxc.exe -T lib_6_3 -E MyMissShader -Fo ${output_dir}/miss.cso -I . shaders/raytracing_example.hlsl"
"hotline-data\\bin\\win32\\pmfx\\bin\\dxc\\dxc.exe -T lib_6_3 -Fo ${output_dir}/lib.cso -I . shaders/raytracing_example.hlsl"
]
}
}


// win32 debug client, plugins and data
win32-debug(win32-data, hotline): {
copy: {
Expand Down
2 changes: 0 additions & 2 deletions config.toml

This file was deleted.

Loading
Loading