X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=init.cpp;h=55bddece75f74dc3a3a726a63e0cdd52baf454f7;hp=5b8da897271e8cf6b282cf153759bb8666e47a53;hb=7d4b25da4c2f125b9357c6f1846a1e94ab60f5dc;hpb=6bf496a34a84fb14b1b3b6debfd42ba36568b879 diff --git a/init.cpp b/init.cpp index 5b8da89..55bddec 100644 --- a/init.cpp +++ b/init.cpp @@ -79,9 +79,11 @@ void measure_texel_subpixel_precision() glViewport(0, 0, width, 1); + vector frag_shader_outputs; GLuint glsl_program_num = resource_pool.compile_glsl_program( read_version_dependent_file("vs", "vert"), - read_version_dependent_file("texture1d", "frag")); + read_version_dependent_file("texture1d", "frag"), + frag_shader_outputs); glUseProgram(glsl_program_num); check_error(); glUniform1i(glGetUniformLocation(glsl_program_num, "tex"), 0); // Bind the 2D sampler. @@ -211,9 +213,11 @@ void measure_roundoff_problems() glViewport(0, 0, 512, 1); + vector frag_shader_outputs; GLuint glsl_program_num = resource_pool.compile_glsl_program( read_version_dependent_file("vs", "vert"), - read_version_dependent_file("texture1d", "frag")); + read_version_dependent_file("texture1d", "frag"), + frag_shader_outputs); glUseProgram(glsl_program_num); check_error(); glUniform1i(glGetUniformLocation(glsl_program_num, "tex"), 0); // Bind the 2D sampler. @@ -435,7 +439,16 @@ bool init_movit(const string& data_directory, MovitDebugLevel debug_level) get_glsl_version()); return false; } - movit_shader_model = MOVIT_GLSL_130; + if (get_glsl_version() < 1.50f) { + movit_shader_model = MOVIT_GLSL_130; + } else { + // Note: All of our 1.50 shaders are identical to our 1.30 shaders, + // but OS X does not support 1.30; only 1.10 (which we don't support + // anymore) and 1.50 (and then only with core contexts). So we keep + // a second set of shaders around whose only difference is the different + // #version declaration. + movit_shader_model = MOVIT_GLSL_150; + } } else { movit_shader_model = MOVIT_ESSL_300; }