You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Marius, I've very much enjoyed your MetalKit sequence and learned much from it, so thank you.
From the Chapter 8 code accompanying the blogs onwards where you use playgrounds rather than projects I find that the path search in Metal.swift using guard let path = never manages to find the Shaders.metal file inside Resources, so the code won't build. Replacing the whole line with an absolute path fixes it, but I am not sure whether this is my setup or something that has changed in Swift 5.3, XCode 12.0 or somewhere else both of which I am using.
All the fixes for this error on SO seem to relate to XCode projects rather than playgrounds, and I haven't found any suggestions about how to fix the problem directly in the playground files and avoid introducing an absolute path.
Thanks.
The text was updated successfully, but these errors were encountered:
The reason to add the .metal extension to the file is so that Xcode can recognize the file is a Metal file, and display the file with syntax highlighting. Nothing in the process of running the file requires the extension. An alternative way to mark this as a Metal file is to set the type to Metal Shader Source in the File Inspector.
Bundle.main.path(forResource:, ofType:) appears to be broken. It will not find a file of type "metal" it will find a file of type "meta" or "mmmmm" or no type. It appears to do something wrong with .metal files.
So a work around for this issue is to manually set the type of Shaders.metal to Metal Shader Source, remove the .metal extension, and change the type to nil in Bundle.main.path(forResource:, ofType:).
Marius, I've very much enjoyed your MetalKit sequence and learned much from it, so thank you.
From the Chapter 8 code accompanying the blogs onwards where you use playgrounds rather than projects I find that the path search in Metal.swift using
guard let path =
never manages to find the Shaders.metal file inside Resources, so the code won't build. Replacing the whole line with an absolute path fixes it, but I am not sure whether this is my setup or something that has changed in Swift 5.3, XCode 12.0 or somewhere else both of which I am using.All the fixes for this error on SO seem to relate to XCode projects rather than playgrounds, and I haven't found any suggestions about how to fix the problem directly in the playground files and avoid introducing an absolute path.
Thanks.
The text was updated successfully, but these errors were encountered: