/*
Storage of 16,384 B can be interpreted as:
	4096 floats
	1024 4-vectors
	≈341 3⨯4 matrices (note `mat4x3` means a 3⨯4 matrix)
	256  4⨯4 matrices
*/

#define MAX_INST_MATRS 128
#define MAX_INST_VECS  256

uniform UBO
{
	mat4x4 matr_PV;
	mat4x4 matr_PV_inv;

	vec4   viewport;
	vec4   camera_pos_xyzw;
	vec4   light_pos_xyzw;

	float  clip_near;
	float  clip_far ;
	float  shadow_darkness;
	float  shadowmap_res_recip;

	//(Note at 16 float boundary here)

	mat4x4 matr_PV_light;

	//Offset 64 `float`s
	mat4x3 inst_matrs_M[MAX_INST_MATRS]; //Note padded out to 4⨯4 by OpenGL's alignment

	//Offset 64+128*16=2112 `float`s
	vec4 inst_vecs[MAX_INST_VECS];
};
#if 16+16 + 4+4+4+4*1 + 16 + (12+4)*MAX_INST_MATRS + 4*MAX_INST_VECS > 16384/4
	#error "Too many instances!"
#endif

uniform int inst_offset; //`int` instead of `uint` because added to `gl_InstanceID`
