Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2020-12-18 11:56:28 +0300
committerJeroen Bakker <jeroen@blender.org>2021-01-13 16:29:47 +0300
commit2db277092d8322abc3851ba18368ac370e2dd0dd (patch)
treeb12896a2b77313a0178c43bc21269f28bc03efe7
parent96336007e9bb55de4b065c89cec3e335b0d2b73a (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.cc7
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 3b0aa055588..57be56112f2 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;
}
}