Here’s my current issue trying to use MoltenGL. This is printed in my console. Any help would be appreciated.
[mgl-info] Converting GLSL:
#version 100
attribute vec4 vertex;
attribute vec4 color;
uniform mat4 matrix;
varying vec4 c;
void main()
{
gl_Position = matrix * vertex;
c = color;
}
End GLSL
[mgl-info] Converted MSL:
#include <metal_stdlib>
using namespace metal;
struct xlatMtlShaderInput {
float4 vertex [[attribute(0)]];
float4 color [[attribute(1)]];
};
struct xlatMtlShaderOutput {
float4 gl_Position [[position]];
float4 c;
};
struct xlatMtlShaderUniform {
float4x4 matrix;
};
vertex xlatMtlShaderOutput VertexShader5 (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
{
xlatMtlShaderOutput _mtl_o;
_mtl_o.gl_Position = (_mtl_u.matrix * _mtl_i.vertex);
_mtl_o.c = _mtl_i.color;
_mtl_o.gl_Position.z = (_mtl_o.gl_Position.z + _mtl_o.gl_Position.w) / 2.0f;
return _mtl_o;
}
End MSL
Compilation failed:
program_source:4:3: warning: declaration does not declare anything
float4 vertex [[attribute(0)]];
^~~~~~
program_source:17:48: error: expected unqualified-id
_mtl_o.gl_Position = (_mtl_u.matrix * _mtl_i.vertex);
^
(code 3) (null)
Shader 5 could not be compiled.