assert(VertexBuff size == NormalBuff size);
// Vertices binding
[Vertex Buffer Object] ->bind();
glVertexPointer(3, GL_DOUBLE, 0, NULL);
// Normals binding
[Normals Buffer Object] ->bind();
glNormalPointer(GL_DOUBLE, 0, NULL);
// !! Crash on glDrawArrays in libswrAVX.so
glDrawArrays(GL_QUAD_STRIP, 0, [Elements count]);
- Crashes on GL_DOUBLE type
- Does not crash on GL_FLOAT
- Verified contents of both buffers to be correct geometry in both instances.
Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx hyperv
I suspect this is due to dynamic detection of AVX2.
This is not an issue on AVX2 enabled CPUs.
The particular machine in question does not have the AVX2 flag, however this should not end in a crash.
(In reply to chris from comment #1)
> I suspect this is due to dynamic detection of AVX2.
Not at all. GL_DOUBLE is just plain not supported on swr. If AVX2 presence/absence causes changes in behaviour, you have some configuration issue on your end (e.g. perhaps you're using llvmpipe with one, and swr with the other).
[Note that GL_DOUBLE is an almost completely pointless feature - the "GPU" will still convert your doubles to 32-bit floats. If you want to feed actual fp64 values to your vertices, you need GL_ARB_vertex_attrib_fp64 or whatever.]
Yes, you are correct. Just confirmed my other config is llvm-pipe as you mentioned.
That's unfortunate. Spec indicates GL_DOUBLE as an accepted value.
Noted, will avoid in the future.
Thanks for the info!
(In reply to chris from comment #3)
> That's unfortunate. Spec indicates GL_DOUBLE as an accepted value.
Correct - it was one of the features added in GL 2.0, I believe. But swr is not a fully conformant driver, and this is one of the items that's lacking. Patches welcome!
(In reply to Ilia Mirkin from comment #4)
> (In reply to chris from comment #3)
> > That's unfortunate. Spec indicates GL_DOUBLE as an accepted value.
> > https://www.opengl.org/sdk/docs/man2/xhtml/glVertexPointer.xml
> Correct - it was one of the features added in GL 2.0, I believe. But swr is
> not a fully conformant driver, and this is one of the items that's lacking.
> Patches welcome!
double type for vertex attributes is a 1.0 feature, actually. Albeit prior to 1.1 you couldn't use glVertexPointer and friends... Not to mention buffer objects...
(Albeit I'd say you really should avoid it usually in any case, it will just get converted to float somewhere. Unless your data naturally comes as doubles, so it has to be converted somewhere no matter what.)
GL_DOUBLE support added to mesa-master as commit 33fa4c99f7fa68fd8c33c75c4fe66c4cca76779f