OpenGL: manage built-in shaders better
authorMike Erwin <significant.bit@gmail.com>
Wed, 9 Nov 2016 04:53:59 +0000 (22:53 -0600)
committerMike Erwin <significant.bit@gmail.com>
Wed, 9 Nov 2016 04:53:59 +0000 (22:53 -0600)
commita0ae6d7116c289335a870b5ff5360f896af327ba
tree635ab70eee2d5ff851ae396a66985cffb3f142c2
parent2b726b054e3385708b031bebb50c59f7cbb7c149
OpenGL: manage built-in shaders better

As our library of built-in shaders grows, it's important to create, access, and discard them efficiently.

Lookup via GPU_shader_get_builtin is now constant time instead of linear (# of built-in shaders). This is called very often with our new immediate mode.

Creation and discard are unified.

Adding a new shader requires fewer steps.

365 lines shorter  :D
source/blender/gpu/GPU_shader.h
source/blender/gpu/intern/gpu_shader.c