Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
stolk's avatar
stolk
Honored Guest
12 years ago

Rift Display Mode 'Direct' causing crash.

Hi,


I am getting some weird behaviour when setting the Rift Display Mode to 'Direct'.
I create my GL context using SDL2, with these calls:


SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
glcontext = SDL_GL_CreateContext(window);


This works if the Rift Display Mode is set to 'Extended Desktop'.
When set to 'Direct' I get an access violation at addr 0 when executing the SDL_GL_CreateContext() call.

Why would context creation suddenly be different, if the Direct mode is used?
Is it not the same GL driver running on the same GPU?

Another thing I noticed is that in Extended Desktop, with a properly created context, calling ovrHmd_ConfigureRendering() will cause a GL_INVALID_ENUM.


ovrGLConfig cfg;
cfg.OGL.Header.API = ovrRenderAPI_OpenGL;
cfg.OGL.Header.RTSize = OVR::Sizei(hmd->Resolution.w, hmd->Resolution.h);
cfg.OGL.Header.Multisample = 1;
#ifdef _WIN32
if (!(hmd->HmdCaps & ovrHmdCap_ExtendDesktop))
ovrHmd_AttachToWindow(hmd, info.info.win.window, NULL, NULL);

cfg.OGL.Window = info.info.win.window;
cfg.OGL.DC = NULL;
#endif

CHECK_OGL

ovrHmd_ConfigureRendering(hmd, &cfg.Config, ovrDistortionCap_Chromatic | ovrDistortionCap_Vignette | ovrDistortionCap_TimeWarp | ovrDistortionCap_Overdrive, eyeFov, eyeRenderDesc);


Any suggestions what could be causing these problems?

Bram
No RepliesBe the first to reply