0
MTLTexture
オブジェクトを作成するために次のコードを使用しました(わかりやすくするため、コードの一部のみが表示されています)。MTLTextureオブジェクトの作成時に認識できないセレクタエラー
int tmpbuf[4096]
id<MTLDevice> device = MTLCreateSystemDefaultDevice();
MTLTextureDescriptor* desc = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat: MTLPixelFormatA8Unorm width: 64 height:64 mipmapped: NO];
id<MTLTexture> input_texture = [device newTextureWithDescpriptor:desc];
//memory for the texture
MTLOrigin texture_origin = { 0, 0, 0};
MTLSize texture_size = {64, 64, 0};
MTLRegion texture_region = {texture_origin, texture_size};
[input_texture replaceRegion: texture_region mipmaplevel: 0 withBytes: tmpbuf bytesPerRow: 64 ];
コード実行している:
id<MTLTexture> input_texture = [device newTextureWithDescpriptor:desc];
このコードはコンパイルおよびOS Xシステム上で実行された[MTLIGAccelDevice newTextureWithDescpriptor:]: unrecognized selector sent to instance 0x7fd0a3012200 was reported.
というエラーが。なぜこのエラーが起こったのか分かりません。
マシンで正常に実行できますか? @Marius – Pony
はい、これらの2つの修正を行い、それに続いてクリーンプロジェクトを行いましたか?今もあなたのもので動くはずです。 – Marius
私は変更を加えましたが、うまくいかなかった。コードが実行されたときに同じエラーが報告されました。 – Pony