File: point-size-out.shader_test

package info (click to toggle)
piglit 0~git20220119-124bca3c9-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 109,012 kB
  • sloc: ansic: 273,511; xml: 46,666; python: 33,098; lisp: 20,392; cpp: 12,480; sh: 22; makefile: 22; pascal: 5
file content (62 lines) | stat: -rw-r--r-- 1,344 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Basic test of the functionality of the geometry shader output
# gl_PointSize.
#
# This test draws a small point in the left half of the window and a
# large point in the right half.  Then it probes the region around
# each point to ensure that the point on the right is larger.
#
# NOTE: since gl_PointSize is expressed in pixels, but gl_Position is
# expressed relative to the window size, this test is dependent upon
# the window size.  It uses a window size of 250x250, which is
# specified as the size requirement for the test.

[require]
GLSL >= 1.50
SIZE 250 250

[vertex shader]
#version 150

void main()
{
}

[geometry shader]
#version 150

layout(points) in;
layout(points, max_vertices = 2) out;

out vec4 color;

void main()
{
  gl_Position = vec4(-0.5, 0.0, 0.0, 1.0);
  gl_PointSize = 1.0;
  color = vec4(1.0);
  EmitVertex();
  gl_Position = vec4(0.5, 0.0, 0.0, 1.0);
  gl_PointSize = 13.0;
  color = vec4(1.0);
  EmitVertex();
}

[fragment shader]
#version 150

in vec4 color;

void main()
{
  gl_FragColor = color;
}

[test]
clear color 0.0 0.0 0.0 0.0
clear
enable GL_PROGRAM_POINT_SIZE
draw arrays GL_POINTS 0 1
relative probe rgba (0.24, 0.5) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (0.26, 0.5) (0.0, 0.0, 0.0, 0.0)
relative probe rgba (0.74, 0.5) (1.0, 1.0, 1.0, 1.0)
relative probe rgba (0.76, 0.5) (1.0, 1.0, 1.0, 1.0)