Summary: | Incorrect calculation of count value in GLUniformData (was: No rendering results with GLSL on Intel HD Graphics 3000 (i3 / Sandy Bridge)) | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | Sven Gothel <sgothel> |
Component: | opengl | Assignee: | Sven Gothel <sgothel> |
Status: | VERIFIED FIXED | ||
Severity: | major | ||
Priority: | P3 | ||
Version: | 2 | ||
Hardware: | Other | ||
OS: | windows | ||
Type: | --- | SCM Refs: |
0b56df9939bcd2e0e1bd193f597206c60fe56c51
|
Workaround: | --- |
Description
Sven Gothel
2012-01-04 09:51:05 CET
Running GearsES2 with "-Djogl.debug.DebugGL" discloses the GL error: Exception in thread "main-AWTAnimator-1" javax.media.opengl.GLException: Thread[main-AWTAnimator-1,5,main] glGetError() returned the following error codes after a call to glUniform(<javax.media.opengl.GLUniformData> GLUniformData[name pmvMatrix, location 22675456, size 4*4, count 6, matrix true, data java.nio.HeapFloatBuffer[pos=32 lim=96 cap=96]]): GL_INVALID_OPERATION ( 1282 0x502), This happens right at GearsES2 shader initialization w/ proper values. "-Djogl.debug.TraceGL" shows (until the GL error): <!-- Create/Load shader code ... Created: ShaderCode[id=2, type=FRAGMENT_SHADER, valid=false, shader: 0, source] --> glCreateProgram() = 1 glGetError() = 0 glCreateShader(<int> 0x8B31) = 2 glGetError() = 0 glShaderSource(<int> 0x2, <int> 0x1, <[Ljava.lang.String;>, <java.nio.IntBuffer> java.nio.DirectIntBufferU[pos=0 lim=1 cap=1]) glGetError() = 0 glCompileShader(<int> 0x2) glGetError() = 0 glGetShaderiv(<int> 0x2, <int> 0x8B81, <[I>, <int> 0x0) glAttachShader(<int> 0x1, <int> 0x2) glGetError() = 0 glCreateShader(<int> 0x8B30) = 3 glGetError() = 0 glShaderSource(<int> 0x3, <int> 0x1, <[Ljava.lang.String;>, <java.nio.IntBuffer> java.nio.DirectIntBufferU[pos=0 lim=1 cap=1]) glGetError() = 0 glCompileShader(<int> 0x3) glGetError() = 0 glGetShaderiv(<int> 0x3, <int> 0x8B81, <[I>, <int> 0x0) glAttachShader(<int> 0x1, <int> 0x3) glLinkProgram(<int> 0x1) glIsProgram(<int> 0x1) = true glGetProgramiv(<int> 0x1, <int> 0x8B82, <[I>, <int> 0x0) glValidateProgram(<int> 0x1) glGetProgramiv(<int> 0x1, <int> 0x8B83, <[I>, <int> 0x0) glUseProgram(<int> 0x1) glGetUniformLocation(<int> 0x1, <java.lang.String> pmvMatrix) = 22675456 glUniform(<javax.media.opengl.GLUniformData> GLUniformData[name pmvMatrix, location 22675456, size 4*4, count 6, matrix true, data java.nio.HeapFloatBuffer[pos=32 lim=96 cap=96]]) No rendering results with GLSL on Intel HD Graphics 3000 (i3 / Sandy Bridge) Turns out GLUniformData had a bug in calculating the 'count' of matrices, ie. it did not respect the given position of the buffer. Instead of 4 * 4x4 it passed 6 * 4x4 (PMVMatrix data). This was tolerated by NV, AMD, ARM, .. driver, but not on Intel HS Graphics 3000 / Windows 7. (Good stuff) Notes: - V-Sync seems not to work (>60fps, tearing) - Supports OpenGL 3.1 - junit test result: All Passed (no failures) |