mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
internal/graphicsdriver/metal/mtl: bug fix: specify the language version explicitly
Updates #2086
This commit is contained in:
parent
331ad93adf
commit
7409f01b17
@ -48,11 +48,15 @@ void *Device_MakeCommandQueue(void *device) {
|
|||||||
struct Library Device_MakeLibrary(void *device, const char *source,
|
struct Library Device_MakeLibrary(void *device, const char *source,
|
||||||
size_t sourceLength) {
|
size_t sourceLength) {
|
||||||
NSError *error;
|
NSError *error;
|
||||||
|
MTLCompileOptions* options = [[MTLCompileOptions alloc] init];
|
||||||
|
if (@available(macOS 10.14, iOS 12.0, *)) {
|
||||||
|
options.languageVersion = MTLLanguageVersion2_1;
|
||||||
|
}
|
||||||
id<MTLLibrary> library = [(id<MTLDevice>)device
|
id<MTLLibrary> library = [(id<MTLDevice>)device
|
||||||
newLibraryWithSource:[[NSString alloc] initWithBytes:source
|
newLibraryWithSource:[[NSString alloc] initWithBytes:source
|
||||||
length:sourceLength
|
length:sourceLength
|
||||||
encoding:NSUTF8StringEncoding]
|
encoding:NSUTF8StringEncoding]
|
||||||
options:NULL // TODO.
|
options:options
|
||||||
error:&error];
|
error:&error];
|
||||||
|
|
||||||
struct Library l;
|
struct Library l;
|
||||||
|
Loading…
Reference in New Issue
Block a user