Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_shader_generator.mm
| Show First 20 Lines • Show All 1,043 Lines • ▼ Show 20 Lines | #if MTL_SHADER_DEBUG_EXPORT_SOURCE | ||||
| } | } | ||||
| shader_debug_printf( | shader_debug_printf( | ||||
| "Vertex Shader Saved to: %s\n", | "Vertex Shader Saved to: %s\n", | ||||
| (std::string(path_cstr) + std::string(this->name) + "_GeneratedFragmentShader.msl").c_str()); | (std::string(path_cstr) + std::string(this->name) + "_GeneratedFragmentShader.msl").c_str()); | ||||
| #endif | #endif | ||||
| /* Set MSL source NSString's. Required by Metal API. */ | /* Set MSL source NSString's. Required by Metal API. */ | ||||
| NSString *msl_final_vert = [NSString stringWithCString:ss_vertex.str().c_str() | NSString *msl_final_vert = [NSString stringWithUTF8String:ss_vertex.str().c_str()]; | ||||
| encoding:[NSString defaultCStringEncoding]]; | |||||
| NSString *msl_final_frag = (msl_iface.uses_transform_feedback) ? | NSString *msl_final_frag = (msl_iface.uses_transform_feedback) ? | ||||
| (@"") : | (@"") : | ||||
| ([NSString stringWithCString:ss_fragment.str().c_str() | ([NSString stringWithUTF8String:ss_fragment.str().c_str()]); | ||||
| encoding:[NSString defaultCStringEncoding]]); | |||||
| this->shader_source_from_msl(msl_final_vert, msl_final_frag); | this->shader_source_from_msl(msl_final_vert, msl_final_frag); | ||||
| shader_debug_printf("[METAL] BSL Converted into MSL\n"); | shader_debug_printf("[METAL] BSL Converted into MSL\n"); | ||||
| #ifndef NDEBUG | #ifndef NDEBUG | ||||
| /* In debug mode, we inject the name of the shader into the entry-point function | /* In debug mode, we inject the name of the shader into the entry-point function | ||||
| * name, as these are what show up in the Xcode GPU debugger. */ | * name, as these are what show up in the Xcode GPU debugger. */ | ||||
| this->set_vertex_function_name( | this->set_vertex_function_name( | ||||
| ▲ Show 20 Lines • Show All 2,031 Lines • Show Last 20 Lines | |||||