-
Notifications
You must be signed in to change notification settings - Fork 543
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
Shader compile times #3389
Comments
It turns out there was accidentally exponential behavior in The (I'm biased, because I'm running into this behavior in an app using |
Accidentally closed |
3641: Make spirv-cross optional r=grovesNL a=kvark SPIRV-Cross is a big foreign dependency, which often cause issues, such as denoland/rusty_v8#465 and #3389, #3117, #2520, and many others. Previously in #3445 and #3520 we implemented Naga code path as an alternative, but hidden behind an optional feature. Now it's time to flip the table and say that Naga is permanent, but SPIRV-Cross is optional until completely phased out. Most of the changes here are from re-routing the main shader creation logic from using SPIRV-Cross types to using Naga types. The "cross" stuff is just getting derived from Naga types if necessary. The change only applies to Metal and OpenGL backends so far. D3D will come on board once gfx-rs/naga#408 is operational. Note: it's going to be a long while for Naga to mature, most users need to keep the "cross" dependency enabled for now! Even the included examples don't run on Naga yet, since the SPIR-V generated by glslang is quite specific, and Naga's SPV frontend doesn't like it yet. Co-authored-by: Dzmitry Malyshau <[email protected]>
Using spirv-cross appears to be showing up in profiles. We are doing a bit of heap allocation and copying on the way to it and from it today, but also the logic itself may be slow. Hopefully, we can address it by moving to https://github.com/gfx-rs/naga
Here is some input I gathered from a Dota2 run:
dota-metal-shader-times.txt
All times are in micro-seconds. Here are some observations:
MTLLibrary
creation of a single stage. It's not much at all in the total picture.The text was updated successfully, but these errors were encountered: