Implement a new intern type for editing GPUVertFormat attributes:
GPUVertAttr
In python, it is not uncommon to automatically create a GPUVertFormat
through the GPUShader.format_calc() method.
This conveniently avoids the need to call
GPUVertFormat.attr_add(id, comp_type, len, fetch_mode) for every
attribute that Shader supports.
However, once a GPUVertFormat is created, it cannot be changed.
This is an inconvenient limitation as VBOs with a 2D format attribute
are correctly read by Shaders that support a 3D attribute.
This patch proposes the creation of a new internal type for editing
attributes: GPUVertAttr.
So we can edit an attribute as follows:
import gpu
shader = gpu.shader.from_builtin('3D_POLYLINE_UNIFORM_COLOR')
format = shader.format_calc()
format['pos'].len = 2