[OpenGL] error C7539: GLSL 1.20 does not allow nested structs

请看以下代码:

// ...

uniform struct
{
    struct
    {
        vec3 pos;
    } list[10];
} lights;

// ...

有的显卡可以正常处理以上定义,有的不行(即禁止在结构中定义结构)。

请改用以下方式声明:

// ...

struct whatever
{
    vec3 pos;
};

uniform struct
{
     struct whatever list[10];
} lights;

// ...

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据