Skip to content

Commit

Permalink
fix metal by including it in more compile passes
Browse files Browse the repository at this point in the history
  • Loading branch information
ArielG-NV committed Aug 21, 2024
1 parent dbc7ae2 commit dc2b47a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/slang/slang-emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ Result linkAndOptimizeIR(
// concrete value.
// These sort of GlobalVar's should be removed in-favor of directly
// using the known value since this may be an indirect use of a resource
// variable (which is illegal for most targets).
// variable (which is illegal for almost targets).
simplifyGlobalVars(irModule);

switch( target )
Expand Down
4 changes: 3 additions & 1 deletion source/slang/slang-ir-specialize-resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,9 @@ bool specializeResourceOutputs(
HashSet<IRFunc*>& unspecializableFuncs)
{
auto targetRequest = codeGenContext->getTargetReq();
if(isD3DTarget(targetRequest) || isKhronosTarget(targetRequest))
// D3D & SPIRV/GLSL cannot easily use resources as parameters
// Metal cannot assign globals to resource-outputting functions (in global scope)
if(isD3DTarget(targetRequest) || isKhronosTarget(targetRequest) || isMetalTarget(targetRequest))
{}
else
{
Expand Down

0 comments on commit dc2b47a

Please sign in to comment.