Blender Git Commit Log

Git Commits -> Revision 765d724

Revision 765d724 by Clément Foucault (master)
March 11, 2018, 22:44 (GMT)
GPUMaterial: Add Material shader cache.

This is mostly to avoid re-compilation when using undo/redo operators.
This also has the benefit to reuse the same GPUShader for multiple materials using the same nodetree configuration.

The cache stores GPUPasses that already contains the shader code and a hash to test for matches.
We use refcounts to know when a GPUPass is not used anymore.

I had to move the GPUInput list from GPUPass to GPUMaterial because it's containing references to the material nodetree and cannot be reused.

A garbage collection is hardcoded to run every 60 seconds to free every unused GPUPass.

Commit Details:

Full Hash: 765d7242d5a14551d0dc876f13bf6ee579b47b10
Parent Commit: 7194259
Lines Changed: +200, -99

7 Modified Paths:

/source/blender/draw/intern/draw_manager_data.c (+6, -7) (Diff)
/source/blender/editors/space_view3d/view3d_draw.c (+2, -0) (Diff)
/source/blender/gpu/GPU_material.h (+4, -0) (Diff)
/source/blender/gpu/intern/gpu_codegen.c (+158, -75) (Diff)
/source/blender/gpu/intern/gpu_codegen.h (+13, -9) (Diff)
/source/blender/gpu/intern/gpu_material.c (+15, -8) (Diff)
/source/blender/windowmanager/intern/wm_init_exit.c (+2, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021