diff options
author | Jeroen Bakker <jeroen@blender.org> | 2020-12-18 11:56:28 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-12-18 11:56:28 +0300 |
commit | ffb6648a970e72a749c7de3c5645450ba7d8d858 (patch) | |
tree | 58f399b5ceb03b52693f267dd2edcbe70e218293 /source | |
parent | 4f9e21bdc9772603acc0ba6727da9dd67287ac0f (diff) |
Fix T83625: Shading attribute names cause compilation error.
Some GPU platforms don't support having more than one underscore in
sequence in an attribute name. This change will remove the underscore
as a possible character when encoding to save names.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_vertex_format.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_vertex_format.cc b/source/blender/gpu/intern/gpu_vertex_format.cc index cd6d78a185d..014c70033fc 100644 --- a/source/blender/gpu/intern/gpu_vertex_format.cc +++ b/source/blender/gpu/intern/gpu_vertex_format.cc @@ -262,13 +262,12 @@ void GPU_vertformat_attr_rename(GPUVertFormat *format, int attr_id, const char * /* Encode 8 original bytes into 11 safe bytes. */ static void safe_bytes(char out[11], const char data[8]) { - char safe_chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"; + char safe_chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; uint64_t in = *(uint64_t *)data; for (int i = 0; i < 11; i++) { - /* Encoding in base63 */ - out[i] = safe_chars[in % 63lu]; - in /= 63lu; + out[i] = safe_chars[in % 62lu]; + in /= 62lu; } } |