Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the the system's DeviceType for the generic input profile #1019

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/main/cpp/ExternalVR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ mozilla::gfx::VRControllerType GetVRControllerTypeByDevice(device::DeviceType aT
case device::UnknownType:
default:
result = mozilla::gfx::VRControllerType::_empty;
assert(!"Unknown controller type.");
svillar marked this conversation as resolved.
Show resolved Hide resolved
VRB_LOG("Unknown controller type.");
break;
}
Expand Down
4 changes: 3 additions & 1 deletion app/src/openxr/cpp/OpenXRInputSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ XrResult OpenXRInputSource::Initialize()
for (auto& mapping: OpenXRInputMappings) {
// Always populate default/fall-back profiles
if (mapping.controllerType == device::UnknownType) {
mMappings.push_back(mapping);
mMappings.push_back(mapping);
// Use the system's deviceType instead to ensure we get a valid VRController on WebXR sessions
mMappings.back().controllerType = deviceType;
continue;
} else if (deviceType != mapping.controllerType) {
continue;
Expand Down