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;
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()
{
frag_color = vec4(color, 1.0);
}
+// Target API: OpenGL
+
/* Expected output: vertex
layout(location=0) uniform mat4 mvp;
layout(location=0) in vec4 position;
light = normal.z;
_vs_out_texcoord = texcoord;
gl_Position = mvp*position;
+ gl_Position.z = gl_Position.z*2.0-gl_Position.w;
}
*/
gl_Position = vec4(s);
}
+// Target API: Vulkan
+
/* Expected output: vertex
void main()
{
frag_color = vec4(color, 1.0);
}
+// Target API: OpenGL
+
/* Expected output: vertex
struct LightParams
{
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;
}
*/
++v3;
}
+// Target API: Vulkan
+
/* Expected output: vertex
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
{
{
TransformComponents components;
};
-layout(binding=26) uniform ModelData
+layout(set=0, binding=62) uniform ModelData
{
Transform transform;
} model;
frag_color = vec4(1.0);
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in vec4 color;
gl_Position = vec4(n);
}
+// Target API: Vulkan
+
/* Expected output: vertex
void main()
{
-uniform int flag;
+layout(push_constant) uniform Flag
+{
+ int flag;
+};
uniform sampler2D tex;
#pragma MSP stage(vertex)
frag_color = texture(tex, texcoord);
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=0) out vec2 texcoord;
*/
/* 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()
{
*/
/* 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()
frag_color = vec4(1.0);
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
void main()
uniform sampler2D tex;
-uniform mat4 mvp;
+layout(push_constant) uniform Transform
+{
+ mat4 mvp;
+};
#pragma MSP stage(vertex)
layout(location=0) in vec4 position;
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;
*/
/* 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()
frag_color = (use_color ? color : vec4(1.0));
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
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;
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;
}
*/
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;
void main()
{
gl_Position = vp_matrix*model_matrix*position;
+ gl_Position.z = gl_Position.z*2.0-gl_Position.w;
}
*/
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;
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;
gl_Position = p;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
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;
gl_Position = position*(e+f);
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in vec4 v;
-uniform mat4 mvp;
+layout(push_constant) uniform Transform
+{
+ mat4 mvp;
+};
#pragma MSP stage(vertex)
layout(location=0) in vec4 position;
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()
{
gl_Position = func();
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
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;
gl_Position = position;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in float scale;
gl_Position = position*p;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in float scale;
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;
gl_Position = position*func()*s*s;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in float scale;
-uniform mat4 mvp;
+layout(push_constant) uniform Transform
+{
+ mat4 mvp;
+};
#pragma MSP stage(vertex)
layout(location=0) in vec4 position;
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()
return position;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
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;
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;
{
_vs_out_texcoord = texcoord;
gl_Position = mvp*position;
+ gl_Position.z = gl_Position.z*2.0-gl_Position.w;
}
*/
return 2.0;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
void main()
frag_color = texture(tex, gs_out.texcoord);
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
out VertexOut
in VertexOut
{
vec2 texcoord;
-} vs_out[];
+} vs_out[3];
void main()
{
for(int i = 0; i<3; ++i)
*/
/* 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
{
frag_color = texture(tex, texcoord);
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=0) out vec2 texcoord;
/* 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()
{
*/
/* 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()
-uniform mat4 vp_matrix;
+layout(push_constant) uniform Transform
+{
+ mat4 vp_matrix;
+};
uniform sampler2D tex;
#pragma MSP stage(vertex)
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];
/* 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()
{
*/
/* 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()
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()
frag_color = out_color;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in vec4 color;
result = pot;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 vertex;
layout(location=1) in vec2 texcoord;
*/
/* 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()
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;
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;
/* 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;
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;
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;
gl_Position = p;
}
+// Target API: Vulkan
+
/* Expected output: vertex
void main()
{
gl_Position = func();
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in float scale;
frag_color = texture(tex, texcoord);
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=0) out vec2 texcoord;
/* 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()
{
*/
/* 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()
gl_Position = get_position()*get_scale();
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in float scale;
frag_color = vs_out.color;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in vec4 color;
-uniform mat4 mvp;
+layout(push_constant) uniform Transform
+{
+ mat4 mvp;
+};
#pragma MSP stage(vertex)
layout(location=0) in vec4 position;
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()
{
frag_color = vec4(light_color[light_index], 1.0);
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
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;
};
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;
*/
/* Expected output: fragment
-layout(binding=23) uniform Colors
+layout(set=0, binding=23) uniform Colors
{
vec4 top_left;
vec4 top_right;
-uniform mat4 mvp;
+layout(push_constant) uniform Transform
+{
+ mat4 mvp;
+};
#pragma MSP stage(vertex)
layout(location=0) in vec4 position;
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()
{
frag_color = get_color(normal);
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in vec3 normal;
*/
/* Expected output: fragment
-layout(binding=23) uniform Colors
+layout(set=0, binding=23) uniform Colors
{
vec4 top_color;
vec4 bottom_color;
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;
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;
}
*/
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;
*/
/* Expected output: fragment
-layout(binding=72) uniform GlobalValues
+layout(set=0, binding=24) uniform GlobalValues
{
vec4 tint;
vec2 scale;
frag_color = color;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in vec4 color;
frag_color = color;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=1) in vec4 color;
gl_Position = position;
}
+// Target API: Vulkan
+
/* Expected output: vertex
out gl_PerVertex
{
}
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
void main()
gl_Position = position;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
void main()
-uniform mat4 projection;
+layout(push_constant) uniform Transform
+{
+ mat4 projection;
+};
#pragma MSP stage(vertex)
layout(location=0) in vec4 position;
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
{
{
vec4 color;
};
-uniform mat4 model_matrix;
+layout(push_constant) uniform Transform
+{
+ mat4 model_matrix;
+};
uniform sampler2DShadow shadow_map;
#pragma MSP stage(vertex)
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()
*/
/* 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()
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;
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;
*/
/* 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()
frag_color = material.color;
}
+// Target API: Vulkan
+
/* Expected output: vertex
-layout(binding=48) uniform Transform
+layout(set=0, binding=24) uniform Transform
{
mat4 mvp;
};
{
vec4 color;
};
-layout(binding=64) uniform Material
+layout(set=0, binding=16) uniform Material
{
MaterialParameters material;
};
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;
*/
/* 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;
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;
*/
/* 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()
++arr[0];
}
+// Target API: Vulkan
+
/* Expected output: vertex
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;
{
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;
}
*/
frag_color = sum/sample_count;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
layout(location=0) out vec2 texcoord;
*/
/* 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()
-uniform mat4 mvp;
+layout(push_constant) uniform Transform
+{
+ mat4 mvp;
+};
#pragma MSP stage(vertex)
layout(location=0) in vec4 position;
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()
{
gl_Position = position;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
void main()
gl_Position = position;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
void main()
gl_Position = position;
}
+// Target API: Vulkan
+
/* Expected output: vertex
layout(location=0) in vec4 position;
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;
*/
/* Expected output: fragment
-layout(binding=80) uniform Params
+layout(set=0, binding=56) uniform Params
{
float start_height;
float max_height;
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;
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;
}
*/
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;
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;
}
/*