-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[meta] Process Dota2's SPIRV to MSL #409
Comments
Here is my small script: NAGA=../../naga/target/debug/examples/convert
(cd ../../naga && cargo build --example convert --features spv-in,msl-out)
for file in spirv/*.spv ; do \
echo "Translating" ${file}; \
$NAGA ${file} ${file}.metal
#xcrun -sdk macosx metal -mmacosx-version-min=10.11 ${file}.metal - -o /dev/null; \
done |
Here is the first log, up to shader-229, which hangs because of another problem that I'm about to address.
I think it looks fairly small so far: we are very close to be able to get this going! |
With #478, we are able to actually process all the shaders!
|
I think we are getting very close now with #587! |
I'm trying to make progress with the actual MSL now. Not just validating that IR is correct, but actually running gfx-portability with that generated MSL, and I'm seeing more issues: |
Good news - with #641, all the 403 shaders (up to the main menu) are successfully transpiled, and are valid Metal shaders. |
Looking at the differences with generated code now. Empty switchThis one is cosmetic only. switch(as_type<int>(const_0u)) {
default: {...
}
} cross: do
{...
} while (false); Default and a branchThis appears to be a change in logic. default: {
}
}
phi_18521_ = phi_11219_;
if (phi_14099_) {
}
phi_18521_ = const_1f; Cross: default:
{
_11219 = _2;
_14099 = false;
break;
}
}
if (_14099)
{
_18521 = _11219;
break;
}
_18521 = 1.0; Edit: both can be found in |
Looks like #683 is the last issue here. |
Getting ready to dance with gfx-rs/gfx#3732 |
We'd want to run Dota2 with gfx-portability on Metal in a way that doesn't involve SPIRV-Cross at all. Will file separate issues for the SPV-in and MSL-out until we fully cover this path.
Test set - dota2-shaders.zip
My bash script to bulk-convert them:
I launch it as "sh ../naga.sh" from the folder with SPVs.
The text was updated successfully, but these errors were encountered: