在GLES2.0的VertexShader中可以使用struct array uniform嗎?是否可以在GLES2.0的VertexShader中使用結構數組uniform?
attribute highp vec4 vPosition;
struct TestStruct{
highp vec4 v;
};
uniform TestStruct tmp[32];
void main() {
// test code
gl_Position = vPosition + tmp[31].v;
}
我收到着色器編譯錯誤。 「
」頂點着色器中的統一變量不適合512向量「
我的GPU是Qualcomm adreno220。
有沒有人有關於它的一些信息?
我很困擾。
謝謝。
我檢查了我的設備上的着色器代碼(使用tegra2 GPU的Galaxy選項卡),它的工作原理...我認爲它與GPU相關.. – chrisendymion
感謝您的檢查。我也調查了這個問題,並且我同意你與GPU有關。 – user1602722
是的,它是! 檢查:http://stackoverflow.com/questions/16739993/passing-custom-type-struct-uniform-from-qt-to-glsl-using-qglshaderprogram/16740817#16740817 –