Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed crash when binary shaders are not available.

  • Loading branch information
slouken committed Feb 6, 2011
1 parent 381f21b commit 7cc07d8d1cf3185cbe000f7e9e92091cc55c3231
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/render/opengles2/SDL_render_gles2.c
@@ -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)

0 comments on commit 7cc07d8

Please sign in to comment.