|
|
@@ -18,7 +18,7 @@ def compile_and_get_caps(stage, code):
|
|
|
|
|
|
|
|
|
def test_legacy_glsl_caps_basic_vertex():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 120
|
|
|
|
|
|
void main() {
|
|
|
@@ -28,7 +28,7 @@ def test_legacy_glsl_caps_basic_vertex():
|
|
|
|
|
|
|
|
|
def test_legacy_glsl_caps_basic_fragment():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 120
|
|
|
|
|
|
void main() {
|
|
|
@@ -38,7 +38,7 @@ def test_legacy_glsl_caps_basic_fragment():
|
|
|
|
|
|
|
|
|
def test_legacy_glsl_caps_unified_model():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 130
|
|
|
|
|
|
void main() {
|
|
|
@@ -47,7 +47,7 @@ def test_legacy_glsl_caps_unified_model():
|
|
|
""") == Shader.C_unified_model
|
|
|
|
|
|
# Optional extension doesn't trigger it
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 120
|
|
|
|
|
|
#extension GL_EXT_gpu_shader4 : enable
|
|
|
@@ -58,7 +58,7 @@ def test_legacy_glsl_caps_unified_model():
|
|
|
""") == 0
|
|
|
|
|
|
# Required extension does
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 120
|
|
|
|
|
|
#extension GL_EXT_gpu_shader4 : require
|
|
|
@@ -69,7 +69,7 @@ def test_legacy_glsl_caps_unified_model():
|
|
|
""") == Shader.C_unified_model
|
|
|
|
|
|
# Extension under #if doesn't either
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 120
|
|
|
|
|
|
#if foobar
|
|
|
@@ -83,7 +83,7 @@ def test_legacy_glsl_caps_unified_model():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_basic_vertex():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 330
|
|
|
|
|
|
void main() {
|
|
|
@@ -93,7 +93,7 @@ def test_glsl_caps_basic_vertex():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_basic_fragment():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
out vec4 p3d_FragColor;
|
|
|
@@ -105,7 +105,7 @@ def test_glsl_caps_basic_fragment():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_vertex_texture():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 330
|
|
|
|
|
|
uniform sampler2D tex;
|
|
|
@@ -117,7 +117,7 @@ def test_glsl_caps_vertex_texture():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_point_coord():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
out vec4 p3d_FragColor;
|
|
|
@@ -129,7 +129,7 @@ def test_glsl_caps_point_coord():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_standard_derivatives():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
out vec4 p3d_FragColor;
|
|
|
@@ -141,7 +141,7 @@ def test_glsl_caps_standard_derivatives():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_shadow_samplers():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
uniform sampler2DShadow a;
|
|
|
@@ -153,7 +153,7 @@ def test_glsl_caps_shadow_samplers():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_non_square_matrices():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 330
|
|
|
|
|
|
uniform mat3x4 a;
|
|
|
@@ -165,7 +165,7 @@ def test_glsl_caps_non_square_matrices():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_unified_model_uint_uniform():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 330
|
|
|
|
|
|
uniform uint a;
|
|
|
@@ -177,7 +177,7 @@ def test_glsl_caps_unified_model_uint_uniform():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_unified_model_int_varying():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
flat in int a;
|
|
|
@@ -190,7 +190,7 @@ def test_glsl_caps_unified_model_int_varying():
|
|
|
|
|
|
def test_glsl_caps_unified_model_round():
|
|
|
# DO NOT match unified model for regular round()
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 330
|
|
|
|
|
|
uniform float a;
|
|
|
@@ -201,7 +201,7 @@ def test_glsl_caps_unified_model_round():
|
|
|
""") == 0
|
|
|
|
|
|
# DO match it for roundEven()
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 330
|
|
|
|
|
|
uniform float a;
|
|
|
@@ -213,7 +213,7 @@ def test_glsl_caps_unified_model_round():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_noperspective_interpolation():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
noperspective in vec4 a;
|
|
|
@@ -225,7 +225,7 @@ def test_glsl_caps_noperspective_interpolation():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_texture_array():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
uniform sampler2DArray a;
|
|
|
@@ -237,7 +237,7 @@ def test_glsl_caps_texture_array():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_texture_lod():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
uniform sampler2D a;
|
|
|
@@ -249,7 +249,7 @@ def test_glsl_caps_texture_lod():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_texture_query_size():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
uniform sampler2D a;
|
|
|
@@ -261,7 +261,7 @@ def test_glsl_caps_texture_query_size():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_sampler_cube_shadow():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
uniform samplerCubeShadow a;
|
|
|
@@ -273,7 +273,7 @@ def test_glsl_caps_sampler_cube_shadow():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_vertex_id():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 330
|
|
|
|
|
|
void main() {
|
|
|
@@ -283,7 +283,7 @@ def test_glsl_caps_vertex_id():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_draw_buffers():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
layout(location=0) out vec4 a;
|
|
|
@@ -297,7 +297,7 @@ def test_glsl_caps_draw_buffers():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_clip_distance():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 330
|
|
|
|
|
|
void main() {
|
|
|
@@ -308,7 +308,7 @@ def test_glsl_caps_clip_distance():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_instance_id():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 330
|
|
|
|
|
|
void main() {
|
|
|
@@ -318,7 +318,7 @@ def test_glsl_caps_instance_id():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_geometry_shader():
|
|
|
- assert compile_and_get_caps(Stage.geometry, """
|
|
|
+ assert compile_and_get_caps(Stage.GEOMETRY, """
|
|
|
#version 330
|
|
|
|
|
|
layout(triangles) in;
|
|
|
@@ -337,7 +337,7 @@ def test_glsl_caps_geometry_shader():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_primitive_id():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
void main() {
|
|
|
@@ -347,7 +347,7 @@ def test_glsl_caps_primitive_id():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_bit_encoding():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 330
|
|
|
|
|
|
uniform uint a;
|
|
|
@@ -359,7 +359,7 @@ def test_glsl_caps_bit_encoding():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_texture_query_lod():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 400
|
|
|
|
|
|
uniform sampler2D a;
|
|
|
@@ -371,7 +371,7 @@ def test_glsl_caps_texture_query_lod():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_texture_gather_red():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 400
|
|
|
|
|
|
uniform sampler2D a;
|
|
|
@@ -383,7 +383,7 @@ def test_glsl_caps_texture_gather_red():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_texture_gather_any():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 400
|
|
|
|
|
|
uniform sampler2D a;
|
|
|
@@ -395,7 +395,7 @@ def test_glsl_caps_texture_gather_any():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_extended_arithmetic():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 400
|
|
|
|
|
|
uniform uint a;
|
|
|
@@ -410,7 +410,7 @@ def test_glsl_caps_extended_arithmetic():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_double():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 400
|
|
|
|
|
|
uniform double a;
|
|
|
@@ -422,7 +422,7 @@ def test_glsl_caps_double():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_cube_map_array():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 400
|
|
|
|
|
|
uniform samplerCubeArray a;
|
|
|
@@ -434,7 +434,7 @@ def test_glsl_caps_cube_map_array():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_geometry_shader_instancing():
|
|
|
- assert compile_and_get_caps(Stage.geometry, """
|
|
|
+ assert compile_and_get_caps(Stage.GEOMETRY, """
|
|
|
#version 400
|
|
|
|
|
|
layout(triangles, invocations=2) in;
|
|
|
@@ -453,7 +453,7 @@ def test_glsl_caps_geometry_shader_instancing():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_tessellation_shader():
|
|
|
- assert compile_and_get_caps(Stage.tess_control, """
|
|
|
+ assert compile_and_get_caps(Stage.TESS_CONTROL, """
|
|
|
#version 400 core
|
|
|
|
|
|
layout (vertices = 3) out;
|
|
|
@@ -466,7 +466,7 @@ def test_glsl_caps_tessellation_shader():
|
|
|
}
|
|
|
""") == Shader.C_tessellation_shader
|
|
|
|
|
|
- assert compile_and_get_caps(Stage.tess_evaluation, """
|
|
|
+ assert compile_and_get_caps(Stage.TESS_EVALUATION, """
|
|
|
#version 400 core
|
|
|
|
|
|
layout(triangles, equal_spacing, ccw) in;
|
|
|
@@ -478,7 +478,7 @@ def test_glsl_caps_tessellation_shader():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_sample_variables():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
#extension GL_ARB_sample_shading : require
|
|
|
@@ -490,7 +490,7 @@ def test_glsl_caps_sample_variables():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_multisample_interpolation():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 400
|
|
|
|
|
|
sample in vec4 a;
|
|
|
@@ -504,7 +504,7 @@ def test_glsl_caps_multisample_interpolation():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_dynamic_indexing():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 400
|
|
|
|
|
|
uniform int a;
|
|
|
@@ -518,7 +518,7 @@ def test_glsl_caps_dynamic_indexing():
|
|
|
""") == Shader.C_dynamic_indexing
|
|
|
|
|
|
# NOT dynamic indexing
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 330
|
|
|
|
|
|
const int a = 2;
|
|
|
@@ -533,7 +533,7 @@ def test_glsl_caps_dynamic_indexing():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_atomic_counters():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 420
|
|
|
|
|
|
uniform atomic_uint a;
|
|
|
@@ -545,7 +545,7 @@ def test_glsl_caps_atomic_counters():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_image_load_store():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 420
|
|
|
|
|
|
layout(rgba8) uniform readonly image2D a;
|
|
|
@@ -559,7 +559,7 @@ def test_glsl_caps_image_load_store():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_image_atomic():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 420
|
|
|
|
|
|
layout(r32i) uniform iimage1D a;
|
|
|
@@ -574,7 +574,7 @@ def test_glsl_caps_image_atomic():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_image_query_size():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 420
|
|
|
|
|
|
#extension GL_ARB_shader_image_size : require
|
|
|
@@ -590,7 +590,7 @@ def test_glsl_caps_image_query_size():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_texture_query_levels():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 430
|
|
|
|
|
|
uniform sampler2D a;
|
|
|
@@ -604,7 +604,7 @@ def test_glsl_caps_texture_query_levels():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_texture_storage_buffer():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 430
|
|
|
|
|
|
buffer A {
|
|
|
@@ -617,7 +617,7 @@ def test_glsl_caps_texture_storage_buffer():
|
|
|
""") == Shader.C_storage_buffer
|
|
|
|
|
|
# Don't trigger for a regular UBO
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 430
|
|
|
|
|
|
uniform A {
|
|
|
@@ -631,7 +631,7 @@ def test_glsl_caps_texture_storage_buffer():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_compute_shader():
|
|
|
- assert compile_and_get_caps(Stage.compute, """
|
|
|
+ assert compile_and_get_caps(Stage.COMPUTE, """
|
|
|
#version 430
|
|
|
|
|
|
layout(local_size_x=16, local_size_y=16) in;
|
|
|
@@ -642,7 +642,7 @@ def test_glsl_caps_compute_shader():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_enhanced_layouts():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 450
|
|
|
|
|
|
layout(location=0, component=1) out float a;
|
|
|
@@ -655,7 +655,7 @@ def test_glsl_caps_enhanced_layouts():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_cull_distance():
|
|
|
- assert compile_and_get_caps(Stage.vertex, """
|
|
|
+ assert compile_and_get_caps(Stage.VERTEX, """
|
|
|
#version 450
|
|
|
|
|
|
void main() {
|
|
|
@@ -666,7 +666,7 @@ def test_glsl_caps_cull_distance():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_derivative_control():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 450
|
|
|
|
|
|
out vec4 p3d_FragColor;
|
|
|
@@ -678,7 +678,7 @@ def test_glsl_caps_derivative_control():
|
|
|
|
|
|
|
|
|
def test_glsl_caps_texture_query_samples():
|
|
|
- assert compile_and_get_caps(Stage.fragment, """
|
|
|
+ assert compile_and_get_caps(Stage.FRAGMENT, """
|
|
|
#version 450
|
|
|
|
|
|
uniform sampler2DMS a;
|