objc: migrate remaining ns_string call sites to xx NSString
NSLog's fmt, addObserver's name, UIApplicationMain's principal-class, CADisplayLink's run-loop mode, and metal's newLibraryWithSource/newFunctionWithName string args are retyped *NSString, so their call sites read xx "..." instead of ns_string("...".ptr). ns_string is now used only by impl Into(*NSString) for string.
This commit is contained in:
@@ -387,29 +387,28 @@ metal_create_shader_ios :: (self: *MetalGPU, src: string) -> u32 {
|
||||
|
||||
msg_o : (*void, *void) -> *void callconv(.c) = xx objc_msgSend;
|
||||
msg_oo : (*void, *void, *void) -> void callconv(.c) = xx objc_msgSend;
|
||||
msg_oo_r : (*void, *void, *void) -> *void callconv(.c) = xx objc_msgSend;
|
||||
msg_oo_r : (*void, *void, *NSString) -> *void callconv(.c) = xx objc_msgSend;
|
||||
msg_ou : (*void, *void, u64) -> void callconv(.c) = xx objc_msgSend;
|
||||
msg_ouret: (*void, *void, u64) -> *void callconv(.c) = xx objc_msgSend;
|
||||
msg_ob : (*void, *void, u8) -> void callconv(.c) = xx objc_msgSend;
|
||||
|
||||
// [device newLibraryWithSource:src options:nil error:&err]
|
||||
msg_lib : (*void, *void, *void, *void, **void) -> *void callconv(.c) = xx objc_msgSend;
|
||||
src_ns := ns_string(src.ptr);
|
||||
msg_lib : (*void, *void, *NSString, *void, **void) -> *void callconv(.c) = xx objc_msgSend;
|
||||
err : *void = null;
|
||||
library := msg_lib(self.device,
|
||||
sel_registerName("newLibraryWithSource:options:error:".ptr),
|
||||
src_ns, xx 0, @err);
|
||||
xx src, xx 0, @err);
|
||||
if library == null {
|
||||
NSLog(ns_string("[metal] MSL compile failed\n".ptr));
|
||||
NSLog(xx "[metal] MSL compile failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
vfn := msg_oo_r(library, sel_registerName("newFunctionWithName:".ptr),
|
||||
ns_string("vmain".ptr));
|
||||
xx "vmain");
|
||||
ffn := msg_oo_r(library, sel_registerName("newFunctionWithName:".ptr),
|
||||
ns_string("fmain".ptr));
|
||||
if vfn == null { NSLog(ns_string("[metal] missing vmain in MSL\n".ptr)); return 0; }
|
||||
if ffn == null { NSLog(ns_string("[metal] missing fmain in MSL\n".ptr)); return 0; }
|
||||
xx "fmain");
|
||||
if vfn == null { NSLog(xx "[metal] missing vmain in MSL\n"); return 0; }
|
||||
if ffn == null { NSLog(xx "[metal] missing fmain in MSL\n"); return 0; }
|
||||
|
||||
MTLRenderPipelineDescriptor := objc_getClass("MTLRenderPipelineDescriptor".ptr);
|
||||
desc := msg_o(MTLRenderPipelineDescriptor, sel_registerName("alloc".ptr));
|
||||
@@ -434,7 +433,7 @@ metal_create_shader_ios :: (self: *MetalGPU, src: string) -> u32 {
|
||||
sel_registerName("newRenderPipelineStateWithDescriptor:error:".ptr),
|
||||
desc, @err2);
|
||||
if state == null {
|
||||
NSLog(ns_string("[metal] pipeline state creation failed\n".ptr));
|
||||
NSLog(xx "[metal] pipeline state creation failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user