Fixed crash when binary shaders are not available.
This commit is contained in:
parent
3ea29eeb59
commit
55a04881d8
1 changed files with 4 additions and 3 deletions
|
@ -558,16 +558,17 @@ GLES2_CacheShader(SDL_Renderer *renderer, GLES2_ShaderType type, SDL_BlendMode b
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find a matching shader instance that's supported on this hardware */
|
/* Find a matching shader instance that's supported on this hardware */
|
||||||
for (i = 0; i < shader->instance_count; ++i)
|
for (i = 0; i < shader->instance_count && !instance; ++i)
|
||||||
{
|
{
|
||||||
for (j = 0; j < rdata->shader_format_count; ++j)
|
for (j = 0; j < rdata->shader_format_count && !instance; ++j)
|
||||||
{
|
{
|
||||||
if (!shader->instances)
|
if (!shader->instances)
|
||||||
continue;
|
continue;
|
||||||
|
if (!shader->instances[i])
|
||||||
|
continue;
|
||||||
if (shader->instances[i]->format != rdata->shader_formats[j])
|
if (shader->instances[i]->format != rdata->shader_formats[j])
|
||||||
continue;
|
continue;
|
||||||
instance = shader->instances[i];
|
instance = shader->instances[i];
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!instance)
|
if (!instance)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue