mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
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.
This commit is contained in:
parent
96336007e9
commit
2db277092d
1 changed files with 3 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue