From 968ff4879a4e7dd98e998de4d04e3a7029f4fe60 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 16 Jun 2018 00:08:24 +0300 Subject: [PATCH] Enable fast math --- Cocoa/GBViewMetal.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cocoa/GBViewMetal.m b/Cocoa/GBViewMetal.m index 4d2bac3..0678d9f 100644 --- a/Cocoa/GBViewMetal.m +++ b/Cocoa/GBViewMetal.m @@ -89,8 +89,10 @@ static const vector_float2 rect[] = shader_source = [shader_source stringByReplacingOccurrencesOfString:@"{filter}" withString:scaler_source]; + MTLCompileOptions *options = [[MTLCompileOptions alloc] init]; + options.fastMathEnabled = YES; id library = [device newLibraryWithSource:shader_source - options:nil + options:options error:&error]; if (error) { NSLog(@"Error: %@", error);