Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_codegen.c
| Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
| static char *glsl_material_library = NULL; | static char *glsl_material_library = NULL; | ||||
| /* -------------------- GPUPass Cache ------------------ */ | /* -------------------- GPUPass Cache ------------------ */ | ||||
| /** | /** | ||||
| * Internal shader cache: This prevent the shader recompilation / stall when | * Internal shader cache: This prevent the shader recompilation / stall when | ||||
| * using undo/redo AND also allows for GPUPass reuse if the Shader code is the | * using undo/redo AND also allows for GPUPass reuse if the Shader code is the | ||||
| * same for 2 different Materials. Unused GPUPasses are free by Garbage collection. | * same for 2 different Materials. Unused GPUPasses are free by Garbage collection. | ||||
| **/ | */ | ||||
| /* Only use one linklist that contains the GPUPasses grouped by hash. */ | /* Only use one linklist that contains the GPUPasses grouped by hash. */ | ||||
| static GPUPass *pass_cache = NULL; | static GPUPass *pass_cache = NULL; | ||||
| static SpinLock pass_cache_spin; | static SpinLock pass_cache_spin; | ||||
| static uint32_t gpu_pass_hash(const char *frag_gen, const char *defs, GPUVertAttrLayers *attrs) | static uint32_t gpu_pass_hash(const char *frag_gen, const char *defs, GPUVertAttrLayers *attrs) | ||||
| { | { | ||||
| BLI_HashMurmur2A hm2a; | BLI_HashMurmur2A hm2a; | ||||
| ▲ Show 20 Lines • Show All 1,986 Lines • Show Last 20 Lines | |||||