Skip to content
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

Add option to dump shaders #2210

Merged
merged 3 commits into from
Apr 19, 2024
Merged

Conversation

etang-cw
Copy link
Contributor

Adds an option to dump shaders and pipelines to a directory

When enabled, it writes the spirv and resulting msl for every shader compiled to a file named by the spirv hash

Usually a bit easier to search through than trying to look through an MVK_DEBUG=1 log, especially for pipeline link failures

Copy link
Contributor

@billhollings billhollings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting idea. Thanks for submitting it.

I've requested some changes. Sorry about the confusion and lack of documentation on the _unused_struct_padding config element.

MoltenVK/MoltenVK/GPUObjects/MVKShaderModule.mm Outdated Show resolved Hide resolved
MoltenVK/MoltenVK/GPUObjects/MVKPipeline.mm Show resolved Hide resolved
MoltenVK/MoltenVK/API/mvk_private_api.h Show resolved Hide resolved
MoltenVK/MoltenVK/GPUObjects/MVKPipeline.mm Show resolved Hide resolved
MoltenVK/MoltenVK/Utility/MVKConfigMembers.def Outdated Show resolved Hide resolved
MoltenVK/MoltenVK/API/mvk_private_api.h Outdated Show resolved Hide resolved
@@ -359,3 +359,10 @@ void mvkSetConfig(MVKConfiguration& dstMVKConfig, const MVKConfiguration& srcMVK

#undef MVK_CONFIG__UNUSED_STRUCT_PADDING
#define MVK_CONFIG__UNUSED_STRUCT_PADDING 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two line should be after everything else (per the padding discussion above).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed this now (I should have removed them on my PR).

@etang-cw etang-cw force-pushed the ShaderDump branch 2 times, most recently from 33e1a20 to f830f18 Compare April 16, 2024 16:54
Copy link
Contributor

@billhollings billhollings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the details, once PR #2211 has been pulled in, rebase this PR on the latest main.

MoltenVK/MoltenVK/API/mvk_private_api.h Outdated Show resolved Hide resolved
MoltenVK/MoltenVK/Utility/MVKConfigMembers.def Outdated Show resolved Hide resolved
Docs/MoltenVK_Configuration_Parameters.md Show resolved Hide resolved
Copy link
Contributor

@billhollings billhollings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM now.

I've made a couple of final minor syntactical edits.

MoltenVK/MoltenVK/Utility/MVKEnvironment.h Outdated Show resolved Hide resolved
MoltenVK/MoltenVK/Utility/MVKEnvironment.h Outdated Show resolved Hide resolved
Aligning with syntax of other comments in this file.
@billhollings billhollings merged commit 756f00a into KhronosGroup:main Apr 19, 2024
5 checks passed
@etang-cw etang-cw deleted the ShaderDump branch April 19, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants