mellinoe / veldrid-samples

Sample projects for Veldrid
https://mellinoe.github.io/veldrid-docs/
121 stars 48 forks source link

run sample failed in macOS 10.12.6 #8

Closed zhengying closed 6 years ago

zhengying commented 6 years ago

Environment: .net core 2.1 macOS 10.12.6

Error here:

Unhandled Exception: System.Exception: Failed to create new MTLRenderPipelineState: Function FS is using language version 2.0 which is incompatible with this OS. at Veldrid.MetalBindings.MTLDevice.newRenderPipelineStateWithDescriptor(MTLRenderPipelineDescriptor desc) at Veldrid.MTL.MTLPipeline..ctor(GraphicsPipelineDescription& description, MTLGraphicsDevice gd) at Veldrid.MTL.MTLResourceFactory.CreateGraphicsPipelineCore(GraphicsPipelineDescription& description) at Veldrid.ResourceFactory.CreateGraphicsPipeline(GraphicsPipelineDescription& description) at Veldrid.ResourceFactory.CreateGraphicsPipeline(GraphicsPipelineDescription description) at GettingStarted.Program.CreateResources() in /Users/zhengying/Downloads/veldrid-samples-master/src/GettingStarted/Program.cs:line 99 at GettingStarted.Program.Main(String[] args) in /Users/zhengying/Downloads/veldrid-samples-master/src/GettingStarted/Program.cs:line 33

mellinoe commented 6 years ago

It seems that I have compiled the Metal shaders so that they are only compatible with 10.13+, on accident. I don't have a 10.12 machine to test on, but could you try changing this line to:

-                    extension = "metallib";
+                    extension = "metal";

That should cause the shader files to be compiled at runtime rather than ahead of time.

zhengying commented 6 years ago

It's works! thanks.