Metal: Fixed ObjC -> C string conversion.

This commit is contained in:
Branimir Karadžić 2015-12-03 11:38:48 -08:00
parent 42a14522af
commit dd391067d0

View file

@ -141,7 +141,7 @@ namespace bgfx { namespace mtl
id<MTLLibrary> lib = [m_obj newLibraryWithData:(dispatch_data_t)_data error:&error];
BX_WARN(NULL == error
, "newLibraryWithData failed: %s"
, error.localizedDescription.UTF8String
, [error.localizedDescription cStringUsingEncoding:NSASCIIStringEncoding]
);
return lib;
}
@ -150,10 +150,10 @@ namespace bgfx { namespace mtl
{
NSError* error;
id<MTLLibrary> lib = [m_obj newLibraryWithSource:@(_source) options:nil error:&error];
// BX_WARN(NULL == error
// , "Shader compilation failed: %s"
// , [error.localizedDescription UTF8String]
// );
BX_WARN(NULL == error
, "Shader compilation failed: %s"
, [error.localizedDescription cStringUsingEncoding:NSASCIIStringEncoding]
);
return lib;
}
@ -200,7 +200,7 @@ namespace bgfx { namespace mtl
id <MTLRenderPipelineState> state = [m_obj newRenderPipelineStateWithDescriptor:_descriptor error:&error];
BX_WARN(NULL == error
, "newRenderPipelineStateWithDescriptor failed: %s"
, error.localizedDescription.UTF8String
, [error.localizedDescription cStringUsingEncoding:NSASCIIStringEncoding]
);
return state;
}
@ -212,7 +212,7 @@ namespace bgfx { namespace mtl
BX_WARN(NULL == error
, "newRenderPipelineStateWithDescriptor failed: %s"
, error.localizedDescription.UTF8String
, [error.localizedDescription cStringUsingEncoding:NSASCIIStringEncoding]
);
return state;
}
@ -225,7 +225,7 @@ namespace bgfx { namespace mtl
BX_WARN(NULL == error
, "newComputePipelineStateWithFunction failed: %s"
, error.localizedDescription.UTF8String
, [error.localizedDescription cStringUsingEncoding:NSASCIIStringEncoding]
);
return state;
}