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:
authorClément Foucault <foucault.clem@gmail.com>2019-08-14 23:18:47 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-08-15 00:59:33 +0300
commitdeb5416a1a50e153cf2f9e3809755a5e82bd8f85 (patch)
tree4884568ffb2bac6b78c681569ce18260795d06b3 /source/blender/gpu/GPU_shader.h
parent67f49f9c03c95eb3a62ece38db0ae8feafd4992e (diff)
GPU: Vertex Format: ADd function for safe GLSL attrib name
This remove code duplication and use base63 encoding of the hash. Use mumur hash to have more randomness.
Diffstat (limited to 'source/blender/gpu/GPU_shader.h')
-rw-r--r--source/blender/gpu/GPU_shader.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h
index 124f1f1ff8a..f4a94c7759a 100644
--- a/source/blender/gpu/GPU_shader.h
+++ b/source/blender/gpu/GPU_shader.h
@@ -396,7 +396,9 @@ void GPU_shader_free_builtin_shaders(void);
/* Vertex attributes for shaders */
-#define GPU_MAX_ATTR 32
+/* Hardware limit is 16. Position attribute is always needed so we reduce to 15.
+ * This makes sure the GPUVertexFormat name buffer does not overflow. */
+#define GPU_MAX_ATTR 15
typedef struct GPUVertAttrLayers {
struct {