我在尝试编译顶点着色器时遇到分段错误。我想我在传递顶点属性时发现了问题。以下行编译(它们可能不起作用,但它们仍然编译):
# version 330
layout(location=0) in vec4 in_Loc;
layout(location=1) in vec4 in_Color;
layout(location=2) in vec4 in_Norm;
还
# version 330
layout(location=0) in vec4 in_Loc;
layout(location=1) in vec4 in_Color;
layout(location=25) in vec4 in_Norm;
但
# version 330
layout(location=0) in vec4 in_Loc;
layout(location=1) in vec4 in_Color;
layout(location=2) in vec4 in_Norm;
layout(location=33) in vec4 in_Anything
不会编译。我想我只能定义 3 个 vec4 属性。但是,带有 GL_MAX_VERTEX_ATTRIBS 的 glGetIntegerv 返回 16,这符合 OpenGL 标准。这是与我的硬件相关的某种错误吗?我正在使用英特尔显卡
*-display
description: VGA compatible controller
product: 3rd Gen Core processor Graphics Controller
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 09
width: 64 bits
clock: 33MHz
capabilities: msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:49 memory:f0000000-f03fffff memory:e0000000-efffffff ioport:3000(size=64)
和台面 10:
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.1.0
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile.
操作系统是 ubuntu 14.04。