Skip to content

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

Merged
llvm-beanz merged 3 commits intomicrosoft:mainfrom
llvm-beanz:cbieneman/metal-reflection
Mar 9, 2026
Merged

[Metal] Add support for -Fre for Metal#8159
llvm-beanz merged 3 commits intomicrosoft:mainfrom
llvm-beanz:cbieneman/metal-reflection

Conversation

@llvm-beanz
Copy link
Copy Markdown
Collaborator

@llvm-beanz llvm-beanz commented Feb 12, 2026

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 12, 2026

✅ 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
@llvm-beanz llvm-beanz force-pushed the cbieneman/metal-reflection branch from e189319 to 83b8391 Compare February 12, 2026 22:33
Copy link
Copy Markdown
Collaborator

@Keenuts Keenuts left a comment

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 llvm-beanz merged commit 70ebb47 into microsoft:main Mar 9, 2026
12 checks passed
@llvm-beanz 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

Status: Done

Development

Successfully merging this pull request may close these issues.

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

4 participants