OpenGL ES 3.2 无法识别几何着色器中的 gl_in

问题描述

我有以下着色器代码

#version 320 es

layout(points) in;
layout(points,max_vertices=1) out;

uniform mat4 transform;

void main() {
    gl_Position = gl_in[0].gl_Position * transform;
    EmitVertex();

    EndPrimitive();
}

但是在创建着色器程序时出现以下错误

'gl_in' : undeclared identifier
'gl_in' : left of '[' is not of type array,matrix,or vector
'gl_Position' : field selection requires structure,vector,or matrix on left hand side
'assign' :  cannot convert from 'const highp float' to 'Position 4-component vector of highp float

但在 https://www.khronos.org/registry/OpenGL/specs/es/3.2/GLSL_ES_Specification_3.20.html 中,它明确说明了 gl_in 的存在(作为内置变量)。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)