mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-28 04:46:55 -08:00
Add -ffast-math
This commit is contained in:
1 parent
bd264e23b6
commit
6afa5fc67f
3 files changed
+10
-8
No files matched your search
@@ -316,6 +316,7 @@ foreach(TARGET_NAME wivrn wivrn-server wivrn-dashboard wivrn-common wivrn-dissec
|
||||
if(TARGET ${TARGET_NAME})
|
||||
target_compile_options(${TARGET_NAME} PRIVATE
|
||||
-fdiagnostics-color -Wall -Wextra -pedantic
|
||||
-ffast-math
|
||||
-Wundef
|
||||
-Wno-missing-field-initializers
|
||||
-Wno-unused-parameter
|
||||
|
||||
@@ -157,7 +157,7 @@ static bool window_intersects_viewport(ImGuiWindow * window, const imgui_context
|
||||
static float distance_to_window(ImGuiWindow * window, ImVec2 position)
|
||||
{
|
||||
if (window->Hidden or not window->Active)
|
||||
return std::numeric_limits<float>::infinity();
|
||||
return std::numeric_limits<float>::max();
|
||||
|
||||
float dx;
|
||||
if (position.x < window->Pos.x)
|
||||
@@ -564,9 +564,9 @@ std::vector<imgui_context::controller_state> imgui_context::read_controllers_sta
|
||||
for (const auto & [controller, state, current_aim_interaction]: std::ranges::zip_view(controllers, new_states, aim_interaction))
|
||||
{
|
||||
const auto & ctrl = controller.first;
|
||||
std::pair<std::optional<ImVec2>, float> index_tip_position{{}, std::numeric_limits<float>::infinity()};
|
||||
std::pair<std::optional<ImVec2>, float> palm_position{{}, std::numeric_limits<float>::infinity()};
|
||||
std::pair<std::optional<ImVec2>, float> controller_position{{}, std::numeric_limits<float>::infinity()};
|
||||
std::pair<std::optional<ImVec2>, float> index_tip_position{{}, std::numeric_limits<float>::max()};
|
||||
std::pair<std::optional<ImVec2>, float> palm_position{{}, std::numeric_limits<float>::max()};
|
||||
std::pair<std::optional<ImVec2>, float> controller_position{{}, std::numeric_limits<float>::max()};
|
||||
|
||||
// First hands, so we can set aim_interaction
|
||||
current_aim_interaction = 1;
|
||||
@@ -676,7 +676,7 @@ std::pair<std::optional<ImVec2>, float> imgui_context::compute_pointer_position(
|
||||
auto intersections = ray_plane_intersection(state);
|
||||
|
||||
if (intersections.empty())
|
||||
return {std::nullopt, std::numeric_limits<float>::infinity()};
|
||||
return {std::nullopt, std::numeric_limits<float>::max()};
|
||||
|
||||
if (ImGuiWindow * modal_popup = ImGui::GetTopMostAndVisiblePopupModal())
|
||||
{
|
||||
@@ -696,7 +696,7 @@ std::pair<std::optional<ImVec2>, float> imgui_context::compute_pointer_position(
|
||||
}
|
||||
}
|
||||
|
||||
return {std::nullopt, std::numeric_limits<float>::infinity()};
|
||||
return {std::nullopt, std::numeric_limits<float>::max()};
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -907,7 +907,7 @@ std::vector<std::pair<int, XrCompositionLayerQuad>> imgui_context::end_frame()
|
||||
}
|
||||
|
||||
// Compute the distance to the closest window
|
||||
float distance = std::numeric_limits<float>::infinity();
|
||||
float distance = std::numeric_limits<float>::max();
|
||||
for (ImGuiWindow * window: context->Windows)
|
||||
{
|
||||
distance = std::min(distance, distance_to_window(window, *position));
|
||||
|
||||
+2
-1
@@ -228,9 +228,10 @@ void scene::render_world(
|
||||
},
|
||||
.minDepth = 0,
|
||||
.maxDepth = 1,
|
||||
.nearZ = std::numeric_limits<float>::infinity(),
|
||||
.nearZ = std::bit_cast<float>(0x7f800000), // infinity
|
||||
.farZ = constants::lobby::near_plane,
|
||||
});
|
||||
static_assert(std::numeric_limits<float>::is_iec559);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user