Skip to content

[Metal] Add support for -Fre for Metal - #8159

Merged
Chris B (llvm-beanz) merged 3 commits into
microsoft:mainfrom
llvm-beanz:cbieneman/metal-reflection
Mar 9, 2026
Merged

Chris B (llvm-beanz) merged 3 commits into
microsoft:mainfrom
llvm-beanz:cbieneman/metal-reflection

Conversation

@llvm-beanz

@llvm-beanz Chris B (llvm-beanz) commented Feb 12, 2026 •

Copy link
Copy Markdown
Collaborator

This updates the Metal support to enable generating the Metal Shader Converter's reflection JSON file.

Required to fix llvm/offload-test-suite#452.

@github-actions

github-actions Bot commented Feb 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ With the latest revision this PR passed the C/C++ code formatter.

This updates the Metal support to enable generating the Metal Shader
Converter's reflection JSON file.

This is required to fix
llvm/offload-test-suite#452

@Keenuts Nathan Gauër (Keenuts) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Patching this PR and checking Metal codegen, I have an assert because the reflection output seems to be written before.

Seems like the fix is to do:

--- a/tools/clang/tools/dxcompiler/dxcompilerobj.cpp
+++ b/tools/clang/tools/dxcompiler/dxcompilerobj.cpp
@@ -1085,7 +1085,12 @@ public:
               }
             }
 
-            if (pReflectionStream && pReflectionStream->GetPtrSize()) {
+#ifdef ENABLE_METAL_CODEGEN
+            const bool GenMetal = opts.GenMetal;
+#else
+            const bool GenMetal = false;
+#endif
+            if (!GenMetal && pReflectionStream && pReflectionStream->GetPtrSize()) {
               CComPtr<IDxcBlob> pReflection;
               IFT(pReflectionStream->QueryInterface(&pReflection));
               IFT(pResult->SetOutputObject(DXC_OUT_REFLECTION, pReflection));

@llvm-beanz
Chris B (llvm-beanz) merged commit 70ebb47 into microsoft:main Mar 9, 2026
12 checks passed
@llvm-beanz
Chris B (llvm-beanz) deleted the cbieneman/metal-reflection branch March 9, 2026 13:57
@github-project-automation github-project-automation Bot moved this from In progress to Done in HLSL Roadmap Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Metal][DXC] Concurrent writing of uint4 components test failure

4 participants