diff options
author | Clément Foucault <fclem> | 2022-09-02 14:48:55 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-09-02 14:51:43 +0300 |
commit | de818d81c3f9868ca78399fa7f106bed893e540f (patch) | |
tree | f98d9d42e4684ec165a25d82889224f6603ef835 /source/blender/gpu/GPU_material.h | |
parent | f366d197db24cf611866a8d847b4022a6a46504e (diff) |
Fix T98190: EEVEE: Very slow rendering on Intel HD Graphics 4400
This particular GPU driver does not constant fold all the way in order
to discard the unused branches.
To workaround that, we introduce a series of material flag that generates
defines that only keep used branches.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D15852
Diffstat (limited to 'source/blender/gpu/GPU_material.h')
-rw-r--r-- | source/blender/gpu/GPU_material.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index 3ca465fa57a..ddd8300bf0f 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -77,12 +77,20 @@ typedef enum eGPUMaterialFlag { GPU_MATFLAG_HOLDOUT = (1 << 6), GPU_MATFLAG_SHADER_TO_RGBA = (1 << 7), GPU_MATFLAG_AO = (1 << 8), + GPU_MATFLAG_CLEARCOAT = (1 << 9), GPU_MATFLAG_OBJECT_INFO = (1 << 10), GPU_MATFLAG_AOV = (1 << 11), GPU_MATFLAG_BARYCENTRIC = (1 << 20), + /* Optimization to only add the branches of the principled shader that are necessary. */ + GPU_MATFLAG_PRINCIPLED_CLEARCOAT = (1 << 21), + GPU_MATFLAG_PRINCIPLED_METALLIC = (1 << 22), + GPU_MATFLAG_PRINCIPLED_DIELECTRIC = (1 << 23), + GPU_MATFLAG_PRINCIPLED_GLASS = (1 << 24), + GPU_MATFLAG_PRINCIPLED_ANY = (1 << 25), + /* Tells the render engine the material was just compiled or updated. */ GPU_MATFLAG_UPDATED = (1 << 29), |