Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed crash when binary shaders are not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 6, 2011
1 parent 381f21b commit 7cc07d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/render/opengles2/SDL_render_gles2.c
Expand Up @@ -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 */
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)
continue;
if (!shader->instances[i])
continue;
if (shader->instances[i]->format != rdata->shader_formats[j])
continue;
instance = shader->instances[i];
break;
}
}
if (!instance)
Expand Down

0 comments on commit 7cc07d8

Please sign in to comment.