f591bc0d4a
Support BuiltInFragDepth. Emit interface block for StorageClassUniformConstant. Throw exception when output or fragment input structs contain matrix or array. Dynamically created interface structs sorted by location number instead of alphabetically. Add Compiler::is_array() function.
33 lines
651 B
GLSL
33 lines
651 B
GLSL
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
|
|
|
struct Transform
|
|
{
|
|
float4x4 transform;
|
|
};
|
|
|
|
struct main0_in
|
|
{
|
|
float4 color [[attribute(1)]];
|
|
float3 position [[attribute(0)]];
|
|
};
|
|
|
|
struct main0_out
|
|
{
|
|
float4 VertexOut_color [[user(locn2)]];
|
|
float4 VertexOut_color2 [[user(locn3)]];
|
|
float4 gl_Position [[position]];
|
|
};
|
|
|
|
vertex main0_out main0(main0_in in [[stage_in]], constant Transform& block [[buffer(0)]])
|
|
{
|
|
main0_out out = {};
|
|
out.gl_Position = block.transform * float4(in.position, 1.0);
|
|
out.VertexOut_color = in.color;
|
|
out.VertexOut_color2 = in.color + float4(1.0);
|
|
return out;
|
|
}
|
|
|