I hope this helps . The error is not related to the layout location qualifier or the vertex shader input variables respectively attributes. But the type specification is missing in the declaration of the vertex shader output variables:
out vec3 vs_position;
out vec3 vs_color;
out vec2 vs_texcoord;
wish help you to fix your issue Ok first thing I would suggest, is to turn on debug layer (Use Debug flag when you create your device), then go to project properties, debug tab, and tick "Enable unmanaged code debugging" or "Enable native code debugging". When you start to debug the program the runtime will give you potential warnings if something wrong with pipeline state.
I think the issue was by ths following , The vertex positions go through the perspective division and viewport transform after they leave the vertex shader. That transforms them from clip coordinates (-1..1 in x,y, 0..1 in z) to framebuffer coordinates (x=0..width-1, y=0..height-1, z=0..1). The fragment shader receives interpolated positions in the framebuffer coordinate space. Since the fragment position coordinates are in framebuffer space, almost all of the xy values will be greater then 1.0, so your color will just be maximum red, maximum green, and then whatever z value you've got. You probably want to re-normalize them, i.e. divide the position x value by the framebuffer width and position y by framebuffer height.
Why would copying a value from vertex shader input to vertex shader (flat) output result in a different value?
should help you out You have to use glVertexAttribIPointer (focus on I) for the specification of integral attributes. In compare to glVertexAttribPointer for floating point attributes. See glVertexAttribPointer. Note, the type parameter of this functions specifies the type of the source data only, but it doesn't say anything about the type of the attribute. For each attribute base type (float point, integral, 64-bit double precision float), there is a different function.