Merge pull request #9000 from LazyBumHorse/fix_metal

fix black screen in Metal
This commit is contained in:
Twinaphex 2019-06-22 13:17:50 +02:00 committed by GitHub
commit ed2837ff59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -1134,10 +1134,6 @@ typedef struct MTLALIGN(16)
- (BOOL)setShaderFromPath:(NSString *)path
{
/* TODO use stock shader if string_is_empty(path.UTF8String), this is just a safety guard: */
if (string_is_empty(path.UTF8String))
return YES;
[self _freeVideoShader:_shader];
_shader = nil;

View File

@ -129,12 +129,17 @@ static bool metal_set_shader(void *data,
if (!md)
return false;
if (!string_is_empty(path) && type != RARCH_SHADER_SLANG)
if (type != RARCH_SHADER_SLANG)
{
RARCH_WARN("[Metal] Only Slang shaders are supported. Falling back to stock.\n");
if (!string_is_empty(path) && type != RARCH_SHADER_SLANG)
RARCH_WARN("[Metal] Only Slang shaders are supported. Falling back to stock.\n");
path = NULL;
}
/* TODO actually return to stock */
if (string_is_empty(path))
return true;
return [md.frameView setShaderFromPath:[NSString stringWithUTF8String:path]];
#else
return false;