- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 23.5k
 
D3D12: Greatly reduce shader conversion time & fix spec constant bitmasking. #111762
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
base: master
Are you sure you want to change the base?
D3D12: Greatly reduce shader conversion time & fix spec constant bitmasking. #111762
Conversation
9745048    to
    8895dfa      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
We should also update the build scripts used by official builds here:
https://github.com/godotengine/godot-build-scripts/blob/main/build.sh#L193-L195
I'll send a PR and make sure to re-download the deps for the next 4.6 build.
Is this update suitable as is for potential 4.5.x too, or would be need to cherry-pick the removal of the validation check?
| 
           I think this should be 4.6 only, since that's the version we want to hopefully default to D3D12.  | 
    
Follow-up PR to #111356.
Shader Conversion Time Reduction
Partner PR: godotengine/godot-nir-static#23
Reduces shader conversion time up to 2x - 2.5x depending on the project. In TPS Demo, the loading screen goes from 82 seconds to 33 seconds on my system. For reference, Vulkan is 15 seconds.
NOTE: If you want to make a comparison yourself, you need to clear both Godot and driver shader caches before each launch to have a fair comparison:
project/.godot/shader_cache%APPDATA%/Godot/app_userdata/project/shader_cache%LOCALAPPDATA%/NVIDIA%LOCALAPPDATA%/AMDSpecialization Constants Bitmasking Fix
Partner PR: godotengine/godot-nir-static#22
Old behavior used to set the second MSB to 1, then mask that out inside the DXIL shader. We shouldn't do that anymore now that we allow all of the specialization constant bits.
This was causing less shadow map samples to be used, notably with the "Soft High (Slow)" mode for "Soft Shadow Filter Quality" parameter: