2 # Copyright © 2018 Intel Corporation
4 # Permission is hereby granted, free of charge, to any person obtaining a copy
5 # of this software and associated documentation files (the "Software"), to deal
6 # in the Software without restriction, including without limitation the rights
7 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 # copies of the Software, and to permit persons to whom the Software is
9 # furnished to do so, subject to the following conditions:
11 # The above copyright notice and this permission notice shall be included in
12 # all copies or substantial portions of the Software.
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 """A minimal profile that aims to touch test most major OpenGL features with as
23 few tests as possible.
25 This is largely aimed at bring up of a new driver or a driver on new hardware,
26 where performance and stability are not necessarily the best. The idea is to
27 touch the main functionality of important features without running for too
28 long. This *will* miss many corner cases, that's okay. For more stable
29 hardware or software stacks the "gpu" or "quick" profiles are probably more
33 from __future__
import (
34 absolute_import
, division
, print_function
, unicode_literals
38 from framework
import grouptools
39 from framework
.profile
import TestProfile
40 from framework
.test
import PiglitGLTest
41 from framework
.test
.shader_test
import ShaderTest
42 from .py_modules
.constants
import GENERATED_TESTS_DIR
, TESTS_DIR
46 basepath
= os
.path
.normpath(os
.path
.join(TESTS_DIR
, '..'))
47 gen_basepath
= os
.path
.relpath(os
.path
.join(GENERATED_TESTS_DIR
, '..'), basepath
)
50 def add_shader_test(shader
):
51 """Given an adder, creates a group and adds a shader test."""
52 for d
in (TESTS_DIR
, GENERATED_TESTS_DIR
,):
53 s
= os
.path
.abspath(os
.path
.join(d
, shader
))
59 dirpath
, filename
= os
.path
.split(os
.path
.join(basedir
, shader
))
60 dirname
= os
.path
.relpath(dirpath
, basepath
)
61 filepath
= os
.path
.join(dirname
, filename
)
63 if os
.path
.commonprefix([abs_path
, GENERATED_TESTS_DIR
]) == GENERATED_TESTS_DIR
:
64 installpath
= os
.path
.relpath(filepath
, gen_basepath
)
68 groupname
= grouptools
.from_path(os
.path
.relpath(dirpath
, basedir
))
69 testname
= os
.path
.splitext(os
.path
.basename(shader
))[0]
70 group
= grouptools
.join(groupname
, testname
)
71 profile
.test_list
[group
] = ShaderTest
.new(filepath
, installpath
)
74 profile
= TestProfile()
77 'fast_color_clear/all-colors.shader_test',
78 'shaders/arb_texture_gather-miplevels.shader_test',
79 'shaders/glsl-algebraic-add-zero.shader_test',
80 'shaders/glsl-derivs-varyings.shader_test',
81 'shaders/glsl-fs-max-3.shader_test',
82 'shaders/glsl-fs-texture2d-branching.shader_test',
83 'shaders/glsl-vs-mat-mul-1.shader_test',
84 'spec/amd_shader_trinary_minmax/execution/built-in-functions/cs-max3-uvec4-uvec4-uvec4.shader_test',
85 'spec/amd_shader_trinary_minmax/execution/built-in-functions/tcs-max3-vec4-vec4-vec4.shader_test',
86 'spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-mixed-const-non-const-uniform-index.shader_test',
87 'spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst.shader_test',
88 'spec/arb_compute_shader/execution/basic-ssbo.shader_test',
89 'spec/arb_compute_shader/execution/shared-atomics.shader_test',
90 'spec/arb_derivative_control/execution/dfdx-dfdy.shader_test',
91 'spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldReverse.shader_test',
92 'spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-distance-dvec4-dvec4.shader_test',
93 'spec/arb_gpu_shader_int64/execution/built-in-functions/cs-op-div-i64vec4-i64vec4.shader_test',
94 'spec/arb_shader_ballot/execution/fs-readFirstInvocation-uint-loop.shader_test',
95 'spec/arb_shader_group_vote/cs-all.shader_test',
96 'spec/arb_shader_image_load_store/execution/write-to-rendered-image.shader_test',
97 'spec/arb_shader_precision/gs-op-div-vec4-vec4.shader_test',
98 'spec/arb_shader_subroutine/execution/two-subroutines-nested.shader_test',
99 'spec/arb_shader_texture_lod/execution/glsl-fs-shadow2DGradARB-cumulative.shader_test',
100 'spec/arb_tessellation_shader/execution/barrier-patch.shader_test',
101 'spec/arb_tessellation_shader/execution/built-in-functions/tcs-any-bvec4-using-if.shader_test',
102 'spec/arb_tessellation_shader/execution/sanity.shader_test',
103 'spec/arb_vertex_attrib_64bit/execution/vs_in/vs-input-uint_uvec4-double_dmat3x4_array2-position.shader_test',
104 'spec/glsl-1.50/execution/geometry-basic.shader_test',
105 'spec/oes_viewport_array/viewport-gs-write-simple.shader_test',
108 for shader_test
in shader_tests
:
109 add_shader_test(shader_test
)
111 with profile
.test_list
.group_manager(
113 grouptools
.join('spec', 'glsl-1.50')) as g
:
114 g(['glsl-1.50-transform-feedback-builtins'], 'transform-feedback-builtins')