Add tests showing we don't emit interpolation qualifiers in vertex shaders.

In MSL, these only have an effect on fragment `[[stage_in]]` members.
They have no effect in vertex shaders. The Khronos front end doesn't
even emit the SPIR-V decorations for them.
This commit is contained in:
Chip Davis 2018-09-06 12:22:55 -05:00
Родитель dbb98ffd81
Коммит 1e51b235af
3 изменённых файлов: 94 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,36 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float2 v0 [[user(locn0)]];
float2 v1 [[user(locn1)]];
float3 v2 [[user(locn2)]];
float4 v3 [[user(locn3)]];
float v4 [[user(locn4)]];
float v5 [[user(locn5)]];
float v6 [[user(locn6)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float4 Position [[attribute(0)]];
};
vertex main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
out.v0 = in.Position.xy;
out.v1 = in.Position.zw;
out.v2 = float3(in.Position.x, in.Position.z * in.Position.y, in.Position.x);
out.v3 = in.Position.xxyy;
out.v4 = in.Position.w;
out.v5 = in.Position.y;
out.v6 = in.Position.x * in.Position.w;
out.gl_Position = in.Position;
return out;
}

Просмотреть файл

@ -0,0 +1,36 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float2 v0 [[user(locn0)]];
float2 v1 [[user(locn1)]];
float3 v2 [[user(locn2)]];
float4 v3 [[user(locn3)]];
float v4 [[user(locn4)]];
float v5 [[user(locn5)]];
float v6 [[user(locn6)]];
float4 gl_Position [[position]];
};
struct main0_in
{
float4 Position [[attribute(0)]];
};
vertex main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
out.v0 = in.Position.xy;
out.v1 = in.Position.zw;
out.v2 = float3(in.Position.x, in.Position.z * in.Position.y, in.Position.x);
out.v3 = in.Position.xxyy;
out.v4 = in.Position.w;
out.v5 = in.Position.y;
out.v6 = in.Position.x * in.Position.w;
out.gl_Position = in.Position;
return out;
}

Просмотреть файл

@ -0,0 +1,22 @@
#version 450
layout(location=0) in vec4 Position;
layout(location=0) out vec2 v0;
layout(location=1) out noperspective vec2 v1;
layout(location=2) out centroid vec3 v2;
layout(location=3) out centroid noperspective vec4 v3;
layout(location=4) out sample float v4;
layout(location=5) out sample noperspective float v5;
layout(location=6) out flat float v6;
void main() {
v0 = Position.xy;
v1 = Position.zw;
v2 = vec3(Position.x, Position.z * Position.y, Position.x);
v3 = Position.xxyy;
v4 = Position.w;
v5 = Position.y;
v6 = Position.x * Position.w;
gl_Position = Position;
}