Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/shaders/common_view_lib.glsl
| Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
| # define baseInstance gl_BaseInstanceARB | # define baseInstance gl_BaseInstanceARB | ||||
| # else /* no ARB_shader_draw_parameters */ | # else /* no ARB_shader_draw_parameters */ | ||||
| uniform int baseInstance; | uniform int baseInstance; | ||||
| # endif | # endif | ||||
| # if defined(IN_PLACE_INSTANCES) || defined(INSTANCED_ATTRIB) | # if defined(IN_PLACE_INSTANCES) || defined(INSTANCED_ATTRIB) | ||||
| /* When drawing instances of an object at the same position. */ | /* When drawing instances of an object at the same position. */ | ||||
| # define instanceId 0 | # 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, | /* 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. | * the gl_InstanceID is incremented by the 2 bit component of the attrib. | ||||
| * Ignore gl_InstanceID then. */ | * Ignore gl_InstanceID then. */ | ||||
| # define instanceId 0 | # define instanceId 0 | ||||
| # else | # else | ||||
| # define instanceId gl_InstanceID | # define instanceId gl_InstanceID | ||||
| # endif | # endif | ||||
| Show All 18 Lines | |||||
| # define PASS_RESOURCE_ID(i) resourceIDFrag = resource_id[i]; | # define PASS_RESOURCE_ID(i) resourceIDFrag = resource_id[i]; | ||||
| #endif | #endif | ||||
| #ifdef GPU_FRAGMENT_SHADER | #ifdef GPU_FRAGMENT_SHADER | ||||
| flat in int resourceIDFrag; | flat in int resourceIDFrag; | ||||
| # define resource_id resourceIDFrag | # define resource_id resourceIDFrag | ||||
| #endif | #endif | ||||
| #if !defined(GPU_INTEL) && !defined(GPU_DEPRECATED_AMD_DRIVER) && !defined(OS_MAC) && \ | #if !defined(GPU_INTEL) && !defined(GPU_DEPRECATED_AMD) && !defined(GPU_DEPRECATED_NVIDIA) | ||||
| !defined(INSTANCED_ATTRIB) | # define USE_INDEXED_MODELMAT | ||||
| #endif | |||||
| #if defined(USE_INDEXED_MODELMAT) && !defined(OS_MAC) && !defined(INSTANCED_ATTRIB) | |||||
| struct ObjectMatrices { | struct ObjectMatrices { | ||||
| mat4 drw_modelMatrix; | mat4 drw_modelMatrix; | ||||
| mat4 drw_modelMatrixInverse; | mat4 drw_modelMatrixInverse; | ||||
| }; | }; | ||||
| layout(std140) uniform modelBlock | layout(std140) uniform modelBlock | ||||
| { | { | ||||
| ObjectMatrices drw_matrices[DRW_RESOURCE_CHUNK_LEN]; | ObjectMatrices drw_matrices[DRW_RESOURCE_CHUNK_LEN]; | ||||
| ▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines | |||||