diff options
author | Jeroen Bakker <jeroen@blender.org> | 2020-12-18 11:56:28 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-01-13 11:31:07 +0300 |
commit | 6c777ed76b3d4342d50f6f87f24f758473816a60 (patch) | |
tree | c8b7ef5362b65775550821512fd9e45021386468 | |
parent | 7edf1e64b3db0443cc9993f102170933380620e3 (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.
-rw-r--r-- | source/blender/gpu/intern/gpu_vertex_format.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_vertex_format.c b/source/blender/gpu/intern/gpu_vertex_format.c index e6a9cb8f2f2..5afe9221b3b 100644 --- a/source/blender/gpu/intern/gpu_vertex_format.c +++ b/source/blender/gpu/intern/gpu_vertex_format.c @@ -264,13 +264,12 @@ int GPU_vertformat_attr_id_get(const GPUVertFormat *format, const char *name) /* Encode 8 original bytes into 11 safe bytes. */ static void safe_bytes(char out[11], const char data[8]) { - char safe_chars[63] = "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; } } |