diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-04-27 21:00:38 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-04-27 21:21:12 +0300 |
commit | 0d5c5a8438badf5e4921a96b9d4648d1d0dc3aee (patch) | |
tree | 41574f22dc7e566dd279e67a50c3d1ae3d9da679 /source/blender/gpu/intern/gpu_basic_shader.c | |
parent | 99fde39f49054fcb2abce58777096f47fc5ad4a9 (diff) |
OpenGL: early exit from functions that don't mix with core profile
These parts will not be part of final viewport, but are called indirectly during the transition. To avoid runtime errors on core profile, exit early -- functions effectively do nothing.
I put the early exits inside the functions to avoid cluttering the code that calls these. But (long term) the calling functions need to change.
Basic shader's detect_options function was unused and full of old, so I deleted it.
Part of T51164
Diffstat (limited to 'source/blender/gpu/intern/gpu_basic_shader.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_basic_shader.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/source/blender/gpu/intern/gpu_basic_shader.c b/source/blender/gpu/intern/gpu_basic_shader.c index ff385683a1e..42fb39a6eb0 100644 --- a/source/blender/gpu/intern/gpu_basic_shader.c +++ b/source/blender/gpu/intern/gpu_basic_shader.c @@ -190,31 +190,6 @@ static bool solid_compatible_lighting(void) return ((directional & enabled) == enabled); } -#if 0 -static int detect_options() -{ - GLint two_sided; - int options = 0; - - if (glIsEnabled(GL_TEXTURE_2D)) - options |= GPU_SHADER_TEXTURE_2D; - if (glIsEnabled(GL_TEXTURE_RECTANGLE)) - options |= GPU_SHADER_TEXTURE_RECT; - GPU_SHADER_TEXTURE_RECT - if (glIsEnabled(GL_COLOR_MATERIAL)) - options |= GPU_SHADER_USE_COLOR; - - if (glIsEnabled(GL_LIGHTING)) - options |= GPU_SHADER_LIGHTING; - - glGetIntegerv(GL_LIGHT_MODEL_TWO_SIDE, &two_sided); - if (two_sided == GL_TRUE) - options |= GPU_SHADER_TWO_SIDED; - - return options; -} -#endif - static GPUShader *gpu_basic_shader(int options) { /* glsl code */ @@ -332,6 +307,10 @@ void GPU_basic_shader_colors( const float diffuse[3], const float specular[3], int shininess, float alpha) { +#ifdef WITH_GL_PROFILE_CORE + return; +#endif + float gl_diffuse[4], gl_specular[4]; if (diffuse) @@ -353,6 +332,10 @@ void GPU_basic_shader_colors( void GPU_basic_shader_light_set(int light_num, GPULightData *light) { +#ifdef WITH_GL_PROFILE_CORE + return; +#endif + int light_bit = (1 << light_num); /* note that light position is affected by the current modelview matrix! */ @@ -426,6 +409,10 @@ void GPU_basic_shader_light_set(int light_num, GPULightData *light) void GPU_basic_shader_light_set_viewer(bool local) { +#ifdef WITH_GL_PROFILE_CORE + return; +#endif + glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, (local) ? GL_TRUE: GL_FALSE); } |