diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-12-03 17:22:02 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-12-05 13:16:29 +0300 |
commit | cf77b67c459d481f6d8d34d13e14d22a6cad0842 (patch) | |
tree | 47475c5b16a0f3a2ffc1d22766e48acdc91f22eb /source/blender/draw/intern/shaders/common_view_lib.glsl | |
parent | 6ba09f8515bd7968d8f1ef13ff19b5c05898660e (diff) |
Fix T71576 Mesh error on mutimaterial Meshes on legacy nvidia drivers
Differential Revision: https://developer.blender.org/D6351
Diffstat (limited to 'source/blender/draw/intern/shaders/common_view_lib.glsl')
-rw-r--r-- | source/blender/draw/intern/shaders/common_view_lib.glsl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/draw/intern/shaders/common_view_lib.glsl b/source/blender/draw/intern/shaders/common_view_lib.glsl index 1a28a307163..182a4c72fe5 100644 --- a/source/blender/draw/intern/shaders/common_view_lib.glsl +++ b/source/blender/draw/intern/shaders/common_view_lib.glsl @@ -80,7 +80,7 @@ uniform int baseInstance; # if defined(IN_PLACE_INSTANCES) || defined(INSTANCED_ATTRIB) /* When drawing instances of an object at the same position. */ # define instanceId 0 -# elif defined(GPU_DEPRECATED_AMD_DRIVER) +# elif defined(GPU_DEPRECATED_AMD) /* A driver bug make it so that when using an attribute with GL_INT_2_10_10_10_REV as format, * the gl_InstanceID is incremented by the 2 bit component of the attrib. * Ignore gl_InstanceID then. */ @@ -115,8 +115,11 @@ flat in int resourceIDFrag; # define resource_id resourceIDFrag #endif -#if !defined(GPU_INTEL) && !defined(GPU_DEPRECATED_AMD_DRIVER) && !defined(OS_MAC) && \ - !defined(INSTANCED_ATTRIB) +#if !defined(GPU_INTEL) && !defined(GPU_DEPRECATED_AMD) && !defined(GPU_DEPRECATED_NVIDIA) +# define USE_INDEXED_MODELMAT +#endif + +#if defined(USE_INDEXED_MODELMAT) && !defined(OS_MAC) && !defined(INSTANCED_ATTRIB) struct ObjectMatrices { mat4 drw_modelMatrix; mat4 drw_modelMatrixInverse; |