From: Mikko Rasa Date: Sat, 9 Apr 2022 13:22:21 +0000 (+0300) Subject: Fix GLSL test cases so they pass the basic tests X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=97d26f5179e82cd2faf476a9605f8a4f4b33a926;p=libs%2Fgl.git Fix GLSL test cases so they pass the basic tests Some changes had changed the compiler output, particularly acd7bb6 adding an extra statement to the end of vertex shaders in OpenGL mode. Some idempotence tests still fail because of this. --- diff --git a/tests/glsl/alias_types.glsl b/tests/glsl/alias_types.glsl index 0fda73e3..5164867d 100644 --- a/tests/glsl/alias_types.glsl +++ b/tests/glsl/alias_types.glsl @@ -1,7 +1,10 @@ typedef vec4 myvec4; typedef mat4x4 mymat4; -uniform mymat4 mvp; +layout(push_constant) uniform Transform +{ + mymat4 mvp; +}; #pragma MSP stage(vertex) layout(location=0) in myvec4 position; @@ -10,8 +13,13 @@ void main() gl_Position = mvp*position; } +// Target API: Vulkan + /* Expected output: vertex -layout(location=0) uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; layout(location=0) in vec4 position; void main() { diff --git a/tests/glsl/arithmetic_assignment.glsl b/tests/glsl/arithmetic_assignment.glsl index c3bcdad0..d0898fbe 100644 --- a/tests/glsl/arithmetic_assignment.glsl +++ b/tests/glsl/arithmetic_assignment.glsl @@ -25,6 +25,8 @@ void main() frag_color = vec4(color, 1.0); } +// Target API: OpenGL + /* Expected output: vertex layout(location=0) uniform mat4 mvp; layout(location=0) in vec4 position; @@ -37,6 +39,7 @@ void main() light = normal.z; _vs_out_texcoord = texcoord; gl_Position = mvp*position; + gl_Position.z = gl_Position.z*2.0-gl_Position.w; } */ diff --git a/tests/glsl/array_element_assignment.glsl b/tests/glsl/array_element_assignment.glsl index eb98ddc4..e5a09358 100644 --- a/tests/glsl/array_element_assignment.glsl +++ b/tests/glsl/array_element_assignment.glsl @@ -11,6 +11,8 @@ void main() gl_Position = vec4(s); } +// Target API: Vulkan + /* Expected output: vertex void main() { diff --git a/tests/glsl/array_in_uniform_block.glsl b/tests/glsl/array_in_uniform_block.glsl index 3d53b3de..c2e09f3e 100644 --- a/tests/glsl/array_in_uniform_block.glsl +++ b/tests/glsl/array_in_uniform_block.glsl @@ -35,6 +35,8 @@ void main() frag_color = vec4(color, 1.0); } +// Target API: OpenGL + /* Expected output: vertex struct LightParams { @@ -59,6 +61,7 @@ void main() mat4 _temp = view_matrix*model_matrix; eye_normal = mat3(_temp[0].xyz, _temp[1].xyz, _temp[2].xyz)*normal; gl_Position = proj_matrix*view_matrix*model_matrix*position; + gl_Position.z = gl_Position.z*2.0-gl_Position.w; } */ diff --git a/tests/glsl/binary_operators.glsl b/tests/glsl/binary_operators.glsl index a67a5a72..ad0f73d9 100644 --- a/tests/glsl/binary_operators.glsl +++ b/tests/glsl/binary_operators.glsl @@ -31,6 +31,8 @@ void main() ++v3; } +// Target API: Vulkan + /* Expected output: vertex void main() { diff --git a/tests/glsl/chained_member_access.glsl b/tests/glsl/chained_member_access.glsl index 2b9c719a..e419ffb7 100644 --- a/tests/glsl/chained_member_access.glsl +++ b/tests/glsl/chained_member_access.glsl @@ -19,6 +19,8 @@ void main() gl_Position = vec4(model.transform.components.position+position.xyz*model.transform.components.scale, 1.0); } +// Target API: Vulkan + /* Expected output: vertex struct TransformComponents { @@ -29,7 +31,7 @@ struct Transform { TransformComponents components; }; -layout(binding=26) uniform ModelData +layout(set=0, binding=62) uniform ModelData { Transform transform; } model; diff --git a/tests/glsl/complex_constant_condition_removal.glsl b/tests/glsl/complex_constant_condition_removal.glsl index 4f7819b9..68c0c30c 100644 --- a/tests/glsl/complex_constant_condition_removal.glsl +++ b/tests/glsl/complex_constant_condition_removal.glsl @@ -21,6 +21,8 @@ void main() frag_color = vec4(1.0); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in vec4 color; diff --git a/tests/glsl/complex_loop_increment.glsl b/tests/glsl/complex_loop_increment.glsl index fa0ea86e..1f3c0fdd 100644 --- a/tests/glsl/complex_loop_increment.glsl +++ b/tests/glsl/complex_loop_increment.glsl @@ -13,6 +13,8 @@ void main() gl_Position = vec4(n); } +// Target API: Vulkan + /* Expected output: vertex void main() { diff --git a/tests/glsl/conditional_multiple_emitvertex.glsl b/tests/glsl/conditional_multiple_emitvertex.glsl index 2d0cb5a5..7a2ad705 100644 --- a/tests/glsl/conditional_multiple_emitvertex.glsl +++ b/tests/glsl/conditional_multiple_emitvertex.glsl @@ -1,4 +1,7 @@ -uniform int flag; +layout(push_constant) uniform Flag +{ + int flag; +}; uniform sampler2D tex; #pragma MSP stage(vertex) @@ -32,6 +35,8 @@ void main() frag_color = texture(tex, texcoord); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=0) out vec2 texcoord; @@ -43,10 +48,13 @@ void main() */ /* Expected output: geometry -layout(location=0) uniform int flag; +layout(push_constant) uniform Flag +{ + int flag; +}; layout(triangles) in; layout(triangle_strip, max_vertices=3) out; -layout(location=0) in vec2 texcoord[]; +layout(location=0) in vec2 texcoord[3]; layout(location=0) out vec2 _gs_out_texcoord; void main() { @@ -66,7 +74,7 @@ void main() */ /* Expected output: fragment -layout(location=1, binding=71) uniform sampler2D tex; +layout(set=0, binding=71) uniform sampler2D tex; layout(location=0) out vec4 frag_color; layout(location=0) in vec2 _gs_out_texcoord; void main() diff --git a/tests/glsl/constant_condition_removal.glsl b/tests/glsl/constant_condition_removal.glsl index 08a61fde..bb6b9c32 100644 --- a/tests/glsl/constant_condition_removal.glsl +++ b/tests/glsl/constant_condition_removal.glsl @@ -19,6 +19,8 @@ void main() frag_color = vec4(1.0); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/constant_last_argument.glsl b/tests/glsl/constant_last_argument.glsl index 003de2d5..e8dfcd54 100644 --- a/tests/glsl/constant_last_argument.glsl +++ b/tests/glsl/constant_last_argument.glsl @@ -1,5 +1,8 @@ uniform sampler2D tex; -uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; #pragma MSP stage(vertex) layout(location=0) in vec4 position; @@ -17,8 +20,13 @@ void main() frag_color = textureLod(tex, texcoord, 0.0)*0.8; } +// Target API: Vulkan + /* Expected output: vertex -layout(location=0) uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; layout(location=0) in vec4 position; layout(location=1) in vec2 texcoord; layout(location=0) out vec2 _vs_out_texcoord; @@ -30,7 +38,7 @@ void main() */ /* Expected output: fragment -layout(location=4, binding=71) uniform sampler2D tex; +layout(set=0, binding=71) uniform sampler2D tex; layout(location=0) out vec4 frag_color; layout(location=0) in vec2 _vs_out_texcoord; void main() diff --git a/tests/glsl/constant_ternary_removal.glsl b/tests/glsl/constant_ternary_removal.glsl index 02707103..1072ba1e 100644 --- a/tests/glsl/constant_ternary_removal.glsl +++ b/tests/glsl/constant_ternary_removal.glsl @@ -16,6 +16,8 @@ void main() frag_color = (use_color ? color : vec4(1.0)); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/constructors.glsl b/tests/glsl/constructors.glsl index 9b878e49..151ee5ef 100644 --- a/tests/glsl/constructors.glsl +++ b/tests/glsl/constructors.glsl @@ -26,6 +26,8 @@ void main() frag_color = vec4(vec3(dot(normal, normalize(tbn_light_dir))), 1); } +// Target API: OpenGL + /* Expected output: vertex layout(location=0) uniform mat4 model; layout(location=4) uniform mat4 view_projection; @@ -43,6 +45,7 @@ void main() tbn_light_dir = mat3(normal_matrix*tangent, normal_matrix*binormal, normal_matrix*normal)*light_dir; gl_Position = view_projection*model*vec4(position, 1.0); _vs_out_texcoord = texcoord; + gl_Position.z = gl_Position.z*2.0-gl_Position.w; } */ diff --git a/tests/glsl/dead_loop_removal.glsl b/tests/glsl/dead_loop_removal.glsl index ee5c0360..eb5f78c9 100644 --- a/tests/glsl/dead_loop_removal.glsl +++ b/tests/glsl/dead_loop_removal.glsl @@ -28,6 +28,8 @@ void main() frag_color = vec4(color, 1.0); } +// Target API: OpenGL + /* Expected output: vertex layout(location=0) uniform mat4 model_matrix; layout(location=4) uniform mat4 vp_matrix; @@ -35,6 +37,7 @@ layout(location=0) in vec4 position; void main() { gl_Position = vp_matrix*model_matrix*position; + gl_Position.z = gl_Position.z*2.0-gl_Position.w; } */ diff --git a/tests/glsl/empty_conditional_removal.glsl b/tests/glsl/empty_conditional_removal.glsl index e40d176e..0f0dcb43 100644 --- a/tests/glsl/empty_conditional_removal.glsl +++ b/tests/glsl/empty_conditional_removal.glsl @@ -41,8 +41,10 @@ void main() frag_color = vec4(color, 1.0); } +// Target API: Vulkan + /* Expected output: vertex -layout(binding=48) uniform Transform +layout(set=0, binding=24) uniform Transform { mat4 vp; mat4 model; diff --git a/tests/glsl/empty_loop_removal.glsl b/tests/glsl/empty_loop_removal.glsl index 5a4cf84b..d5f7d826 100644 --- a/tests/glsl/empty_loop_removal.glsl +++ b/tests/glsl/empty_loop_removal.glsl @@ -38,8 +38,10 @@ void main() frag_color = vec4(color, 1.0); } +// Target API: Vulkan + /* Expected output: vertex -layout(binding=48) uniform Transform +layout(set=0, binding=24) uniform Transform { mat4 vp; mat4 model; diff --git a/tests/glsl/expression_inline.glsl b/tests/glsl/expression_inline.glsl index a730e7d5..88b30a8a 100644 --- a/tests/glsl/expression_inline.glsl +++ b/tests/glsl/expression_inline.glsl @@ -6,6 +6,8 @@ void main() gl_Position = p; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/expression_inline_iteration.glsl b/tests/glsl/expression_inline_iteration.glsl index fa17ae95..9f12880f 100644 --- a/tests/glsl/expression_inline_iteration.glsl +++ b/tests/glsl/expression_inline_iteration.glsl @@ -16,6 +16,8 @@ void main() gl_Position = position+vec4(step, 0.0, 0.0, 0.0); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in vec3 direction; diff --git a/tests/glsl/expression_inline_precedence.glsl b/tests/glsl/expression_inline_precedence.glsl index c78958f7..0e35b4d3 100644 --- a/tests/glsl/expression_inline_precedence.glsl +++ b/tests/glsl/expression_inline_precedence.glsl @@ -12,6 +12,8 @@ void main() gl_Position = position*(e+f); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in vec4 v; diff --git a/tests/glsl/function_arguments_inline.glsl b/tests/glsl/function_arguments_inline.glsl index 84ec1c07..f50a0b27 100644 --- a/tests/glsl/function_arguments_inline.glsl +++ b/tests/glsl/function_arguments_inline.glsl @@ -1,4 +1,7 @@ -uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; #pragma MSP stage(vertex) layout(location=0) in vec4 position; @@ -11,8 +14,13 @@ void main() gl_Position = transform_position(position); } +// Target API: Vulkan + /* Expected output: vertex -layout(location=0) uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; layout(location=0) in vec4 position; void main() { diff --git a/tests/glsl/function_inline.glsl b/tests/glsl/function_inline.glsl index d1920f27..ba2f855a 100644 --- a/tests/glsl/function_inline.glsl +++ b/tests/glsl/function_inline.glsl @@ -9,6 +9,8 @@ void main() gl_Position = func(); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/function_inline_global_name_conflict.glsl b/tests/glsl/function_inline_global_name_conflict.glsl index 4c19a640..5f2950c7 100644 --- a/tests/glsl/function_inline_global_name_conflict.glsl +++ b/tests/glsl/function_inline_global_name_conflict.glsl @@ -14,6 +14,8 @@ void main() gl_Position = position*size*size*s*s; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in float scale; diff --git a/tests/glsl/function_inline_in_condition.glsl b/tests/glsl/function_inline_in_condition.glsl index 796f8882..003f81f4 100644 --- a/tests/glsl/function_inline_in_condition.glsl +++ b/tests/glsl/function_inline_in_condition.glsl @@ -12,6 +12,8 @@ void main() gl_Position = position; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in float scale; diff --git a/tests/glsl/function_inline_in_iteration.glsl b/tests/glsl/function_inline_in_iteration.glsl index a98a4539..7105766e 100644 --- a/tests/glsl/function_inline_in_iteration.glsl +++ b/tests/glsl/function_inline_in_iteration.glsl @@ -14,6 +14,8 @@ void main() gl_Position = position*p; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in float scale; diff --git a/tests/glsl/function_inline_multi_name_conflict.glsl b/tests/glsl/function_inline_multi_name_conflict.glsl index cf40df14..7ba4f110 100644 --- a/tests/glsl/function_inline_multi_name_conflict.glsl +++ b/tests/glsl/function_inline_multi_name_conflict.glsl @@ -17,6 +17,8 @@ void main() gl_Position = position*get_scale()*get_size(); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in float scale; diff --git a/tests/glsl/function_inline_name_conflict.glsl b/tests/glsl/function_inline_name_conflict.glsl index f99a5ce3..f9a6f0c9 100644 --- a/tests/glsl/function_inline_name_conflict.glsl +++ b/tests/glsl/function_inline_name_conflict.glsl @@ -12,6 +12,8 @@ void main() gl_Position = position*func()*s*s; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in float scale; diff --git a/tests/glsl/function_inline_parameter_name_conflict.glsl b/tests/glsl/function_inline_parameter_name_conflict.glsl index 831858f0..8563f36f 100644 --- a/tests/glsl/function_inline_parameter_name_conflict.glsl +++ b/tests/glsl/function_inline_parameter_name_conflict.glsl @@ -1,4 +1,7 @@ -uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; #pragma MSP stage(vertex) layout(location=0) in vec4 position; @@ -14,8 +17,13 @@ void main() gl_Position = transform_position(pos+position); } +// Target API: Vulkan + /* Expected output: vertex -layout(location=0) uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; layout(location=0) in vec4 position; layout(location=1) in vec4 offset; void main() diff --git a/tests/glsl/function_inline_reorder.glsl b/tests/glsl/function_inline_reorder.glsl index 3e445ce6..196504aa 100644 --- a/tests/glsl/function_inline_reorder.glsl +++ b/tests/glsl/function_inline_reorder.glsl @@ -10,6 +10,8 @@ vec4 func() return position; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/function_inline_return_conflict.glsl b/tests/glsl/function_inline_return_conflict.glsl index d0ebabc9..2d288f8a 100644 --- a/tests/glsl/function_inline_return_conflict.glsl +++ b/tests/glsl/function_inline_return_conflict.glsl @@ -12,6 +12,8 @@ void main() gl_Position = position*func().xxyy*_return*_return; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in float scale; diff --git a/tests/glsl/function_overloading.glsl b/tests/glsl/function_overloading.glsl index a44c00d4..411776b6 100644 --- a/tests/glsl/function_overloading.glsl +++ b/tests/glsl/function_overloading.glsl @@ -29,6 +29,8 @@ void main() frag_color = srgb_to_linear(texture(tex, texcoord)); } +// Target API: OpenGL + /* Expected output: vertex layout(location=0) uniform mat4 mvp; layout(location=0) in vec4 position; @@ -38,6 +40,7 @@ void main() { _vs_out_texcoord = texcoord; gl_Position = mvp*position; + gl_Position.z = gl_Position.z*2.0-gl_Position.w; } */ diff --git a/tests/glsl/function_override.glsl b/tests/glsl/function_override.glsl index 746ea8d3..0a390952 100644 --- a/tests/glsl/function_override.glsl +++ b/tests/glsl/function_override.glsl @@ -13,6 +13,8 @@ float get_scale() override return 2.0; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/geometry_interface_block.glsl b/tests/glsl/geometry_interface_block.glsl index ea0d377a..18b98c06 100644 --- a/tests/glsl/geometry_interface_block.glsl +++ b/tests/glsl/geometry_interface_block.glsl @@ -36,6 +36,8 @@ void main() frag_color = texture(tex, gs_out.texcoord); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; out VertexOut @@ -59,7 +61,7 @@ out GeometryOut in VertexOut { vec2 texcoord; -} vs_out[]; +} vs_out[3]; void main() { for(int i = 0; i<3; ++i) @@ -72,7 +74,7 @@ void main() */ /* Expected output: fragment -layout(location=0, binding=71) uniform sampler2D tex; +layout(set=0, binding=71) uniform sampler2D tex; layout(location=0) out vec4 frag_color; in GeometryOut { diff --git a/tests/glsl/geometry_passthrough.glsl b/tests/glsl/geometry_passthrough.glsl index 59352842..2104280a 100644 --- a/tests/glsl/geometry_passthrough.glsl +++ b/tests/glsl/geometry_passthrough.glsl @@ -27,6 +27,8 @@ void main() frag_color = texture(tex, texcoord); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=0) out vec2 texcoord; @@ -40,7 +42,7 @@ void main() /* Expected output: geometry layout(triangles) in; layout(triangle_strip, max_vertices=3) out; -layout(location=0) in vec2 texcoord[]; +layout(location=0) in vec2 texcoord[3]; layout(location=0) out vec2 _gs_out_texcoord; void main() { @@ -54,7 +56,7 @@ void main() */ /* Expected output: fragment -layout(location=0, binding=71) uniform sampler2D tex; +layout(set=0, binding=71) uniform sampler2D tex; layout(location=0) out vec4 frag_color; layout(location=0) in vec2 _gs_out_texcoord; void main() diff --git a/tests/glsl/ignore_array_in_geometry_passthrough.glsl b/tests/glsl/ignore_array_in_geometry_passthrough.glsl index 56fe0dfa..f491ea34 100644 --- a/tests/glsl/ignore_array_in_geometry_passthrough.glsl +++ b/tests/glsl/ignore_array_in_geometry_passthrough.glsl @@ -1,4 +1,7 @@ -uniform mat4 vp_matrix; +layout(push_constant) uniform Transform +{ + mat4 vp_matrix; +}; uniform sampler2D tex; #pragma MSP stage(vertex) @@ -31,8 +34,13 @@ void main() frag_color = texture(tex, texcoord); } +// Target API: Vulkan + /* Expected output: vertex -layout(location=0) uniform mat4 vp_matrix; +layout(push_constant) uniform Transform +{ + mat4 vp_matrix; +}; layout(location=0) in vec4 position; layout(location=1) in vec2 texcoord; layout(location=2) in vec4 instance_transform[3]; @@ -47,7 +55,7 @@ void main() /* Expected output: geometry layout(triangles) in; layout(triangle_strip, max_vertices=3) out; -layout(location=0) in vec2 _vs_out_texcoord[]; +layout(location=0) in vec2 _vs_out_texcoord[3]; layout(location=0) out vec2 _gs_out_texcoord; void main() { @@ -61,7 +69,7 @@ void main() */ /* Expected output: fragment -layout(location=4, binding=71) uniform sampler2D tex; +layout(set=0, binding=71) uniform sampler2D tex; layout(location=0) out vec4 frag_color; layout(location=0) in vec2 _gs_out_texcoord; void main() diff --git a/tests/glsl/inexact_function_argument_type.glsl b/tests/glsl/inexact_function_argument_type.glsl index 627fa5d8..e6a98af7 100644 --- a/tests/glsl/inexact_function_argument_type.glsl +++ b/tests/glsl/inexact_function_argument_type.glsl @@ -9,6 +9,8 @@ void main() gl_Position = vec4(scale(position.xy, 2), 0.0, 1.0); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/interface_block.glsl b/tests/glsl/interface_block.glsl index 41d7a63e..e36a3347 100644 --- a/tests/glsl/interface_block.glsl +++ b/tests/glsl/interface_block.glsl @@ -18,6 +18,8 @@ void main() frag_color = out_color; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in vec4 color; diff --git a/tests/glsl/keep_empty_loop_with_side_effects.glsl b/tests/glsl/keep_empty_loop_with_side_effects.glsl index b0c16262..5cc18f17 100644 --- a/tests/glsl/keep_empty_loop_with_side_effects.glsl +++ b/tests/glsl/keep_empty_loop_with_side_effects.glsl @@ -19,6 +19,8 @@ void main() result = pot; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 vertex; layout(location=1) in vec2 texcoord; @@ -31,7 +33,7 @@ void main() */ /* Expected output: fragment -layout(location=0, binding=71) uniform sampler2D tex; +layout(set=0, binding=71) uniform sampler2D tex; layout(location=0) out float result; layout(location=0) in vec2 _vs_out_texcoord; void main() diff --git a/tests/glsl/keep_spec_constants_in_module.glsl b/tests/glsl/keep_spec_constants_in_module.glsl index c60c0a89..7b9f98c8 100644 --- a/tests/glsl/keep_spec_constants_in_module.glsl +++ b/tests/glsl/keep_spec_constants_in_module.glsl @@ -1,7 +1,10 @@ layout(constant_id=0) const bool use_texture = false; layout(constant_id=1) const bool use_vertex_color = false; uniform sampler2D tex; -uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; #pragma MSP stage(vertex) layout(location=0) in vec4 position; @@ -24,10 +27,14 @@ void main() frag_color *= color; } +// Target API: Vulkan // Compile mode: module /* Expected output: vertex -layout(location=0) uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; layout(location=0) in vec4 position; layout(location=1) in vec4 color; layout(location=2) in vec2 texcoord; @@ -44,7 +51,7 @@ void main() /* Expected output: fragment layout(constant_id=0) const bool use_texture = false; layout(constant_id=1) const bool use_vertex_color = false; -layout(location=4, binding=71) uniform sampler2D tex; +layout(set=0, binding=71) uniform sampler2D tex; layout(location=0) out vec4 frag_color; layout(location=1) in vec2 _vs_out_texcoord; layout(location=0) in vec4 _vs_out_color; diff --git a/tests/glsl/keep_used_function.glsl b/tests/glsl/keep_used_function.glsl index 419f3f2c..02a82c99 100644 --- a/tests/glsl/keep_used_function.glsl +++ b/tests/glsl/keep_used_function.glsl @@ -12,6 +12,8 @@ void main() gl_Position = position*sqrt(x_sq+y_sq); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in vec2 scale; diff --git a/tests/glsl/matrix_from_elements.glsl b/tests/glsl/matrix_from_elements.glsl index 42b16556..659724ab 100644 --- a/tests/glsl/matrix_from_elements.glsl +++ b/tests/glsl/matrix_from_elements.glsl @@ -14,8 +14,10 @@ void main() gl_Position = vec4((m*vec3(position, 1.0)).xy, 0.0, 1.0); } +// Target API: Vulkan + /* Expected output: vertex -layout(binding=48) uniform Transform +layout(set=0, binding=24) uniform Transform { vec3 translation; float rotation; diff --git a/tests/glsl/member_assignment.glsl b/tests/glsl/member_assignment.glsl index 77451db0..0d7d8efe 100644 --- a/tests/glsl/member_assignment.glsl +++ b/tests/glsl/member_assignment.glsl @@ -8,6 +8,8 @@ void main() gl_Position = p; } +// Target API: Vulkan + /* Expected output: vertex void main() { diff --git a/tests/glsl/multiline_function_inline.glsl b/tests/glsl/multiline_function_inline.glsl index e8f05bdb..31eaad7a 100644 --- a/tests/glsl/multiline_function_inline.glsl +++ b/tests/glsl/multiline_function_inline.glsl @@ -11,6 +11,8 @@ void main() gl_Position = func(); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in float scale; diff --git a/tests/glsl/multiple_emitvertex.glsl b/tests/glsl/multiple_emitvertex.glsl index 227f1e09..6a6f9e2f 100644 --- a/tests/glsl/multiple_emitvertex.glsl +++ b/tests/glsl/multiple_emitvertex.glsl @@ -28,6 +28,8 @@ void main() frag_color = texture(tex, texcoord); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=0) out vec2 texcoord; @@ -41,7 +43,7 @@ void main() /* Expected output: geometry layout(triangles) in; layout(triangle_strip, max_vertices=3) out; -layout(location=0) in vec2 texcoord[]; +layout(location=0) in vec2 texcoord[3]; layout(location=0) out vec2 _gs_out_texcoord; void main() { @@ -58,7 +60,7 @@ void main() */ /* Expected output: fragment -layout(location=0, binding=71) uniform sampler2D tex; +layout(set=0, binding=71) uniform sampler2D tex; layout(location=0) out vec4 frag_color; layout(location=0) in vec2 _gs_out_texcoord; void main() diff --git a/tests/glsl/multiple_function_inline.glsl b/tests/glsl/multiple_function_inline.glsl index aedfa93f..dbd381f8 100644 --- a/tests/glsl/multiple_function_inline.glsl +++ b/tests/glsl/multiple_function_inline.glsl @@ -14,6 +14,8 @@ void main() gl_Position = get_position()*get_scale(); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in float scale; diff --git a/tests/glsl/named_interface_block.glsl b/tests/glsl/named_interface_block.glsl index 9d734bd1..685050a4 100644 --- a/tests/glsl/named_interface_block.glsl +++ b/tests/glsl/named_interface_block.glsl @@ -18,6 +18,8 @@ void main() frag_color = vs_out.color; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in vec4 color; diff --git a/tests/glsl/nested_function_inline.glsl b/tests/glsl/nested_function_inline.glsl index a09d3422..9ed6dc9a 100644 --- a/tests/glsl/nested_function_inline.glsl +++ b/tests/glsl/nested_function_inline.glsl @@ -1,4 +1,7 @@ -uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; #pragma MSP stage(vertex) layout(location=0) in vec4 position; @@ -15,8 +18,13 @@ void main() gl_Position = transform_position(get_position()); } +// Target API: Vulkan + /* Expected output: vertex -layout(location=0) uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; layout(location=0) in vec4 position; void main() { diff --git a/tests/glsl/nested_member_access.glsl b/tests/glsl/nested_member_access.glsl index 60b3a492..3f7034ce 100644 --- a/tests/glsl/nested_member_access.glsl +++ b/tests/glsl/nested_member_access.glsl @@ -21,6 +21,8 @@ void main() frag_color = vec4(light_color[light_index], 1.0); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() @@ -30,11 +32,11 @@ void main() */ /* Expected output: fragment -layout(binding=5) uniform Lighting +layout(set=0, binding=65) uniform Lighting { vec3 light_color[4]; }; -layout(binding=80) uniform Params +layout(set=0, binding=56) uniform Params { int light_index; }; diff --git a/tests/glsl/nested_ternary.glsl b/tests/glsl/nested_ternary.glsl index 8896c17a..6cbc4781 100644 --- a/tests/glsl/nested_ternary.glsl +++ b/tests/glsl/nested_ternary.glsl @@ -22,6 +22,8 @@ void main() position.y>0 ? top_left : bottom_left); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=0) out vec4 _vs_out_position; @@ -33,7 +35,7 @@ void main() */ /* Expected output: fragment -layout(binding=23) uniform Colors +layout(set=0, binding=23) uniform Colors { vec4 top_left; vec4 top_right; diff --git a/tests/glsl/no_op_conversion.glsl b/tests/glsl/no_op_conversion.glsl index f0f887e9..5bc3f746 100644 --- a/tests/glsl/no_op_conversion.glsl +++ b/tests/glsl/no_op_conversion.glsl @@ -1,4 +1,7 @@ -uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; #pragma MSP stage(vertex) layout(location=0) in vec4 position; @@ -7,8 +10,13 @@ void main() gl_Position = mat4(mvp)*vec4(position); } +// Target API: Vulkan + /* Expected output: vertex -layout(location=0) uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; layout(location=0) in vec4 position; void main() { diff --git a/tests/glsl/parameter_composite_access.glsl b/tests/glsl/parameter_composite_access.glsl index 718fffd3..13e524dd 100644 --- a/tests/glsl/parameter_composite_access.glsl +++ b/tests/glsl/parameter_composite_access.glsl @@ -27,6 +27,8 @@ void main() frag_color = get_color(normal); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in vec3 normal; @@ -39,7 +41,7 @@ void main() */ /* Expected output: fragment -layout(binding=23) uniform Colors +layout(set=0, binding=23) uniform Colors { vec4 top_color; vec4 bottom_color; diff --git a/tests/glsl/parentheses.glsl b/tests/glsl/parentheses.glsl index a1cd9b88..7eb6512b 100644 --- a/tests/glsl/parentheses.glsl +++ b/tests/glsl/parentheses.glsl @@ -32,6 +32,8 @@ void main() frag_color = vec4(material_color*l*occlusion, 1.0); } +// Target API: OpenGL + /* Expected output: vertex layout(location=0) uniform mat4 mvp; layout(location=4) uniform vec3 offset; @@ -45,6 +47,7 @@ void main() gl_Position = mvp*(position+vec4(offset, 1.0)); _vs_out_normal = normal; _vs_out_texcoord = texcoord; + gl_Position.z = gl_Position.z*2.0-gl_Position.w; } */ diff --git a/tests/glsl/partially_unused_interface_block.glsl b/tests/glsl/partially_unused_interface_block.glsl index 7ccdc0d7..6bd0497b 100644 --- a/tests/glsl/partially_unused_interface_block.glsl +++ b/tests/glsl/partially_unused_interface_block.glsl @@ -27,8 +27,10 @@ void main() frag_color = vs_out.color*tint; } +// Target API: Vulkan + /* Expected output: vertex -layout(binding=72) uniform GlobalValues +layout(set=0, binding=24) uniform GlobalValues { vec4 tint; vec2 scale; @@ -49,7 +51,7 @@ void main() */ /* Expected output: fragment -layout(binding=72) uniform GlobalValues +layout(set=0, binding=24) uniform GlobalValues { vec4 tint; vec2 scale; diff --git a/tests/glsl/passthrough.glsl b/tests/glsl/passthrough.glsl index 5b048246..75e4a0c1 100644 --- a/tests/glsl/passthrough.glsl +++ b/tests/glsl/passthrough.glsl @@ -14,6 +14,8 @@ void main() frag_color = color; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in vec4 color; diff --git a/tests/glsl/passthrough_declaration_order.glsl b/tests/glsl/passthrough_declaration_order.glsl index c5d1856a..ab4c2a98 100644 --- a/tests/glsl/passthrough_declaration_order.glsl +++ b/tests/glsl/passthrough_declaration_order.glsl @@ -20,6 +20,8 @@ void main() frag_color = color; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=1) in vec4 color; diff --git a/tests/glsl/redeclare_builtin.glsl b/tests/glsl/redeclare_builtin.glsl index c0b84c42..f72d2495 100644 --- a/tests/glsl/redeclare_builtin.glsl +++ b/tests/glsl/redeclare_builtin.glsl @@ -7,6 +7,8 @@ void main() gl_Position = position; } +// Target API: Vulkan + /* Expected output: vertex out gl_PerVertex { diff --git a/tests/glsl/redundant_geometry_gl_position.glsl b/tests/glsl/redundant_geometry_gl_position.glsl index f8a0e51b..130f9c23 100644 --- a/tests/glsl/redundant_geometry_gl_position.glsl +++ b/tests/glsl/redundant_geometry_gl_position.glsl @@ -19,6 +19,8 @@ void main() } } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/redundant_gl_position.glsl b/tests/glsl/redundant_gl_position.glsl index 3ac45340..493defaf 100644 --- a/tests/glsl/redundant_gl_position.glsl +++ b/tests/glsl/redundant_gl_position.glsl @@ -6,6 +6,8 @@ void main() gl_Position = position; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/referenced_but_unassigned_output.glsl b/tests/glsl/referenced_but_unassigned_output.glsl index 5b0e00d1..e1da4408 100644 --- a/tests/glsl/referenced_but_unassigned_output.glsl +++ b/tests/glsl/referenced_but_unassigned_output.glsl @@ -1,4 +1,7 @@ -uniform mat4 projection; +layout(push_constant) uniform Transform +{ + mat4 projection; +}; #pragma MSP stage(vertex) layout(location=0) in vec4 position; @@ -21,8 +24,13 @@ void main() frag_color = vec4(color.rgb, alpha); } +// Target API: Vulkan + /* Expected output: vertex -layout(location=0) uniform mat4 projection; +layout(push_constant) uniform Transform +{ + mat4 projection; +}; layout(location=0) out vec4 eye_vertex; out VertexOut { diff --git a/tests/glsl/return_type_conversion.glsl b/tests/glsl/return_type_conversion.glsl index 3467311c..338dc6a7 100644 --- a/tests/glsl/return_type_conversion.glsl +++ b/tests/glsl/return_type_conversion.glsl @@ -10,7 +10,10 @@ uniform Surface { vec4 color; }; -uniform mat4 model_matrix; +layout(push_constant) uniform Transform +{ + mat4 model_matrix; +}; uniform sampler2DShadow shadow_map; #pragma MSP stage(vertex) @@ -36,12 +39,17 @@ void main() frag_out = vec4(color.rgb*get_shadow(), color.a); } +// Target API: Vulkan + /* Expected output: vertex -layout(binding=72) uniform Camera +layout(set=0, binding=24) uniform Camera { mat4 viewproj_matrix; }; -layout(location=0) uniform mat4 model_matrix; +layout(push_constant) uniform Transform +{ + mat4 model_matrix; +}; layout(location=0) in vec4 position; layout(location=0) out vec4 world_position; void main() @@ -52,15 +60,15 @@ void main() */ /* Expected output: fragment -layout(binding=71) uniform Shadow +layout(set=0, binding=35) uniform Shadow { mat4 shadow_matrix; }; -layout(binding=77) uniform Surface +layout(set=0, binding=65) uniform Surface { vec4 color; }; -layout(location=4, binding=73) uniform sampler2DShadow shadow_map; +layout(set=0, binding=73) uniform sampler2DShadow shadow_map; layout(location=0) out vec4 frag_out; layout(location=0) in vec4 world_position; float get_shadow() diff --git a/tests/glsl/specialization_constants.glsl b/tests/glsl/specialization_constants.glsl index eacc9bde..9b544ab2 100644 --- a/tests/glsl/specialization_constants.glsl +++ b/tests/glsl/specialization_constants.glsl @@ -1,7 +1,10 @@ layout(constant_id=0) const bool use_texture = false; layout(constant_id=1) const bool use_vertex_color = false; uniform sampler2D tex; -uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; #pragma MSP stage(vertex) layout(location=0) in vec4 position; @@ -24,10 +27,14 @@ void main() frag_color *= color; } +// Target API: Vulkan // Specialize: use_texture true /* Expected output: vertex -layout(location=0) uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; layout(location=0) in vec4 position; layout(location=2) in vec2 texcoord; layout(location=0) out vec2 _vs_out_texcoord; @@ -39,7 +46,7 @@ void main() */ /* Expected output: fragment -layout(location=4, binding=71) uniform sampler2D tex; +layout(set=0, binding=71) uniform sampler2D tex; layout(location=0) out vec4 frag_color; layout(location=0) in vec2 _vs_out_texcoord; void main() diff --git a/tests/glsl/struct_in_anonymous_block.glsl b/tests/glsl/struct_in_anonymous_block.glsl index 03d6af42..2c9e3801 100644 --- a/tests/glsl/struct_in_anonymous_block.glsl +++ b/tests/glsl/struct_in_anonymous_block.glsl @@ -25,8 +25,10 @@ void main() frag_color = material.color; } +// Target API: Vulkan + /* Expected output: vertex -layout(binding=48) uniform Transform +layout(set=0, binding=24) uniform Transform { mat4 mvp; }; @@ -42,7 +44,7 @@ struct MaterialParameters { vec4 color; }; -layout(binding=64) uniform Material +layout(set=0, binding=16) uniform Material { MaterialParameters material; }; diff --git a/tests/glsl/swizzle_assignment.glsl b/tests/glsl/swizzle_assignment.glsl index 521a8c46..10c34476 100644 --- a/tests/glsl/swizzle_assignment.glsl +++ b/tests/glsl/swizzle_assignment.glsl @@ -29,8 +29,10 @@ void main() frag_color.rgb *= max(dot(normalize(world_normal), light_dir), 0.0)*light_color; } +// Target API: Vulkan + /* Expected output: vertex -layout(binding=48) uniform Transform +layout(set=0, binding=24) uniform Transform { mat4 model_matrix; mat4 vp_matrix; @@ -50,8 +52,8 @@ void main() */ /* Expected output: fragment -layout(location=0, binding=71) uniform sampler2D tex; -layout(binding=5) uniform Lighting +layout(set=0, binding=71) uniform sampler2D tex; +layout(set=0, binding=65) uniform Lighting { vec3 light_dir; vec3 light_color; diff --git a/tests/glsl/ternary_operator.glsl b/tests/glsl/ternary_operator.glsl index a04d8102..402a0653 100644 --- a/tests/glsl/ternary_operator.glsl +++ b/tests/glsl/ternary_operator.glsl @@ -25,8 +25,10 @@ void main() frag_color = texture(mask, texcoord).r > 0.5 ? color1 : color2; } +// Target API: Vulkan + /* Expected output: vertex -layout(binding=48) uniform Transform +layout(set=0, binding=24) uniform Transform { mat4 mvp; } transform; @@ -41,12 +43,12 @@ void main() */ /* Expected output: fragment -layout(binding=23) uniform Colors +layout(set=0, binding=23) uniform Colors { vec4 color1; vec4 color2; }; -layout(location=0, binding=75) uniform sampler2D mask; +layout(set=0, binding=75) uniform sampler2D mask; layout(location=0) out vec4 frag_color; layout(location=0) in vec2 _vs_out_texcoord; void main() diff --git a/tests/glsl/unary_operators.glsl b/tests/glsl/unary_operators.glsl index baef6451..9b45a05f 100644 --- a/tests/glsl/unary_operators.glsl +++ b/tests/glsl/unary_operators.glsl @@ -13,6 +13,8 @@ void main() ++arr[0]; } +// Target API: Vulkan + /* Expected output: vertex void main() { diff --git a/tests/glsl/uniform_location_allocation.glsl b/tests/glsl/uniform_location_allocation.glsl index f0ab8476..65321047 100644 --- a/tests/glsl/uniform_location_allocation.glsl +++ b/tests/glsl/uniform_location_allocation.glsl @@ -18,6 +18,8 @@ void main() frag_color = color*vec4(texture(heightmap, texcoord).rrr, 1.0); } +// Target API: OpenGL + /* Expected output: vertex layout(location=1) uniform mat4 mvp; layout(location=0, binding=16) uniform sampler2D heightmap; @@ -28,6 +30,7 @@ void main() { gl_Position = mvp*vec4(position, texture(heightmap, texcoord).r, 1.0); _vs_out_texcoord = texcoord; + gl_Position.z = gl_Position.z*2.0-gl_Position.w; } */ diff --git a/tests/glsl/unsigned_int.glsl b/tests/glsl/unsigned_int.glsl index b83f5e32..15eab848 100644 --- a/tests/glsl/unsigned_int.glsl +++ b/tests/glsl/unsigned_int.glsl @@ -24,6 +24,8 @@ void main() frag_color = sum/sample_count; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=0) out vec2 texcoord; @@ -35,7 +37,7 @@ void main() */ /* Expected output: fragment -layout(location=0, binding=71) uniform sampler2D tex; +layout(set=0, binding=71) uniform sampler2D tex; layout(location=0) out vec4 frag_color; layout(location=0) in vec2 texcoord; void main() diff --git a/tests/glsl/unused_component_assignment.glsl b/tests/glsl/unused_component_assignment.glsl index af880f5d..661b91b5 100644 --- a/tests/glsl/unused_component_assignment.glsl +++ b/tests/glsl/unused_component_assignment.glsl @@ -1,4 +1,7 @@ -uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; #pragma MSP stage(vertex) layout(location=0) in vec4 position; @@ -16,8 +19,13 @@ void main() gl_Position = vec4(clip_pos.xy, 0.0, 1.0); } +// Target API: Vulkan + /* Expected output: vertex -layout(location=0) uniform mat4 mvp; +layout(push_constant) uniform Transform +{ + mat4 mvp; +}; layout(location=0) in vec4 position; void main() { diff --git a/tests/glsl/unused_function_removal.glsl b/tests/glsl/unused_function_removal.glsl index 67541de1..90b79bf0 100644 --- a/tests/glsl/unused_function_removal.glsl +++ b/tests/glsl/unused_function_removal.glsl @@ -9,6 +9,8 @@ void main() gl_Position = position; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/unused_interface_block_removal.glsl b/tests/glsl/unused_interface_block_removal.glsl index bc3307c3..40f2fde6 100644 --- a/tests/glsl/unused_interface_block_removal.glsl +++ b/tests/glsl/unused_interface_block_removal.glsl @@ -21,6 +21,8 @@ void main() gl_Position = position; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/unused_variable_removal.glsl b/tests/glsl/unused_variable_removal.glsl index a295dc70..81e0d176 100644 --- a/tests/glsl/unused_variable_removal.glsl +++ b/tests/glsl/unused_variable_removal.glsl @@ -7,6 +7,8 @@ void main() gl_Position = position; } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; void main() diff --git a/tests/glsl/unused_variable_removal_iteration.glsl b/tests/glsl/unused_variable_removal_iteration.glsl index fc1782b2..c06e70f9 100644 --- a/tests/glsl/unused_variable_removal_iteration.glsl +++ b/tests/glsl/unused_variable_removal_iteration.glsl @@ -37,6 +37,8 @@ void main() frag_color = vec4(vec3(luminance), 1.0); } +// Target API: Vulkan + /* Expected output: vertex layout(location=0) in vec4 position; layout(location=0) out vec3 dir; @@ -48,7 +50,7 @@ void main() */ /* Expected output: fragment -layout(binding=80) uniform Params +layout(set=0, binding=56) uniform Params { float start_height; float max_height; diff --git a/tests/glsl/use_parameter_in_loop.glsl b/tests/glsl/use_parameter_in_loop.glsl index a0bbc5c3..3d45906c 100644 --- a/tests/glsl/use_parameter_in_loop.glsl +++ b/tests/glsl/use_parameter_in_loop.glsl @@ -31,6 +31,8 @@ void main() frag_color = vec4(vec3(light_intensity), 1.0); } +// Target API: OpenGL + /* Expected output: vertex layout(location=0) uniform mat4 model_matrix; layout(location=4) uniform mat4 view_matrix; @@ -43,6 +45,7 @@ void main() world_vertex = model_matrix*vertex; world_look_dir = normalize(world_vertex.xyz-inverse(view_matrix)[3].xyz); gl_Position = proj_matrix*view_matrix*world_vertex; + gl_Position.z = gl_Position.z*2.0-gl_Position.w; } */ diff --git a/tests/glsl/variable_assignment_subscript.glsl b/tests/glsl/variable_assignment_subscript.glsl index 335e631b..0728dcd6 100644 --- a/tests/glsl/variable_assignment_subscript.glsl +++ b/tests/glsl/variable_assignment_subscript.glsl @@ -26,6 +26,8 @@ void main() frag_color = vs_out.color+vs_out.mask_color; } +// Target API: OpenGL + /* Expected output: vertex layout(location=0) uniform mat4 mvp; layout(location=4) uniform int mask_index; @@ -44,6 +46,7 @@ void main() vs_out.mask_color = vec4(1.0); vs_out.mask_color[index] = 1.0; gl_Position = mvp*position; + gl_Position.z = gl_Position.z*2.0-gl_Position.w; } /*