1# Copyright 2019 Google LLC.
2# Copyright 2019 The Khronos Group Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     https://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16[vertex shader]
17#version 430
18
19layout(location = 0) in vec4 position_in;
20layout(location = 1) in vec4 color_in;
21layout(location = 0) flat out vec4 color_out;
22
23void main() {
24  gl_Position = position_in;
25  color_out = color_in;
26}
27
28[fragment shader]
29#version 430
30
31layout(location = 0) flat in vec4 color_in;
32layout(location = 0) out vec4 color_out;
33
34void main() {
35  color_out = color_in;
36}
37
38[vertex data]
39# Provoking vertices are all red.
400/R32G32B32_SFLOAT  1/R8G8B8A8_UNORM
41-1.0 -0.5  0.0       255   0    0   255 # line 0
42 1.0 -0.5  0.0        0   255   0   255
43-1.0  0.5  0.0       255   0    0   255 # line 1
44 1.0  0.5  0.0        0   255   0   255
45
46[test]
47# Clear color buffer to red and check the drawing doesn't
48# add any other colors from non-provoking vertices.
49clear color 255 0 0 255
50clear
51draw arrays LINE_LIST 0 4
52probe all rgb 1.0, 0.0, 0.0
53