/ Forums
Applications are now open to attend this year's Oculus Connect. Join us October 11–12 and be first in line for an inside look at what’s new and next for VR.

New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

Linux SDK with mesa

haagchhaagch Posts: 95
edited November 2014 in PC Development
I understand that officially it's experimental and only tested with nvidia.

In fact it does not work with mesa and I am interested why.

Running stuff doesn't show much:
./OculusWorldDemo_x86_64_Debug
Debug: [NetClient] Connected to a server running version 1.1.0 (my version=1.1.0)
Debug: GL_VERSION: 3.0 Mesa 10.4.0-devel (git-cfcd190)
Debug: GL_VERSION: 3.0 Mesa 10.4.0-devel (git-cfcd190)
X Error of failed request:  GLXBadDrawable
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  29 (X_GLXGetDrawableAttributes)
  Serial number of failed request:  56
  Current serial number in output stream:  56
and looking at it in a debugger and reading some code still doesn't make it obvious what the actual problem is.

It's clear that this happens because some unsupported opengl functionality is used. But the files in LibOVR/Src/CAPI/GL/ aren't nice to read completely through and I haven't found this anywhere, so a quick question:

What opengl extensions are required to use the sdk and the demos?
Does anyone happen to know which of those are missing in mesa, maybe they can be implemented in a timely manner?
If it's known what the missing functionality is, can the SDK easily be patched for a temporary workaround (e.g. if it is some synchronization, just don't use it)?

Comments

  • nuclearnuclear Posts: 68
    Lawnmower Man (or Woman)
    haagch wrote:
    X Error of failed request: GLXBadDrawable
    Major opcode of failed request: 155 (GLX)
    Minor opcode of failed request: 29 (X_GLXGetDrawableAttributes)
    Serial number of failed request: 56
    Current serial number in output stream: 56[/code]
    and looking at it in a debugger and reading some code still doesn't make it obvious what the actual problem is.

    X11 is asynchronous. You won't get a meaningful break point in the debugger unless you call XSynchronize(dpy, True); first. Some X apps have a special -sync commandline option for this.

    The error however tells you exactly which GLX request failed (GetDrawableAttributes), which seems to be part of the GLX_SGIX_pbuffer extension (which as a quick grep shows is indeed used by the oculus SDK): https://www.opengl.org/registry/specs/SGIX/pbuffer.txt

    However it doesn't look like a missing extension, but rather an invalid drawable being pased to the request.
    John Tsiombikas
    webpage - blog - youtube channel
  • haagchhaagch Posts: 95
    Thanks for the explanation. I did try to call XSynchronize but maybe I did it in the worng place. Anyway, not so important.

    Somehow I didn't manage to google without the GLX prefix...

    So you think it's just a mesa bug?
  • nuclearnuclear Posts: 68
    Lawnmower Man (or Woman)
    haagch wrote:
    So you think it's just a mesa bug?

    Not necessarily, but it's possible. Can't really tell without deeper examination, and my main development box has an nvidia GPU.

    If you manage to break at the point of failure and examine the drawable being passed by the SDK, you might be able to tell if a correct drawable is passed by libovr or not.
    John Tsiombikas
    webpage - blog - youtube channel
  • haagchhaagch Posts: 95
    Sure, I can get this:
    Breakpoint 1, _XError (dpy=0x71c650, rep=0x7edf70) at XlibInt.c:1438
    1438        event.xerror.serial = _XSetLastRequestRead(dpy, (xGenericReply *)rep);
    (gdb) bt
    #0  _XError (dpy=0x71c650, rep=0x7edf70) at XlibInt.c:1438
    #1  0x00007ffff75e32d0 in handle_error (dpy=0x71c650, err=0x7edf70, in_XReply=1) at xcb_io.c:213
    #2  0x00007ffff75e46ae in _XReply (dpy=0x71c650, rep=0x7fffffffca20, extra=0, discard=0) at xcb_io.c:699
    #3  0x00007ffff79551e0 in GetDrawableAttribute (dpy=0x71c650, drawable=31457282, attribute=32787, value=0x7fffffffcaec) at glx_pbuffer.c:370
    #4  0x00007ffff7955e5e in glXQueryDrawable (dpy=0x71c650, drawable=31457282, attribute=32787, value=0x7fffffffcaec) at glx_pbuffer.c:828
    #5  0x0000000000443f01 in OVR::SDKWindow::getVisualFromDrawable (drawable=31457282, vinfoOut=0x7fffffffcb60) at Src/Displays/OVR_Linux_SDKWindow.cpp:249
    #6  0x000000000047b36f in OVR::CAPI::GL::Context::InitFromCurrent (this=0x7fffffffcb40) at Src/CAPI/GL/CAPI_GL_Util.cpp:808
    #7  0x00000000004720f7 in OVR::CAPI::GL::DistortionRenderer::Initialize (this=0x1400270, apiConfig=0x7fffffffce10) at Src/CAPI/GL/CAPI_GL_DistortionRenderer.cpp:199
    #8  0x000000000046da5d in OVR::CAPI::HMDState::ConfigureRendering (this=0x71ab80, eyeRenderDescOut=0x717308, eyeFovIn=0x7fffffffcdf0, apiConfig=0x7fffffffce10, distortionCaps=395) at Src/CAPI/CAPI_HMDState.cpp:697
    #9  0x0000000000454a8b in ovrHmd_ConfigureRendering (hmddesc=0x71c280, apiConfig=0x7fffffffce10, distortionCaps=395, eyeFovIn=0x7fffffffcdf0, eyeRenderDescOut=0x717308) at Src/OVR_CAPI.cpp:585
    #10 0x000000000040844f in OculusWorldDemoApp::CalculateHmdValues (this=0x717010) at OculusWorldDemo.cpp:591
    #11 0x0000000000405eff in OculusWorldDemoApp::OnStartup (this=0x717010, argc=1, argv=0x7fffffffd608) at OculusWorldDemo.cpp:196
    #12 0x000000000041fff8 in main (argc=1, argv=0x7fffffffd608) at ../CommonSrc/Platform/Linux_Platform.cpp:1036
    (gdb) bt full
    #0  _XError (dpy=0x71c650, rep=0x7edf70) at XlibInt.c:1438
            event = {type = 4214752, xany = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0}, xkey = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, root = 140737351947773, subwindow = 5, time = 0, x = -13928, y = 32767, 
                x_root = -145103576, y_root = 32767, state = 13469248, keycode = 0, same_screen = -13984}, xbutton = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, root = 140737351947773, subwindow = 5, time = 0, x = -13928, y = 32767, x_root = -145103576, 
                y_root = 32767, state = 13469248, button = 0, same_screen = -13984}, xmotion = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, root = 140737351947773, subwindow = 5, time = 0, x = -13928, y = 32767, x_root = -145103576, y_root = 32767, 
                state = 13469248, is_hint = 0 '\000', same_screen = -13984}, xcrossing = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, root = 140737351947773, subwindow = 5, time = 0, x = -13928, y = 32767, x_root = -145103576, y_root = 32767, mode = 13469248, 
                detail = 0, same_screen = -13984, focus = 32767, state = 4214752}, xfocus = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, mode = -136407555, detail = 32767}, xexpose = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, 
                window = 0, x = -136407555, y = 32767, width = 5, height = 0, count = 0}, xgraphicsexpose = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, drawable = 0, x = -136407555, y = 32767, width = 5, height = 0, count = 0, major_code = 0, minor_code = -13928}, 
              xnoexpose = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, drawable = 0, major_code = -136407555, minor_code = 32767}, xvisibility = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, state = -136407555}, xcreatewindow = {
                type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, parent = 0, window = 140737351947773, x = 5, y = 0, width = 0, height = 0, border_width = -13928, override_redirect = 32767}, xdestroywindow = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, 
                event = 0, window = 140737351947773}, xunmap = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, event = 0, window = 140737351947773, from_configure = 5}, xmap = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, event = 0, 
                window = 140737351947773, override_redirect = 5}, xmaprequest = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, parent = 0, window = 140737351947773}, xreparent = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, event = 0, 
                window = 140737351947773, parent = 5, x = 0, y = 0, override_redirect = -13928}, xconfigure = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, event = 0, window = 140737351947773, x = 5, y = 0, width = 0, height = 0, border_width = -13928, above = 140737343251752, 
                override_redirect = 13469248}, xgravity = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, event = 0, window = 140737351947773, x = 5, y = 0}, xresizerequest = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, 
                width = -136407555, height = 32767}, xconfigurerequest = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, parent = 0, window = 140737351947773, x = 5, y = 0, width = 0, height = 0, border_width = -13928, above = 140737343251752, detail = 13469248, 
                value_mask = 140737488341344}, xcirculate = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, event = 0, window = 140737351947773, place = 5}, xcirculaterequest = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, parent = 0, 
                window = 140737351947773, place = 5}, xproperty = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, atom = 140737351947773, time = 5, state = 0}, xselectionclear = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, 
                selection = 140737351947773, time = 5}, xselectionrequest = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, owner = 0, requestor = 140737351947773, selection = 5, target = 0, property = 140737488341400, time = 140737343251752}, xselection = {type = 4214752, 
                serial = 140737488344576, send_event = 0, display = 0x0, requestor = 0, selection = 140737351947773, target = 5, property = 0, time = 140737488341400}, xcolormap = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, colormap = 140737351947773, new = 5, 
                state = 0}, xclient = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, message_type = 140737351947773, format = 5, data = {b = "\000\000\000\000\000\000\000\000\230\311\377\377\377\177\000\000(\345", <incomplete sequence \367>, s = {0, 0, 0, 0, -13928, 
                    -1, 32767, 0, -6872, -2215}, l = {0, 140737488341400, 140737343251752, 13469248, 140737488341344}}}, xmapping = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, request = -136407555, first_keycode = 32767, count = 5}, xerror = {type = 4214752, 
                display = 0x7fffffffd600, resourceid = 0, serial = 0, error_code = 0 '\000', request_code = 0 '\000', minor_code = 0 '\000'}, xkeymap = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, window = 0, 
                key_vector = "\375\225\336\367\377\177\000\000\005", '\000' <repeats 15 times>, "\230\311\377\377\377\177\000"}, xgeneric = {type = 4214752, serial = 140737488344576, send_event = 0, display = 0x0, extension = 0, evtype = 0}, xcookie = {type = 4214752, serial = 140737488344576, 
                send_event = 0, display = 0x0, extension = 0, evtype = 0, cookie = 4158559741, data = 0x5}, pad = {4214752, 140737488344576, 0, 0, 0, 140737351947773, 5, 0, 140737488341400, 140737343251752, 13469248, 140737488341344, 4214752, 140737351974496, 140737488341280, 7456336, 8314736, 
                140737488341400, 68, 7461024, 0, -1, 7456336, 140737488341332}}
            async = 0x404fe0 <_start>
            next = 0x7fffffffd600
    #1  0x00007ffff75e32d0 in handle_error (dpy=0x71c650, err=0x7edf70, in_XReply=1) at xcb_io.c:213
            ext = 0x0
            ret_code = 1
    #2  0x00007ffff75e46ae in _XReply (dpy=0x71c650, rep=0x7fffffffca20, extra=0, discard=0) at xcb_io.c:699
            ret_code = 0
            error = 0x7edf70
            c = 0x71d8a0
            reply = 0x0
            current = 0xb9adb0
            __PRETTY_FUNCTION__ = "_XReply"
    #3  0x00007ffff79551e0 in GetDrawableAttribute (dpy=0x71c650, drawable=31457282, attribute=32787, value=0x7fffffffcaec) at glx_pbuffer.c:370
            priv = 0x727310
            reply = {type = 0 '\000', unused = 171 '\253', sequenceNumber = 68, length = 31457282, numAttribs = 10158109, pad2 = 0, pad3 = 0, pad4 = 0, pad5 = 0, pad6 = 0}
            data = 0x0
            opcode = 155 '\233'
            length = 0
            i = 0
            num_attributes = 5
            use_glx_1_3 = 1 '\001'
            pdraw = 0xcdd590
    #4  0x00007ffff7955e5e in glXQueryDrawable (dpy=0x71c650, drawable=31457282, attribute=32787, value=0x7fffffffcaec) at glx_pbuffer.c:828
            __func__ = "glXQueryDrawable"
    #5  0x0000000000443f01 in OVR::SDKWindow::getVisualFromDrawable (drawable=31457282, vinfoOut=0x7fffffffcb60) at Src/Displays/OVR_Linux_SDKWindow.cpp:249
            display = 0x71c650
            value = 0
            chosen = 0xf
    #6  0x000000000047b36f in OVR::CAPI::GL::Context::InitFromCurrent (this=0x7fffffffcb40) at Src/CAPI/GL/CAPI_GL_Util.cpp:808
    No locals.
    #7  0x00000000004720f7 in OVR::CAPI::GL::DistortionRenderer::Initialize (this=0x1400270, apiConfig=0x7fffffffce10) at Src/CAPI/GL/CAPI_GL_DistortionRenderer.cpp:199
            config = 0x7fffffffce10
            currContext = {initialized = true, ownsContext = false, incarnation = 1, x11Display = 0x71c650, x11Drawable = 31457282, systemContext = 0xc13df0, x11Visual = {visual = 0xc3ffffcb90, visualid = 20972688, screen = 20972680, depth = 0, c_class = 20972672, red_mask = 20972528, 
    ---Type <return> to continue, or q <return> to quit---
                green_mask = 20972512, blue_mask = 20972496, colormap_size = 20972480, bits_per_rgb = 0}}
    #8  0x000000000046da5d in OVR::CAPI::HMDState::ConfigureRendering (this=0x71ab80, eyeRenderDescOut=0x717308, eyeFovIn=0x7fffffffcdf0, apiConfig=0x7fffffffce10, distortionCaps=395) at Src/CAPI/CAPI_HMDState.cpp:697
            checkScope = {pChecker = 0x71b8e0}
    #9  0x0000000000454a8b in ovrHmd_ConfigureRendering (hmddesc=0x71c280, apiConfig=0x7fffffffce10, distortionCaps=395, eyeFovIn=0x7fffffffcdf0, eyeRenderDescOut=0x717308) at Src/OVR_CAPI.cpp:585
            hmd = 0x71ab80
    #10 0x000000000040844f in OculusWorldDemoApp::CalculateHmdValues (this=0x717010) at OculusWorldDemo.cpp:591
            eyeFov = {{UpTan = 1.32928634, DownTan = 1.32928634, LeftTan = 1.05865765, RightTan = 1.09236801}, {UpTan = 1.32928634, DownTan = 1.32928634, LeftTan = 1.09236801, RightTan = 1.05865765}}
            config = {Header = {API = ovrRenderAPI_OpenGL, RTSize = {w = 1100, h = 618}, Multisample = 1}, PlatformData = {7456336, 31457282, 0, 0, 0, 0, 0, 0}}
            distortionCaps = 395
            orthoDistance = 1.09236801
            orthoScale1 = {x = 6.43476255e-42, y = 0}
            hmdCaps = 640
            sensorCaps = 1065845272
            orthoScale0 = {x = 3.54832986e-38, y = 0}
    #11 0x0000000000405eff in OculusWorldDemoApp::OnStartup (this=0x717010, argc=1, argv=0x7fffffffd608) at OculusWorldDemo.cpp:196
    No locals.
    #12 0x000000000041fff8 in main (argc=1, argv=0x7fffffffd608) at ../CommonSrc/Platform/Linux_Platform.cpp:1036
            app = 0x717010
            exitCode = 0
    
    The drawable in question seems to be "31457282" and the failing call to be glXQueryDrawable() and from that GetDrawableAttribute().

    If I break on XError the program gets paused while there is a window frame with transparent content visible. using xwininfo -int on it shows:
    xwininfo -int
    
    xwininfo: Please select the window about which you
              would like information by clicking the
              mouse in that window.
    
    xwininfo: Window id: 31457282 "Oculus World Demo GL : Oculus Rift DK2"
    
      Absolute upper-left X:  0
      Absolute upper-left Y:  429
      Relative upper-left X:  0
      Relative upper-left Y:  0
      Width: 1100
      Height: 618
      Depth: 24
      Visual: 0x20
      Visual Class: TrueColor
      Border width: 0
      Class: InputOutput
      Colormap: 0x1e00001 (not installed)
      Bit Gravity State: ForgetGravity
      Window Gravity State: NorthWestGravity
      Backing Store State: NotUseful
      Save Under State: no
      Map State: IsViewable
      Override Redirect State: no
      Corners:  +0+429  -2740+429  -2740-33  +0-33
      -geometry 1100x618+-3-30
    

    And the Window id: 31457282 is our drawable=31457282.

    I don't know mesa and X well, I'm just reading code:

    The error seems to happen here: http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/glx_pbuffer.c#n370
    but before that:
    GetDrawableAttribute does pdraw = GetGLXDRIDrawable(dpy, drawable);
    GetGLXDRIDrawable does struct glx_display *priv = __glXInitialize(dpy); and then if (__glxHashLookup(priv->drawHash, drawable, (void *) &pdraw) == 0) is true (0 means found) and pdraw is returned, so this is still working so far.

    I can read a bit more code but someone who knows mesa and Xlib and knows where to look and when something looks bad, would probably have success much quicker.
  • nuclearnuclear Posts: 68
    Lawnmower Man (or Woman)
    In case you didn't see this in the linux issues thread, this is your problem: viewtopic.php?f=20&t=16268#p213055

    You should probably try the proposed fix and see if it works.
    John Tsiombikas
    webpage - blog - youtube channel
  • haagchhaagch Posts: 95
    I have seen and tried it, but it didn't help against the X Error. But thanks for the suggestion.
    Reading the several threads about linux there seem to be a lot of issues with the opengl implementation in the SDK that should probably first get fixed...
  • haagchhaagch Posts: 95
    I think jherico has identified the problem: viewtopic.php?p=213090#p213388

    The callback branch doesn't compile:
    /home/chris/build/oculus-rift-sdk-jherico-git/src/OculusSDK/Samples/CommonSrc/Platform/Linux_Platform.cpp: In member function 'virtual ovrRenderAPIConfig OVR::Render::GL::Linux::RenderDevice::Get_ovrRenderAPIConfig() const':
    /home/chris/build/oculus-rift-sdk-jherico-git/src/OculusSDK/Samples/CommonSrc/Platform/Linux_Platform.cpp:952:13: error: 'ovrGLConfigData' has no member named 'Win'
         cfg.OGL.Win                = Win;
                 ^
    /home/chris/build/oculus-rift-sdk-jherico-git/src/OculusSDK/Samples/CommonSrc/Platform/Linux_Platform.cpp:953:13: error: 'ovrGLConfigData' has no member named 'Disp'
         cfg.OGL.Disp               = Disp;
                 ^
    Samples/CommonSrc/CMakeFiles/CommonSrc.dir/build.make:261: recipe for target 'Samples/CommonSrc/CMakeFiles/CommonSrc.dir/Platform/Linux_Platform.cpp.o' failed
    
    But removing the two offending lines for now "fixes" that.

    The BadDrawable XError is gone, now I'm getting the real errors:
    failed: 0:4(12): warning: extension `GL_EXT_gpu_shader4' unsupported in fragment shader
    0:26(14): error: `gl_FragCoord' redeclared
    0:27(68): error: no function with name 'textureSize2D'
    

    This is in the shader source code in LibOVR/Src/CAPI/GL/CAPI_GL_DistortionShaders.h.

    I believe "_FS_IN vec4 gl_FragCoord;\n" can just be removed when it is "redeclared".

    The textureSize2D function seems to be related to GL_EXT_gpu_shader4 so no surprise there.
    It looks like mesa just doesn't have this... https://bugs.freedesktop.org/show_bug.cgi?id=70260#c2
  • jhericojherico Posts: 1,419
    Nexus 6
    haagch wrote:
    The callback branch doesn't compile:

    The callback branch SDK samples don't compile. I don't really spend much time working with the Oculus samples as they're very Direct3D focused, and they spend too much effort maintaining state. This in turn masks bugs in the SDK where it does stuff like change state and not restore it. Basically I don't consider the SDK examples a sufficient test for 'this SDK is working' so I simply don't use them.

    If you want to try out my callback approach, you can use my corresponding examples callback branch here: https://github.com/jherico/OculusRiftInAction/tree/callback
    Brad Davis - Developer for High Fidelity
    Co-author of Oculus Rift in Action

  • haagchhaagch Posts: 95
    Well, it would have been nice to have a default demo that at least does something in the upstream sdk. :)

    Anyway, when I make a release build of OculusRiftInAction/build/output/Example_2_4_HelloRift it just fails with
    Compiling shaders/Chapter5.vs
    std::bad_alloc
    

    When I make a debug build it doesn't (wtf?).
    The good news is: It opens a window and renders something without crashing. YAY.
    http://imgur.com/Y10aRmE

    First there is still the problem with OpenGL core contexts in GLEW I think:
    Mesa: User error: GL_INVALID_ENUM in glGetString(GL_EXTENSIONS)
    It's been an open bug for 4 years or so: http://sourceforge.net/p/glew/bugs/120/

    The following problems could of course have been caused by the glew extension string not working.

    Then I get
    Mesa: User error: GL_INVALID_VALUE in glPixelStore(param)
    caused by:
    #0  _mesa_error (ctx=0x7ffff7f19040, error=1281, fmtString=0x7fffdfbe4b55 "glPixelStore(param)") at ../../src/mesa/main/errors.c:1362
    #1  0x00007fffdf8a1017 in _mesa_PixelStorei (pname=3317, param=0) at ../../src/mesa/main/pixelstore.c:218
    #2  0x00000000004c9bb6 in GlUtils::getImageAsTexture<3553u> (texture=std::shared_ptr (count 1, weak 0) 0x1353250, resource=IMAGES_FLOOR_PNG, outSize=..., target=3553) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlUtils.h:88
    #3  0x00000000004c4eb6 in GlUtils::getImageAsTexture<3553u, 32856u> (texture=std::shared_ptr (count 1, weak 0) 0x1353250, resource=IMAGES_FLOOR_PNG, target=3553) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlUtils.h:127
    #4  0x00000000004c2166 in GlUtils::getImageAsTexture<3553u, 32856u> (resource=IMAGES_FLOOR_PNG, target=3553) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlUtils.h:110
    #5  0x00000000004b7dde in GlUtils::renderFloor () at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlUtils.cpp:1198
    #6  0x00000000004a9a00 in HelloRift::renderScene (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:267
    #7  0x00000000004a971b in HelloRift::draw()::{lambda()#1}::operator()() const (__closure=0x7fffffffd0e0) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:257
    #8  0x00000000004abaa9 in gl::MatrixStack::withPush<HelloRift::draw()::{lambda()#1}>(HelloRift::draw()::{lambda()#1}) (this=0x77e480 <gl::Stacks::modelview()::modelview>, f=...) at /home/chris/build/OculusRiftInAction/libraries/gl/GlStacks.h:153
    #9  0x00000000004a988d in HelloRift::draw (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:258
    #10 0x00000000004d2886 in GlfwApp::run (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlfwApp.cpp:326
    #11 0x00000000004a7805 in main (argc=1, argv=0x7fffffffd5f8) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:283
    (gdb) bt full
    #0  _mesa_error (ctx=0x7ffff7f19040, error=1281, fmtString=0x7fffdfbe4b55 "glPixelStore(param)") at ../../src/mesa/main/errors.c:1362
            do_output = 0 '\000'
            do_log = 0 '\000'
            error_msg_id = 3
            __PRETTY_FUNCTION__ = "_mesa_error"
    #1  0x00007fffdf8a1017 in _mesa_PixelStorei (pname=3317, param=0) at ../../src/mesa/main/pixelstore.c:218
            ctx = 0x7ffff7f19040
    #2  0x00000000004c9bb6 in GlUtils::getImageAsTexture<3553u> (texture=std::shared_ptr (count 1, weak 0) 0x1353250, resource=IMAGES_FLOOR_PNG, outSize=..., target=3553) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlUtils.h:88
            imageData = std::vector of length 786432, capacity 786432 = {14 '\016', 9 '\t', 5 '\005', 18 '\022', 13 '\r', 9 '\t', 24 '\030', 14 '\016', 12 '\f', 21 '\025', 11 '\v', 9 '\t', 32 ' ', 21 '\025', 19 '\023', 40 '(', 29 '\035', 27 '\033', 31 '\037', 20 '\024', 18 '\022', 28 '\034', 17 '\021', 15 '\017', 32 ' ', 18 '\022', 15 '\017', 44 ',', 30 '\036', 27 '\033', 55 '7', 
              37 '%', 33 '!', 46 '.', 28 '\034', 24 '\030', 30 '\036', 15 '\017', 8 '\b', 35 '#', 22 '\026', 14 '\016', 38 '&', 30 '\036', 19 '\023', 28 '\034', 22 '\026', 10 '\n', 28 '\034', 24 '\030', 12 '\f', 24 '\030', 20 '\024', 8 '\b', 29 '\035', 23 '\027', 11 '\v', 32 ' ', 24 '\030', 13 '\r', 46 '.', 33 '!', 25 '\031', 55 '7', 42 '*', 34 '"', 39 '\'', 29 '\035', 20 '\024', 
              43 '+', 34 '"', 25 '\031', 36 '$', 27 '\033', 18 '\022', 33 '!', 24 '\030', 15 '\017', 37 '%', 24 '\030', 18 '\022', 50 '2', 35 '#', 30 '\036', 56 '8', 37 '%', 31 '\037', 52 '4', 35 '#', 28 '\034', 39 '\'', 30 '\036', 21 '\025', 31 '\037', 22 '\026', 15 '\017', 39 '\'', 21 '\025', 19 '\023', 51 '3', 30 '\036', 29 '\035', 62 '>', 42 '*', 41 ')', 40 '(', 21 '\025', 
              17 '\021', 35 '#', 18 '\022', 11 '\v', 57 '9', 40 '(', 33 '!', 40 '(', 23 '\027', 16 '\020', 36 '$', 19 '\023', 12 '\f', 40 '(', 21 '\025', 17 '\021', 49 '1', 30 '\036', 26 '\032', 55 '7', 35 '#', 34 '"', 63 '?', 43 '+', 42 '*', 50 '2', 32 ' ', 28 '\034', 45 '-', 28 '\034', 21 '\025', 45 '-', 28 '\034', 21 '\025', 37 '%', 23 '\027', 14 '\016', 29 '\035', 18 '\022', 
              12 '\f', 46 '.', 33 '!', 25 '\031', 55 '7', 36 '$', 29 '\035', 73 'I', 54 '6', 47 '/', 46 '.', 36 '$', 27 '\033', 31 '\037', 22 '\026', 15 '\017', 32 ' ', 21 '\025', 15 '\017', 40 '(', 25 '\031', 18 '\022', 44 ',', 26 '\032', 14 '\016', 53 '5', 35 '#', 21 '\025', 47 '/', 35 '#', 23 '\027', 48 '0', 35 '#', 26 '\032', 42 '*', 27 '\033', 22 '\026', 34 '"', 16 '\020', 
              14 '\016', 51 '3', 36 '$', 31 '\037', 46 '.', 33 '!', 27 '\033', 42 '*', 33 '!', 28 '\034', 37 '%', 28 '\034', 21 '\025', 29 '\035', 15 '\017'...}
    #3  0x00000000004c4eb6 in GlUtils::getImageAsTexture<3553u, 32856u> (texture=std::shared_ptr (count 1, weak 0) 0x1353250, resource=IMAGES_FLOOR_PNG, target=3553) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlUtils.h:127
            imageSize = {{x = 512, r = 512, s = 512}, {y = 512, g = 512, t = 512}}
    #4  0x00000000004c2166 in GlUtils::getImageAsTexture<3553u, 32856u> (resource=IMAGES_FLOOR_PNG, target=3553) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlUtils.h:110
            imageSize = {{x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}}
            texture = std::shared_ptr (count 1, weak 0) 0x1353250
    #5  0x00000000004b7dde in GlUtils::renderFloor () at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlUtils.cpp:1198
            g = std::shared_ptr (count 1, weak 0) 0x1407270
            FLOOR_DIMENSION = 100
            t = std::shared_ptr (empty) 0x0
            program = std::shared_ptr (count 21023232, weak -1) 0x1322f40
    #6  0x00000000004a9a00 in HelloRift::renderScene (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:267
            mv = @0x140eed0: {<std::stack<glm::detail::tmat4x4<float, (glm::precision)0>, std::deque<glm::detail::tmat4x4<float, (glm::precision)0>, std::allocator<glm::detail::tmat4x4<float, (glm::precision)0> > > >> = std::stack wrapping: std::deque with 9152257382846656668 elements = {<error reading variable>
    #7  0x00000000004a971b in HelloRift::draw()::{lambda()#1}::operator()() const (__closure=0x7fffffffd0e0) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:257
            mv = @0x77e480: {<std::stack<glm::detail::tmat4x4<float, (glm::precision)0>, std::deque<glm::detail::tmat4x4<float, (glm::precision)0>, std::allocator<glm::detail::tmat4x4<float, (glm::precision)0> > > >> = std::stack wrapping: std::deque with 2 elements = {{value = {{{data = {1, -0, 0, 0}, {{x = 1, r = 1, s = 1}, {y = -0, g = -0, t = -0}, {z = 0, b = 0, p = 0}, {
                            w = 0, a = 0, q = 0}}}}, {{data = {-0, 1, -0, 0}, {{x = -0, r = -0, s = -0}, {y = 1, g = 1, t = 1}, {z = -0, b = -0, p = -0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, -0, 1, -0}, {{x = 0, r = 0, s = 0}, {y = -0, g = -0, t = -0}, {z = 1, b = 1, p = 1}, {w = -0, a = -0, q = -0}}}}, {{data = {-0, -1.67499995, -0.320000023, 1}, {{x = -0, r = -0, s = -0}, {
                            y = -1.67499995, g = -1.67499995, t = -1.67499995}, {z = -0.320000023, b = -0.320000023, p = -0.320000023}, {w = 1, a = 1, q = 1}}}}}}, {value = {{{data = {1, 0, 0, 0}, {{x = 1, r = 1, s = 1}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 1, 0, 0}, {{x = 0, r = 0, s = 0}, {y = 1, g = 1, t = 1}, {z = 0, b = 0, 
                            p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 0, 1, 0}, {{x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 1, b = 1, p = 1}, {w = 0, a = 0, q = 0}}}}, {{data = {-0.0320000015, -1.67499995, -0.320000023, 1}, {{x = -0.0320000015, r = -0.0320000015, s = -0.0320000015}, {y = -1.67499995, g = -1.67499995, t = -1.67499995}, {z = -0.320000023, 
                            b = -0.320000023, p = -0.320000023}, {w = 1, a = 1, q = 1}}}}}}}, uniformName = "ModelView"}
            eyeArgs = @0x7fffffffd320: {projection = {value = {{{data = {0.929788947, 0, 0, 0}, {{x = 0.929788947, r = 0.929788947, s = 0.929788947}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 0.752283394, 0, 0}, {{x = 0, r = 0, s = 0}, {y = 0.752283394, g = 0.752283394, t = 0.752283394}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{
                      data = {-0.0156717598, 0, -1.00010002, -1}, {{x = -0.0156717598, r = -0.0156717598, s = -0.0156717598}, {y = 0, g = 0, t = 0}, {z = -1.00010002, b = -1.00010002, p = -1.00010002}, {w = -1, a = -1, q = -1}}}}, {{data = {0, 0, -0.010001, 0}, {{x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = -0.010001, b = -0.010001, p = -0.010001}, {w = 0, a = 0, 
                          q = 0}}}}}}, viewOffset = {value = {{{data = {1, 0, 0, 0}, {{x = 1, r = 1, s = 1}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 1, 0, 0}, {{x = 0, r = 0, s = 0}, {y = 1, g = 1, t = 1}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 0, 1, 0}, {{x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 1, 
                          b = 1, p = 1}, {w = 0, a = 0, q = 0}}}}, {{data = {-0.0320000015, 0, 0, 1}, {{x = -0.0320000015, r = -0.0320000015, s = -0.0320000015}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 1, a = 1, q = 1}}}}}}, framebuffer = {frameBuffer = std::shared_ptr (count 1, weak 0) 0x13d99e0, color = std::shared_ptr (count 1, weak 0) 0x13d7000, 
                depth = std::shared_ptr (count 1, weak 0) 0x13c92c0, size = {{x = 1182, r = 1182, s = 1182}, {y = 1461, g = 1461, t = 1461}}}}
            eye = @0x7fffffffd11c: ovrEye_Right
            this = 0x7fffffffd210
    #8  0x00000000004abaa9 in gl::MatrixStack::withPush<HelloRift::draw()::{lambda()#1}>(HelloRift::draw()::{lambda()#1}) (this=0x77e480 <gl::Stacks::modelview()::modelview>, f=...) at /home/chris/build/OculusRiftInAction/libraries/gl/GlStacks.h:153
            __PRETTY_FUNCTION__ = "void gl::MatrixStack::withPush(Function) [with Function = HelloRift::draw()::<lambda()>]"
            startingDepth = 1
    #9  0x00000000004a988d in HelloRift::draw (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:258
            eye = ovrEye_Right
            eyeArgs = @0x7fffffffd320: {projection = {value = {{{data = {0.929788947, 0, 0, 0}, {{x = 0.929788947, r = 0.929788947, s = 0.929788947}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 0.752283394, 0, 0}, {{x = 0, r = 0, s = 0}, {y = 0.752283394, g = 0.752283394, t = 0.752283394}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{
                      data = {-0.0156717598, 0, -1.00010002, -1}, {{x = -0.0156717598, r = -0.0156717598, s = -0.0156717598}, {y = 0, g = 0, t = 0}, {z = -1.00010002, b = -1.00010002, p = -1.00010002}, {w = -1, a = -1, q = -1}}}}, {{data = {0, 0, -0.010001, 0}, {{x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = -0.010001, b = -0.010001, p = -0.010001}, {w = 0, a = 0, 
                          q = 0}}}}}}, viewOffset = {value = {{{data = {1, 0, 0, 0}, {{x = 1, r = 1, s = 1}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 1, 0, 0}, {{x = 0, r = 0, s = 0}, {y = 1, g = 1, t = 1}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 0, 1, 0}, {{x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 1, 
                          b = 1, p = 1}, {w = 0, a = 0, q = 0}}}}, {{data = {-0.0320000015, 0, 0, 1}, {{x = -0.0320000015, r = -0.0320000015, s = -0.0320000015}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 1, a = 1, q = 1}}}}}}, framebuffer = {frameBuffer = std::shared_ptr (count 1, weak 0) 0x13d99e0, color = std::shared_ptr (count 1, weak 0) 0x13d7000, 
                depth = std::shared_ptr (count 1, weak 0) 0x13c92c0, size = {{x = 1182, r = 1182, s = 1182}, {y = 1461, g = 1461, t = 1461}}}}
            mv = @0x77e480: {<std::stack<glm::detail::tmat4x4<float, (glm::precision)0>, std::deque<glm::detail::tmat4x4<float, (glm::precision)0>, std::allocator<glm::detail::tmat4x4<float, (glm::precision)0> > > >> = std::stack wrapping: std::deque with 2 elements = {{value = {{{data = {1, -0, 0, 0}, {{x = 1, r = 1, s = 1}, {y = -0, g = -0, t = -0}, {z = 0, b = 0, p = 0}, {
                            w = 0, a = 0, q = 0}}}}, {{data = {-0, 1, -0, 0}, {{x = -0, r = -0, s = -0}, {y = 1, g = 1, t = 1}, {z = -0, b = -0, p = -0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, -0, 1, -0}, {{x = 0, r = 0, s = 0}, {y = -0, g = -0, t = -0}, {z = 1, b = 1, p = 1}, {w = -0, a = -0, q = -0}}}}, {{data = {-0, -1.67499995, -0.320000023, 1}, {{x = -0, r = -0, s = -0}, {
                            y = -1.67499995, g = -1.67499995, t = -1.67499995}, {z = -0.320000023, b = -0.320000023, p = -0.320000023}, {w = 1, a = 1, q = 1}}}}}}, {value = {{{data = {1, 0, 0, 0}, {{x = 1, r = 1, s = 1}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 1, 0, 0}, {{x = 0, r = 0, s = 0}, {y = 1, g = 1, t = 1}, {z = 0, b = 0, 
                            p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 0, 1, 0}, {{x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 1, b = 1, p = 1}, {w = 0, a = 0, q = 0}}}}, {{data = {-0.0320000015, -1.67499995, -0.320000023, 1}, {{x = -0.0320000015, r = -0.0320000015, s = -0.0320000015}, {y = -1.67499995, g = -1.67499995, t = -1.67499995}, {z = -0.320000023, 
                            b = -0.320000023, p = -0.320000023}, {w = 1, a = 1, q = 1}}}}}}}, uniformName = "ModelView"}
            i = 0
            frameIndex = 1
            eyePoses = {{Orientation = {x = 0, y = 0, z = 0, w = 1}, Position = {x = 0, y = 0, z = 0}}, {Orientation = {x = 0, y = 0, z = 0, w = 1}, Position = {x = 0, y = 0, z = 0}}}
            eyeOffsets = {{x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}}
    #10 0x00000000004d2886 in GlfwApp::run (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlfwApp.cpp:326
            now = 0
            framecount = 0
            start = 0
    #11 0x00000000004a7805 in main (argc=1, argv=0x7fffffffd5f8) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:283
    

    Then
    Mesa: User error: GL_INVALID_OPERATION in unsupported function called (unsupported extension or deprecated function?)
    #0  _mesa_error (ctx=0x7ffff7f5b040, error=1282, fmtString=0x7fffdfbd1ea8 "unsupported function called (unsupported extension or deprecated function?)") at ../../src/mesa/main/errors.c:1362
            do_output = 0 '\000'
            do_log = 128 '\200'
            error_msg_id = 3
            __PRETTY_FUNCTION__ = "_mesa_error"
    #1  0x00007fffdf77032d in _mesa_generic_nop () at ../../src/mesa/main/context.c:890
            ctx = 0x7ffff7f5b040
    #2  0x00007ffff7b43745 in OVR::CAPI::GL::HSWDisplay::RenderInternal (this=0x140a740, eye=ovrEye_Left, eyeTexture=0x7fffffffd3e0) at /home/chris/build/OculusRiftInAction/libraries/OculusSDK/LibOVR/Src/CAPI/GL/CAPI_GL_HSWDisplay.cpp:431
            status = 32767
            y = -12240
            w = 0
            eyeTextureGL = 0x7fffffffd3e0
            x = 32767
            h = 20753984
            fill = {<OVR::RefCountBase<OVR::CAPI::GL::ShaderFill>> = {<OVR::RefCountBaseStatImpl<OVR::RefCountImpl>> = {<OVR::RefCountImpl> = {<OVR::RefCountImplCore> = {_vptr.RefCountImplCore = 0x7fffffffd060, RefCount = 21014336}, <No data fields>}, <No data fields>}, <No data fields>}, Shaders = {pObject = 0x5}, Textures = {{pObject = 0x0}, {pObject = 0x3faa260e3faa260e}, {
                  pObject = 0x7ffff7ac1370}, {pObject = 0x7fffffffd260}, {pObject = 0x7ffff7dd8348 <OVR::CAPI::HSWDisplay::TickState(ovrHSWDisplayState_*, bool)@got.plt>}, {pObject = 0x4a7630 <_start>}, {pObject = 0x7fffffffd5f0}, {pObject = 0x0}}, InputLayout = 0x0}
            scale = 0
    #3  0x00007ffff7b2a1f3 in OVR::CAPI::HSWDisplay::Render (this=0x140a740, eye=ovrEye_Left, eyeTexture=0x7fffffffd3e0) at /home/chris/build/OculusRiftInAction/libraries/OculusSDK/LibOVR/Src/CAPI/CAPI_HSWDisplay.cpp:317
    No locals.
    #4  0x00007ffff7b61807 in ovrHmd_EndFrame (hmddesc=0xc46090, renderPose=0x77e500 <HelloRift::draw()::eyePoses>, eyeTexture=0x7fffffffd3e0) at /home/chris/build/OculusRiftInAction/libraries/OculusSDK/LibOVR/Src/OVR_CAPI.cpp:655
            hswDisplayState = {Displayed = 1 '\001', StartTime = 57452.797806387003, DismissibleTime = 57454.797806387003}
            hmds = 0x7e2af0
            checkScope = {pChecker = 0x7e3850}
    #5  0x00000000004a98cf in HelloRift::draw (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:261
            frameIndex = 1
            eyePoses = {{Orientation = {x = 0, y = 0, z = 0, w = 1}, Position = {x = 0, y = 0, z = 0}}, {Orientation = {x = 0, y = 0, z = 0, w = 1}, Position = {x = 0, y = 0, z = 0}}}
            eyeOffsets = {{x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}}
    #6  0x00000000004d2886 in GlfwApp::run (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlfwApp.cpp:326
            now = 0
            framecount = 0
            start = 0
    #7  0x00000000004a7805 in main (argc=1, argv=0x7fffffffd5f8) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:283
    No locals.
    

    Then: Mesa: User error: GL_INVALID_OPERATION in glFramebufferTexture2D
    #0  _mesa_error (ctx=0x7ffff7f5b040, error=1282, fmtString=0x7fffdfbd7d8c "glFramebufferTexture%s") at ../../src/mesa/main/errors.c:1362
            do_output = 0 '\000'
            do_log = 0 '\000'
            error_msg_id = 3
            __PRETTY_FUNCTION__ = "_mesa_error"
    #1  0x00007fffdf7ac6bc in framebuffer_texture (ctx=0x7ffff7f5b040, caller=0x7fffdfbd7f05 "2D", target=36160, attachment=36064, textarget=3553, texture=1, level=0, zoffset=0, layered=0 '\000') at ../../src/mesa/main/fbobject.c:2335
            att = 0x0
            texObj = 0x0
            fb = 0xcf5920
            maxLevelsTarget = 0
            __func__ = "framebuffer_texture"
            __PRETTY_FUNCTION__ = "framebuffer_texture"
    #2  0x00007fffdf7acece in _mesa_FramebufferTexture2D (target=36160, attachment=36064, textarget=3553, texture=1, level=0) at ../../src/mesa/main/fbobject.c:2591
            ctx = 0x7ffff7f5b040
    #3  0x00007ffff7b4376f in OVR::CAPI::GL::HSWDisplay::RenderInternal (this=0x140a740, eye=ovrEye_Left, eyeTexture=0x7fffffffd3e0) at /home/chris/build/OculusRiftInAction/libraries/OculusSDK/LibOVR/Src/CAPI/GL/CAPI_GL_HSWDisplay.cpp:432
            status = 32767
            y = -12240
            w = 0
            eyeTextureGL = 0x7fffffffd3e0
            x = 32767
            h = 20753984
            fill = {<OVR::RefCountBase<OVR::CAPI::GL::ShaderFill>> = {<OVR::RefCountBaseStatImpl<OVR::RefCountImpl>> = {<OVR::RefCountImpl> = {<OVR::RefCountImplCore> = {_vptr.RefCountImplCore = 0x7fffffffd060, RefCount = 21014336}, <No data fields>}, <No data fields>}, <No data fields>}, Shaders = {pObject = 0x5}, Textures = {{pObject = 0x0}, {pObject = 0x3faa260e3faa260e}, {
                  pObject = 0x7ffff7ac1370}, {pObject = 0x7fffffffd260}, {pObject = 0x7ffff7dd8348 <OVR::CAPI::HSWDisplay::TickState(ovrHSWDisplayState_*, bool)@got.plt>}, {pObject = 0x4a7630 <_start>}, {pObject = 0x7fffffffd5f0}, {pObject = 0x0}}, InputLayout = 0x0}
            scale = 0
    #4  0x00007ffff7b2a1f3 in OVR::CAPI::HSWDisplay::Render (this=0x140a740, eye=ovrEye_Left, eyeTexture=0x7fffffffd3e0) at /home/chris/build/OculusRiftInAction/libraries/OculusSDK/LibOVR/Src/CAPI/CAPI_HSWDisplay.cpp:317
    No locals.
    #5  0x00007ffff7b61807 in ovrHmd_EndFrame (hmddesc=0xc46090, renderPose=0x77e500 <HelloRift::draw()::eyePoses>, eyeTexture=0x7fffffffd3e0) at /home/chris/build/OculusRiftInAction/libraries/OculusSDK/LibOVR/Src/OVR_CAPI.cpp:655
            hswDisplayState = {Displayed = 1 '\001', StartTime = 57452.797806387003, DismissibleTime = 57454.797806387003}
            hmds = 0x7e2af0
            checkScope = {pChecker = 0x7e3850}
    #6  0x00000000004a98cf in HelloRift::draw (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:261
            frameIndex = 1
            eyePoses = {{Orientation = {x = 0, y = 0, z = 0, w = 1}, Position = {x = 0, y = 0, z = 0}}, {Orientation = {x = 0, y = 0, z = 0, w = 1}, Position = {x = 0, y = 0, z = 0}}}
            eyeOffsets = {{x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}}
    #7  0x00000000004d2886 in GlfwApp::run (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlfwApp.cpp:326
            now = 0
            framecount = 0
            start = 0
    #8  0x00000000004a7805 in main (argc=1, argv=0x7fffffffd5f8) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:283
    No locals.
    

    And lastly: Mesa: User error: GL_INVALID_OPERATION in glFramebufferRenderbuffer
    #0  _mesa_error (ctx=0x7ffff7f5b040, error=1282, fmtString=0x7fffdfbd7fc6 "glFramebufferRenderbuffer") at ../../src/mesa/main/errors.c:1362
            do_output = 0 '\000'
            do_log = 0 '\000'
            error_msg_id = 3
            __PRETTY_FUNCTION__ = "_mesa_error"
    #1  0x00007fffdf7ad109 in _mesa_FramebufferRenderbuffer (target=36160, attachment=36096, renderbufferTarget=36161, renderbuffer=0) at ../../src/mesa/main/fbobject.c:2666
            att = 0xde100000001
            fb = 0xcf5920
            rb = 0x7ffff7f5b040
            ctx = 0x7ffff7f5b040
            __func__ = "_mesa_FramebufferRenderbuffer"
            __PRETTY_FUNCTION__ = "_mesa_FramebufferRenderbuffer"
    #2  0x00007ffff7b4378f in OVR::CAPI::GL::HSWDisplay::RenderInternal (this=0x140a740, eye=ovrEye_Left, eyeTexture=0x7fffffffd3e0) at /home/chris/build/OculusRiftInAction/libraries/OculusSDK/LibOVR/Src/CAPI/GL/CAPI_GL_HSWDisplay.cpp:433
            status = 32767
            y = -12240
            w = 0
            eyeTextureGL = 0x7fffffffd3e0
            x = 32767
            h = 20753984
            fill = {<OVR::RefCountBase<OVR::CAPI::GL::ShaderFill>> = {<OVR::RefCountBaseStatImpl<OVR::RefCountImpl>> = {<OVR::RefCountImpl> = {<OVR::RefCountImplCore> = {_vptr.RefCountImplCore = 0x7fffffffd060, RefCount = 21014336}, <No data fields>}, <No data fields>}, <No data fields>}, Shaders = {pObject = 0x5}, Textures = {{pObject = 0x0}, {pObject = 0x3faa260e3faa260e}, {
                  pObject = 0x7ffff7ac1370}, {pObject = 0x7fffffffd260}, {pObject = 0x7ffff7dd8348 <OVR::CAPI::HSWDisplay::TickState(ovrHSWDisplayState_*, bool)@got.plt>}, {pObject = 0x4a7630 <_start>}, {pObject = 0x7fffffffd5f0}, {pObject = 0x0}}, InputLayout = 0x0}
            scale = 0
    #3  0x00007ffff7b2a1f3 in OVR::CAPI::HSWDisplay::Render (this=0x140a740, eye=ovrEye_Left, eyeTexture=0x7fffffffd3e0) at /home/chris/build/OculusRiftInAction/libraries/OculusSDK/LibOVR/Src/CAPI/CAPI_HSWDisplay.cpp:317
    No locals.
    #4  0x00007ffff7b61807 in ovrHmd_EndFrame (hmddesc=0xc46090, renderPose=0x77e500 <HelloRift::draw()::eyePoses>, eyeTexture=0x7fffffffd3e0) at /home/chris/build/OculusRiftInAction/libraries/OculusSDK/LibOVR/Src/OVR_CAPI.cpp:655
            hswDisplayState = {Displayed = 1 '\001', StartTime = 57452.797806387003, DismissibleTime = 57454.797806387003}
            hmds = 0x7e2af0
            checkScope = {pChecker = 0x7e3850}
    #5  0x00000000004a98cf in HelloRift::draw (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:261
            frameIndex = 1
            eyePoses = {{Orientation = {x = 0, y = 0, z = 0, w = 1}, Position = {x = 0, y = 0, z = 0}}, {Orientation = {x = 0, y = 0, z = 0, w = 1}, Position = {x = 0, y = 0, z = 0}}}
            eyeOffsets = {{x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}}
    #6  0x00000000004d2886 in GlfwApp::run (this=0x7fffffffd210) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlfwApp.cpp:326
            now = 0
            framecount = 0
            start = 0
    #7  0x00000000004a7805 in main (argc=1, argv=0x7fffffffd5f8) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:283
    No locals.
    

    Anyway, looks like progress is being made. Thanks for all that work you put into it.
  • jhericojherico Posts: 1,419
    Nexus 6
    haagch wrote:
    Well, it would have been nice to have a default demo that at least does something in the upstream sdk. :)

    Anyway, when I make a release build of OculusRiftInAction/build/output/Example_2_4_HelloRift it just fails with
    Compiling shaders/Chapter5.vs
    std::bad_alloc
    

    When I make a debug build it doesn't (wtf?).

    This is a known issue.

    I'll take a look at the other stuff when I have a chance, but basically it looks mostly like it's issues with my use of OpenGL, not the SDK's use, so that shouldn't be a blocker.
    Brad Davis - Developer for High Fidelity
    Co-author of Oculus Rift in Action

  • nuclearnuclear Posts: 68
    Lawnmower Man (or Woman)
    haagch wrote:
    The callback branch doesn't compile:
    /home/chris/build/oculus-rift-sdk-jherico-git/src/OculusSDK/Samples/CommonSrc/Platform/Linux_Platform.cpp: In member function 'virtual ovrRenderAPIConfig OVR::Render::GL::Linux::RenderDevice::Get_ovrRenderAPIConfig() const':
    /home/chris/build/oculus-rift-sdk-jherico-git/src/OculusSDK/Samples/CommonSrc/Platform/Linux_Platform.cpp:952:13: error: 'ovrGLConfigData' has no member named 'Win'
         cfg.OGL.Win                = Win;
                 ^
    /home/chris/build/oculus-rift-sdk-jherico-git/src/OculusSDK/Samples/CommonSrc/Platform/Linux_Platform.cpp:953:13: error: 'ovrGLConfigData' has no member named 'Disp'
         cfg.OGL.Disp               = Disp;
                 ^
    Samples/CommonSrc/CMakeFiles/CommonSrc.dir/build.make:261: recipe for target 'Samples/CommonSrc/CMakeFiles/CommonSrc.dir/Platform/Linux_Platform.cpp.o' failed
    
    But removing the two offending lines for now "fixes" that.

    You should not remove them. They are just conditionally compiled, and you have to define OVR_OS_LINUX.
    John Tsiombikas
    webpage - blog - youtube channel
  • jhericojherico Posts: 1,419
    Nexus 6
    nuclear wrote:
    You should not remove them. They are just conditionally compiled, and you have to define OVR_OS_LINUX.

    The point is he's building my branch of the LibOVR project, which no longer defines Disp and Win in the OpenGL rendering config (regardless of OS). I've updated LibOVR, but not the samples, so the samples will not work at all.
    Brad Davis - Developer for High Fidelity
    Co-author of Oculus Rift in Action

  • haagchhaagch Posts: 95
    So glewExperimental is not something that should be used - or so I have been told. And it may or may not creates this errors. So removing it and printing the version
    @ void GlfwApp::onCreate() {
     // Initialize the OpenGL bindings
     // For some reason we have to set this experminetal flag to properly
     // init GLEW if we use a core context.
    -  glewExperimental = GL_TRUE;
    +  //glewExperimental = GL_TRUE;
       if (0 != glewInit()) {
         FAIL("Failed to initialize GLEW");
       }
    +    printf("Initialized OpenGL version: %s\n", glGetString(GL_VERSION));
       glGetError();
     #ifdef RIFT_DEBUG
       GL_CHECK_ERROR;
    
    prints
    Initialized OpenGL version: 3.3 (Core Profile) Mesa 10.4.0-devel (git-971dc2c)

    But it segfaults:
    #0  0x0000000000000000 in ?? ()
    No symbol table info available.
    #1  0x00000000004a7b21 in gl::FrameBuffer::FrameBuffer (this=0x13a5800) at /home/chris/build/OculusRiftInAction/libraries/gl/GlFrameBuffer.h:35
    No locals.
    #2  0x00000000004ab5bf in gl::TFrameBufferWrapper<3553u, 32856u, 33191u>::init (this=0x7fffffffd280, size=...) at /home/chris/build/OculusRiftInAction/libraries/gl/GlFrameBuffer.h:124
    No locals.
    #3  0x00000000004a9105 in HelloRift::initGl()::{lambda(ovrEyeType)#1}::operator()(ovrEyeType) const (__closure=0x7fffffffcfd0, eye=ovrEye_Left) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:149
            eyeArgs = @0x7fffffffd200: {projection = {value = {{{data = {1, 0, 0, 0}, {{x = 1, r = 1, s = 1}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 1, 0, 0}, {{x = 0, r = 0, s = 0}, {y = 1, g = 1, t = 1}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{
                      data = {0, 0, 1, 0}, {{x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 1, b = 1, p = 1}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 0, 0, 1}, {{x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 1, a = 1, q = 1}}}}}}, viewOffset = {value = {{{data = {1, 0, 0, 0}, {
                        {x = 1, r = 1, s = 1}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 1, 0, 0}, {{x = 0, r = 0, s = 0}, {y = 1, g = 1, t = 1}, {z = 0, b = 0, p = 0}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 0, 1, 0}, {{x = 0, r = 0, s = 0}, {y = 0, g = 0, 
                          t = 0}, {z = 1, b = 1, p = 1}, {w = 0, a = 0, q = 0}}}}, {{data = {0, 0, 0, 1}, {{x = 0, r = 0, s = 0}, {y = 0, g = 0, t = 0}, {z = 0, b = 0, p = 0}, {w = 1, a = 1, q = 1}}}}}}, framebuffer = {frameBuffer = std::shared_ptr (empty) 0x0, color = std::shared_ptr (empty) 0x0, 
                depth = std::shared_ptr (empty) 0x0, size = {{x = 1182, r = 1182, s = 1182}, {y = 1461, g = 1461, t = 1461}}}}
            eyeTextureHeader = @0x7fffffffd380: {API = ovrRenderAPI_OpenGL, TextureSize = {w = 1182, h = 1461}, RenderViewport = {Pos = {x = 0, y = 0}, Size = {w = 1182, h = 1461}}}
            this = 0x7fffffffd1b0
            eyeFovPorts = @0x7fffffffd010: {{UpTan = 1.32928634, DownTan = 1.32928634, LeftTan = 1.05865765, RightTan = 1.09236801}, {UpTan = -nan(0x7fd040), DownTan = 4.59163468e-41, LeftTan = -7.2322215e+33, RightTan = 4.59163468e-41}}
    #4  0x00000000004ab99c in for_each_eye<HelloRift::initGl()::{lambda(ovrEyeType)#1}>(HelloRift::initGl()::{lambda(ovrEyeType)#1}) (function=...) at /home/chris/build/OculusRiftInAction/examples/cpp/common/Rift.h:326
            eye = ovrEye_Left
    #5  0x00000000004a936e in HelloRift::initGl (this=0x7fffffffd1b0) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:151
            distortionCaps = 0
            eyeFovPorts = {{UpTan = 1.32928634, DownTan = 1.32928634, LeftTan = 1.05865765, RightTan = 1.09236801}, {UpTan = -nan(0x7fd040), DownTan = 4.59163468e-41, LeftTan = -7.2322215e+33, RightTan = 4.59163468e-41}}
            cfg = {Config = {Header = {API = 8722464, RTSize = {w = 1, h = 8444300}, Multisample = 0}, PlatformData = {4294955120, 32767, 4155654654, 32767, 8444184, 0, 8444296, 0, 8722464, 0, 4160712904, 0, 4294955168, 32767, 4155648100, 32767}}, OGL = {Header = {API = 8722464, RTSize = {w = 1, 
                    h = 8444300}, Multisample = 0}, ContextData = 0x7fffffffd070, ContextSwitch = 0x7ffff7b241fe <OVR::LocklessUpdater<OVR::CAPI::FrameTimeManager::Timing, OVR::CAPI::FrameTimeManager::Timing>::SetState(OVR::CAPI::FrameTimeManager::Timing const&)+208>, SwapBuffers = 0x80d918}}
            eyeRenderDescs = {{Eye = (unknown: 8443160), Fov = {UpTan = 0, DownTan = -nan(0x7fffff), LeftTan = 0, RightTan = 1.2222732e-38}, DistortedViewport = {Pos = {x = 0, y = 8443160}, Size = {w = 0, h = -12064}}, PixelsPerTanAngleAtCenter = {x = 4.59163468e-41, y = -7.23693248e+33}, 
                HmdToEyeViewOffset = {x = 4.59163468e-41, y = 8.96831017e-43, z = 8.96831017e-43}}, {Eye = (unknown: 8442800), Fov = {UpTan = 0, DownTan = 1.18308827e-38, LeftTan = 0, RightTan = 8.96831017e-43}, DistortedViewport = {Pos = {x = 0, y = 0}, Size = {w = 0, h = 4880000}}, 
                PixelsPerTanAngleAtCenter = {x = 0, y = -nan(0x7fd110)}, HmdToEyeViewOffset = {x = 4.59163468e-41, y = -7.38575392e+33, z = 4.59163468e-41}}}
            configResult = 32767
    #6  0x00000000004d28b6 in GlfwApp::run (this=0x7fffffffd1b0) at /home/chris/build/OculusRiftInAction/examples/cpp/common/GlfwApp.cpp:320
            framecount = 32767
            start = 4880000
    #7  0x00000000004a7855 in main (argc=1, argv=0x7fffffffd598) at /home/chris/build/OculusRiftInAction/examples/cpp/Example_2_4_HelloRift.cpp:283
    No locals.
    

    So this is the segfault:
    OculusRiftInAction/libraries/gl/GlFrameBuffer.h:35 is "glGenFramebuffers(1, &frameBuffer);"

    (gdb) print glGenFramebuffers
    $1 = {<text variable, no debug info>} 0x7ffff6aff980 <glGenFramebuffersEXT>

    So it's not a null pointer. But it's a glGenFramebuffersEXT instead of glGenFramebuffers. Weird. I tried changing this, but it didn't change anything:
    @ void InitGLExtensions()
     #endif
     
         glGetStringi =                      (PFNGLGETSTRINGIPROC)                      GetFunction("glGetStringi");
    -    glGenFramebuffers =                 (PFNGLGENFRAMEBUFFERSPROC)                 GetFunction("glGenFramebuffersEXT");
    +    glGenFramebuffers =                 (PFNGLGENFRAMEBUFFERSPROC)                 GetFunction("glGenFramebuffers");
         glDeleteFramebuffers =              (PFNGLDELETEFRAMEBUFFERSPROC)              GetFunction("glDeleteFramebuffersEXT");
         glDeleteShader =                    (PFNGLDELETESHADERPROC)                    GetFunction("glDeleteShader");
         glCheckFramebufferStatus =          (PFNGLCHECKFRAMEBUFFERSTATUSPROC)          GetFunction("glCheckFramebufferStatusEXT");
    

    This was on intel.
    On radeonsi it first segfaults in the same file in GL_CHECK_ERROR. Yes, segfault. Commenting it out results in the same segfault than above.
    virtual ~FrameBuffer() {
         if (frameBuffer) {
           glDeleteFramebuffers(1, &frameBuffer);
           //GL_CHECK_ERROR;
         }
       }
    

    So first question: Is it normal that glGenFramebuffers is <glGenFramebuffersEXT>?
  • haagch wrote:
    If it's known what the missing functionality is, can the SDK easily be patched for a temporary workaround (e.g. if it is some synchronization, just don't use it)?
    Client side distortion appears to be working, as far as I can tell, if you just want to program for the rift on linux right now.
Sign In or Register to comment.