Merge branch 'master' into blender2.8
[blender.git] / source / blender / gpu / intern / gpu_buffers.c
index 6ff4a60610bbd12eed8bd2493c516b8dc1706b93..bd7a3b628c8af03d587dc7ecb7ff787ebc700a1e 100644 (file)
@@ -822,6 +822,12 @@ void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numda
        
        for (i = 0; i < numdata; i++) {
                glEnableVertexAttribArray(data[i].index);
+               int info = 0;
+               if (data[i].type == GL_UNSIGNED_BYTE) {
+                       info |= GPU_ATTR_INFO_SRGB;
+               }
+               glUniform1i(data[i].info_index, info);
+
                glVertexAttribPointer(data[i].index, data[i].size, data[i].type,
                                         GL_TRUE, elementsize, BUFFER_OFFSET(offset));
                offset += data[i].size * GPU_typesize(data[i].type);