make get program binary able to be disabled via env var and display if

wee find the extn too. tested on gles now too.



SVN revision: 59178
This commit is contained in:
Carsten Haitzler 2011-05-04 08:05:46 +00:00
parent 232158ba48
commit 97a12de552
2 changed files with 12 additions and 6 deletions

View File

@ -729,6 +729,11 @@ evas_gl_common_context_new(void)
GETENVOPT("EVAS_GL_ATLAS_MAX_W", atlas.max_w, 0, MAX_ATLAS_W);
GETENVOPT("EVAS_GL_ATLAS_MAX_H", atlas.max_h, 0, MAX_ATLAS_H);
GETENVOPT("EVAS_GL_ATLAS_SLOT_SIZE", atlas.slot_size, MIN_ATLAS_SLOT, MAX_ATLAS_SLOT);
s = (const char *)getenv("EVAS_GL_GET_PROGRAM_BINARY");
if (s)
{
if (atoi(s) == 0) shared->info.bin_program = 0;
}
if (getenv("EVAS_GL_INFO"))
fprintf(stderr,
@ -743,6 +748,7 @@ evas_gl_common_context_new(void)
"\n"
"(can set EVAS_GL_VERTEX_MAX EVAS_GL_NO_MAP_IMAGE_SEC EVAS_GL_INFO EVAS_GL_MEMINFO )\n"
"\n"
"EVAS_GL_GET_PROGRAM_BINARY: %i\n"
"EVAS_GL_CUTOUT_MAX: %i\n"
"EVAS_GL_PIPES_MAX: %i\n"
"EVAS_GL_ATLAS_ALLOC_SIZE: %i\n"
@ -759,6 +765,7 @@ evas_gl_common_context_new(void)
(int)shared->info.sec_image_map,
(int)shared->info.max_vertex_elements,
(int)shared->info.bin_program,
(int)shared->info.tune.cutout.max,
(int)shared->info.tune.pipes.max,
(int)shared->info.tune.atlas.max_alloc_size,

View File

@ -663,7 +663,6 @@ _evas_gl_shader_file_exists(const char *file)
struct stat st;
if (!file) return EINA_FALSE;
if (stat(file, &st) < 0) return EINA_FALSE;
return EINA_TRUE;
}
@ -775,8 +774,9 @@ _evas_gl_common_shader_program_binary_init(Evas_GL_Program *p,
p->prog = glCreateProgram();
#if 0
// TOOD: invalid rendering error occurs when attempting to use a glProgramBinary.
// in order to render correctly we should create a dummy vertex shader.
// TODO: invalid rendering error occurs when attempting to use a
// glProgramBinary. in order to render correctly we should create a dummy
// vertex shader.
p->vert = glCreateShader(GL_VERTEX_SHADER);
glAttachShader(p->prog, p->vert);
p->frag = glCreateShader(GL_FRAGMENT_SHADER);
@ -1044,7 +1044,6 @@ _evas_gl_common_shader_binary_init(Evas_GL_Shared *shared)
{
/* check eet */
Eet_File *et = NULL;
char bin_dir_path[PATH_MAX];
char bin_file_path[PATH_MAX];
@ -1183,12 +1182,12 @@ int
evas_gl_common_shader_program_init(Evas_GL_Shared *shared)
{
// gl support binary shader and get env of binary shader path
if (shared->info.bin_program && _evas_gl_common_shader_binary_init(shared)) return 1;
if (shared->info.bin_program &&
_evas_gl_common_shader_binary_init(shared)) return 1;
/* compile all shader.*/
if (!_evas_gl_common_shader_source_init(shared)) return 0;
/* sucess compile all shader. if gl support binary shader, we need to save */
if (shared->info.bin_program) _evas_gl_common_shader_binary_save(shared);
return 1;
}