OpenGL 3.3,顶点属性在AMD卡上无法正常工作

时间:2013-12-23 18:42:17

标签: opengl attributes gpu vertex amd-processor

我试图使用以下顶点格式:

attribute 0, GL_UNSIGNED_SHORT, size 1, offset 0, stride 8;
attribute 1, GL_UNSIGNED_SHORT, size 1, offset 2, stride 8;
attribute 2, GL_UNSIGNED_BYTE,  size 2, offset 4, stride 8, normalized;
attribute 3, GL_UNSIGNED_SHORT, size 1, offset 6, stride 8.

它适用于NVIDIA显卡,但是当在AMD显卡上运行时,顶点会被破坏(出现突变模型)。 没有给出OpenGL错误,并且在更改为以下格式时没有问题:

attribute 0, GL_FLOAT, size 3, offset 0,  stride 36;
attribute 1, GL_FLOAT, size 3, offset 12, stride 36;
attribute 2, GL_FLOAT, size 3, offset 24, stride 36.

OR(将所有属性打包成一个)

attribute 0, GL_UNSIGNED_SHORT, size 4, offset 0, stride 8.

第一个顶点格式的顶点着色器定义是:

#version 330 

layout ( location = 0 ) in float in_vsAttrib0;
layout ( location = 1 ) in float in_vsAttrib1;
layout ( location = 2 ) in vec2  in_vsAttrib2;
layout ( location = 3 ) in float in_vsAttrib3;

我是否遗漏了OpenGL规范中关于此的内容,或者它是否是驱动程序问题?

0 个答案:

没有答案