简体   繁体   English

是否可以在GLES2.0的VertexShader中使用统一的结构数组?

[英]Is it possible to use struct array uniform in VertexShader on GLES2.0?

Is it possible to use struct array uniform in VertexShader on GLES2.0? 是否可以在GLES2.0的VertexShader中使用统一的结构数组?

attribute highp vec4 vPosition;

struct TestStruct{
    highp vec4 v;
};
uniform TestStruct tmp[32];

void main() {
    // test code
    gl_Position = vPosition + tmp[31].v;
}

I recieved shader compile error. 我收到着色器编译错误。
"uniform variables in vertex shader do not fit in 512 vectors" “顶点着色器中的统一变量不适用于512个向量”

My GPU is Qualcomm adreno220. 我的GPU是Qualcomm adreno220。

Do anyone have some information about it? 有人知道吗?
I am troubled very much. 我非常烦恼。

Thanks. 谢谢。

It is possible. 有可能的。 There might be a possibility that your array is too big. 您的阵列可能太大。 Try a number below 10 instead of 32. 尝试使用10以下的数字,而不是32。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM