Mercurial > sdl-ios-xcode
comparison src/render/opengles2/SDL_render_gles2.c @ 5209:7d64745f1363
Fixed crash when binary shaders are not available.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 06 Feb 2011 08:46:48 -0800 |
parents | daa5463466c5 |
children | 115fff0641ee |
comparison
equal
deleted
inserted
replaced
5208:af7caea67886 | 5209:7d64745f1363 |
---|---|
556 SDL_SetError("No shader matching the requested characteristics was found"); | 556 SDL_SetError("No shader matching the requested characteristics was found"); |
557 return NULL; | 557 return NULL; |
558 } | 558 } |
559 | 559 |
560 /* Find a matching shader instance that's supported on this hardware */ | 560 /* Find a matching shader instance that's supported on this hardware */ |
561 for (i = 0; i < shader->instance_count; ++i) | 561 for (i = 0; i < shader->instance_count && !instance; ++i) |
562 { | 562 { |
563 for (j = 0; j < rdata->shader_format_count; ++j) | 563 for (j = 0; j < rdata->shader_format_count && !instance; ++j) |
564 { | 564 { |
565 if (!shader->instances) | 565 if (!shader->instances) |
566 continue; | |
567 if (!shader->instances[i]) | |
566 continue; | 568 continue; |
567 if (shader->instances[i]->format != rdata->shader_formats[j]) | 569 if (shader->instances[i]->format != rdata->shader_formats[j]) |
568 continue; | 570 continue; |
569 instance = shader->instances[i]; | 571 instance = shader->instances[i]; |
570 break; | |
571 } | 572 } |
572 } | 573 } |
573 if (!instance) | 574 if (!instance) |
574 { | 575 { |
575 SDL_SetError("The specified shader cannot be loaded on the current platform"); | 576 SDL_SetError("The specified shader cannot be loaded on the current platform"); |