是否支持metal LanguageVersion3.1

在IOS打包选项中选择Metal LanguageVersion3.1,打包运行,会直接崩溃。

查看代码发现不支持metal3.1?想确认一下是不是我这边哪里弄错了

[Image Removed]

重现步骤
在IOS打包选项中选择Metal LanguageVersion3.1,打包运行,会直接崩溃

您好,您的代码是5.6吗?我这边跟您显示的不一样。最新的5.6是支持的

代码是23年6月添加的

https://github.com/EpicGames/UnrealEngine/commit/de9866466718ad49b702edac9128a895041815e3\#diff\-d3936d8879a7de339168d19840b6e7a6f19b97075db05b3f95edc984e9df4f4b

抱歉,之前看错位置了,这里确实没有处理…我找总部的同事看一下是否可以快速修复

你好

​这里是详细的报错信息[Image Removed]

[UE] Fatal error: [File:./Runtime/Apple/MetalRHI/Private/Shaders/Types/Templates/MetalBaseShader.h] [Line: 357] 
Failed to create shader with unknown version 9: 
 
#pragma clang diagnostic ignored "-Wmissing-prototypes"
 
#include <metal_stdlib>
#include <simd/simd.h>
 
using namespace metal;
 
// Identity function as workaround for bug in Metal compiler
template<typename T>
T spvIdentity(T x)
{
    return x;
}
 
struct type_Globals
{
    uint NumBricks;
    uint StartPosInOldVolume;
    uint StartPosInNewVolume;
};
 
kernel void Main_0000074d_964b17e7(constant type_Globals& _Globals [[buffer(1)]], texture3d<uint, access::write> IndirectionTexture [[texture(0)]], texture3d<uint> OldIndirectionTexture [[texture(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
{
    do
    {
        if (any(gl_GlobalInvocationID >= uint3(IndirectionTexture.get_width(), IndirectionTexture.get_height(), IndirectionTexture.get_depth())))
        {
            break;
        }
        uint4 _40 = OldIndirectionTexture.read(uint3(gl_GlobalInvocationID), 0u);
        uint _47 = (_40.x + (_40.y * 256u)) + (_40.z * 65536u);
        if ((_47 >= _Globals.StartPosInOldVolume) && (_47 < (_Globals.StartPosInOldVolume + _Globals.NumBricks)))
        {
            uint _64 = uint(int((_47 - _Globals.StartPosInOldVolume) + _Globals.StartPosInNewVolume));
            uint _66 = _64 / 256u;
            IndirectionTexture.write(spvIdentity(uint4(_64 % 256u, _66 % 256u, _66 / 256u, _40.w)), uint3(gl_GlobalInvocationID));
        }
        else
        {
            IndirectionTexture.write(spvIdentity(_40), uint3(gl_GlobalInvocationID));
        }
        break;
    } while(false);
}

您好,在这边加上

case9:

MetalVersion = MTL::LanguageVersion3_1;

break;

应该就可以了​

好的,感谢~