Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee1de45

Browse files
committed
Remove GL_ARB_separate_shader_objects and gl_PerVertex references since they are no longer/not required (fixes #112)
1 parent 2ddae4e commit ee1de45

8 files changed

Lines changed: 6 additions & 44 deletions

File tree

03_Drawing_a_triangle/02_Graphics_pipeline_basics/01_Shader_modules.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ code looks like this:
8787

8888
```glsl
8989
#version 450
90-
#extension GL_ARB_separate_shader_objects : enable
91-
92-
out gl_PerVertex {
93-
vec4 gl_Position;
94-
};
9590
9691
vec2 positions[3] = vec2[](
9792
vec2(0.0, -0.5),
@@ -110,8 +105,7 @@ the vertex buffer, but in our case it will be an index into a hardcoded array
110105
of vertex data. The position of each vertex is accessed from the constant array
111106
in the shader and combined with dummy `z` and `w` components to produce a
112107
position in clip coordinates. The built-in variable `gl_Position` functions as
113-
the output. The `GL_ARB_separate_shader_objects` extension is required for
114-
Vulkan shaders to work.
108+
the output.
115109

116110
## Fragment shader
117111

@@ -204,10 +198,6 @@ The contents of `shader.vert` should be:
204198
#version 450
205199
#extension GL_ARB_separate_shader_objects : enable
206200
207-
out gl_PerVertex {
208-
vec4 gl_Position;
209-
};
210-
211201
layout(location = 0) out vec3 fragColor;
212202
213203
vec2 positions[3] = vec2[](

04_Vertex_buffers/00_Vertex_input_description.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ layout(location = 1) in vec3 inColor;
2121
2222
layout(location = 0) out vec3 fragColor;
2323
24-
out gl_PerVertex {
25-
vec4 gl_Position;
26-
};
27-
2824
void main() {
2925
gl_Position = vec4(inPosition, 0.0, 1.0);
3026
fragColor = inColor;

05_Uniform_buffers/00_Descriptor_layout_and_buffer.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ layout(location = 1) in vec3 inColor;
7979
8080
layout(location = 0) out vec3 fragColor;
8181
82-
out gl_PerVertex {
83-
vec4 gl_Position;
84-
};
85-
8682
void main() {
8783
gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0);
8884
fragColor = inColor;

code/09_shader_base.vert

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#version 450
22
#extension GL_ARB_separate_shader_objects : enable
33

4-
out gl_PerVertex {
5-
vec4 gl_Position;
6-
};
7-
84
layout(location = 0) out vec3 fragColor;
95

106
vec2 positions[3] = vec2[](
@@ -22,4 +18,4 @@ vec3 colors[3] = vec3[](
2218
void main() {
2319
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
2420
fragColor = colors[gl_VertexIndex];
25-
}
21+
}

code/17_shader_vertexbuffer.vert

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ layout(location = 1) in vec3 inColor;
66

77
layout(location = 0) out vec3 fragColor;
88

9-
out gl_PerVertex {
10-
vec4 gl_Position;
11-
};
12-
139
void main() {
1410
gl_Position = vec4(inPosition, 0.0, 1.0);
1511
fragColor = inColor;
16-
}
12+
}

code/21_shader_ubo.vert

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ layout(location = 1) in vec3 inColor;
1212

1313
layout(location = 0) out vec3 fragColor;
1414

15-
out gl_PerVertex {
16-
vec4 gl_Position;
17-
};
18-
1915
void main() {
2016
gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0);
2117
fragColor = inColor;
22-
}
18+
}

code/25_shader_textures.vert

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ layout(location = 2) in vec2 inTexCoord;
1414
layout(location = 0) out vec3 fragColor;
1515
layout(location = 1) out vec2 fragTexCoord;
1616

17-
out gl_PerVertex {
18-
vec4 gl_Position;
19-
};
20-
2117
void main() {
2218
gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0);
2319
fragColor = inColor;
2420
fragTexCoord = inTexCoord;
25-
}
21+
}

code/26_shader_depth.vert

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ layout(location = 2) in vec2 inTexCoord;
1414
layout(location = 0) out vec3 fragColor;
1515
layout(location = 1) out vec2 fragTexCoord;
1616

17-
out gl_PerVertex {
18-
vec4 gl_Position;
19-
};
20-
2117
void main() {
2218
gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0);
2319
fragColor = inColor;
2420
fragTexCoord = inTexCoord;
25-
}
21+
}

0 commit comments

Comments
 (0)