Closed georgewsinger closed 4 years ago
Have you tried changing the MSAA value?
@lboklin Changing (in ./project.godot
) from
quality/filters/msaa=8
to
quality/filters/msaa=3
makes the
ERROR: set_msaa: Index p_msaa=8 out of size (5=5)
error disappear; however, I still get the same segfault.
Some progress. The specific failing function is G.initialize
(which wraps ARVRInterfaceGDNative::initialize()
) in initVR
:
-- | Initialize the ARVRInterface and return the success/failure
initVR :: GodotNode -> GodotARVRInterface -> IO VRInitResult
initVR node vri = do
ret <- G.initialize vri >>= \case -- ← Problem
True -> -- ..
False -> -- ..
-- --
This function is auto-generated by godot-haskell, and seems to have the same interface in Godot 3.1 as it did in Godot 3.0. Tracing through the C++ code takes us to this godot_openvr
function:
//godot_openvr function
godot_bool godot_arvr_initialize(void *p_data) {
arvr_data_struct *arvr_data = (arvr_data_struct *)p_data;
// this should be static once Godot runs but obtain whether we're running GLES2, GLES3 or Vulkan
arvr_data->video_driver = godot::OS::get_singleton()->get_current_video_driver(); //⟵ Problem
//..
}
The problematic call is OS::get_current_video_driver()
, which came from this commit (6 months ago).
What's weird is that we can successfully call the following from Haskell without it crashing Simula:
os <- getSingleton Godot_OS "OS"
driver <- G.get_current_video_driver os
putStrLn $ "Driver: " ++ (show driver) -- Prints correctly as "1", which designates "GLES2"
This suggests there isn't anything intrinsically wrong with OS::get_current_video_driver()
, which is just:
//os_x11.cpp
int OS_X11::get_current_video_driver() const {
return video_driver_index;
}
It's still a mystery to me what is causing this segfault.
Can you try the equivalent in GDScript?
Edit: Without loading the Haskell stuff
@lboklin You mean try calling initialize()
from GDScript to see if it crashes as above?
The godot_openvr demo has a similar initialization logic as Simula's and doesn't crash:
# ./demo/Main.gd in godot_openvr
func _ready():
# Find the interface and initialise
var arvr_interface = ARVRServer.find_interface("OpenVR")
if arvr_interface and arvr_interface.initialize():
# ...
which mirrors in Simula:
-- Simula.hs
ready :: GodotSimula -> [GodotVariant] -> IO ()
ready self _ = do
openVR >>= initVR (safeCast self) >>= \case
InitVRSuccess -> do --...
InitVRFailed -> return ()
-- ..
-- s.t.
-- | Get the OpenVR ARVRInterface
openVR :: IO GodotARVRInterface
openVR = findInterface OpenVR
-- | Initialize the ARVRInterface and return the success/failure
initVR :: GodotNode -> GodotARVRInterface -> IO VRInitResult
initVR node vri =
G.initialize vri >>= \case
True -> initSuccess
False -> initFailed
where
-- ...
Context. Simula is facing two significant
godot_openvr
issues that are making it unstablegodot_arvr_process
Seg FaultAfter upgrading Simula to Godot 3.1, I haven't seen any of (1) so far, and I believe it's possible that fixed things. We're definitely still getting (2) though.
Attempt to upgrade ./addons/godot-openvr. I attempted to upgrade Simula's
./addons/godot-openvr
viabut after launching Simula (w/gdb) I get
with gdb backtrace