In short: No, you can't use textures samplers as vertex input. They must be uniform.
So, there are two possible solutions, each solution is better at specifics scenrios:
If each of your geometry (what you call vertices) has different shader code, then if your uber-shader (the one shader that renders them all) is pretty heavy (lots of branching and function calls) I recommend you separate them in more than one draw call.
For that, you must be sure that each of your shaders procedure is very different from each other (e.g., some are opaque while others are transparent or alpha tested).
But if some just have different maps (like some does normal mapping and others dont), then I recomend you recycle the code without using branching, like using a 1x1 pixel normalmap when you don't have normal mapping
If each of your geometry has quite similar shader code but different textures you may use Array textures, they are not memory friendly (because all textures on the array need to have the same size) but you may draw them using one draw call:
- on CPU side: Array textures are created like usual 2D textures (just use GL_TEXTURE_2D_ARRAY for creation and binding)
- when loading to GPU you have to load like a 3D texture, i.e., using glTexSubImage3D. Your zoffset represents the texture index and your depth must be 1 for each element on the array
- on the shader side you use sampler2DArray and sample it like a 3D texture, where Z is the texture index.
Here is a sample shader fragment of code:
uniform sampler2DArray myArrayTexture;
in vec2 texCoord;
...
vec4 color1 = texture(myArrayTexture, vec3(texCoord, 0)); // sampling index 0
vec4 color2 = texture(myArrayTexture, vec3(texCoord, 1)); // sampling index 1
here is how you load the array into your GPU:
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, width, height, 1, format, type, dataAtIndex0);
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, 1, width, height, 1, format, type, dataAtIndex1);
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, 2, width, height, 1, format, type, dataAtIndex2);
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, 3, width, height, 1, format, type, dataAtIndex3);
...