Use gl_VertexIndex / gl_InstanceIndex instead of ID variants on vulkan

This commit is contained in:
baldurk
2016-02-28 12:15:56 +01:00
parent 81ff983fa2
commit a6a4ae6cd9
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -36,5 +36,5 @@ void main(void)
vec4(-1.0, 1.0, 0.5, 1.0),
vec4( 1.0, 1.0, 0.5, 1.0));
gl_Position = verts[gl_VertexID];
gl_Position = verts[gl_VertexIndex];
}
+1 -1
View File
@@ -56,7 +56,7 @@ void main(void)
pos.y = -pos.y;
gl_Position = Mesh.mvp * pos;
gl_Position.xy += Mesh.pointSpriteSize.xy*0.01f*psprite[gl_VertexID%4]*gl_Position.w;
gl_Position.xy += Mesh.pointSpriteSize.xy*0.01f*psprite[gl_VertexIndex%4]*gl_Position.w;
OUT.secondary = secondary;
OUT.norm = vec4(0, 0, 1, 1);
+2 -2
View File
@@ -42,8 +42,8 @@ void main(void)
vec3( 0.0, 1.0, 0.5),
vec3( 1.0, 1.0, 0.5));
vec3 pos = verts[gl_VertexID];
uint strindex = gl_InstanceID;
vec3 pos = verts[gl_VertexIndex];
uint strindex = gl_InstanceIndex;
vec2 charPos = vec2(strindex + pos.x + general.TextPosition.x, pos.y + general.TextPosition.y);