fix black screen in Metal

This commit is contained in:
LazyBumHorse 2019-06-22 11:07:08 +02:00
parent faef9413e3
commit b5199d7921
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;