GPU_shader_export tests if GPUDynamicType is a lamp by checking against the interval (GPU_DYNAMIC_LAMP_FIRST=6,GPU_DYNAMIC_LAMP_LAST=11), which is no longer sufficient.

The enum GPUDynamicType has unfortunately evolved two separate intervals for GPU_DYNAMIC_LAMP_*, which LAMP_FIRST/LAST no longer covers.

Fix
Since the original intent of GPU_DYNAMIC_LAMP_FIRST and GPU_DYNAMIC_LAMP_LAST has been lost. This patch (against master) replaces them with the macro test function GPU_DYNAMIC_IS_LAMP(GPUDynamicType).

I propose we just nuke the whole value range, for the following reasons:

The old method of using LAMP_FIRST/LAST already caused one bug.

The new method is more organized, flexible, maintainable, and allows for arbitrary group membership testing.

The old value range is excluded from the new range. Some scripts hard code against the old values, because the current python API is missing constants. These scripts will hard fail with the new values, instead of possibly introducing subtle bugs, due to the symbolic semantics changing.

Even in python these values would be used as runtime values. I would hardly expect anyone to store GPU_DYNAMIC_LAMP_DYNPERSMAT in a file for further reference. Instead, such values will likely be referenced during runtime and should always fetch the correct values.

Regarding the third point in my previous post: several of the constants were completely missing from the python context, requiring people to hack around it by checking the C header, and re-defining it themselves in their script. The GPU python module is missing core types needed to determine what kind of uniform the export_shader function is referring to.

I would hardly expect anyone to store GPU_DYNAMIC_LAMP_DYNPERSMAT in a file for further reference. Instead, such values will likely be referenced during runtime and should always fetch the correct values.

note: asking for mails as author isn't so precise, since name+mail with some minor difference comes up as a different author.
also posting email addr on public site isn't so nice.
Patches uploaded using arc will include author info.