Add -ffast-math
This commit is contained in:
@@ -316,6 +316,7 @@ foreach(TARGET_NAME wivrn wivrn-server wivrn-dashboard wivrn-common wivrn-dissec
|
|||||||
if(TARGET ${TARGET_NAME})
|
if(TARGET ${TARGET_NAME})
|
||||||
target_compile_options(${TARGET_NAME} PRIVATE
|
target_compile_options(${TARGET_NAME} PRIVATE
|
||||||
-fdiagnostics-color -Wall -Wextra -pedantic
|
-fdiagnostics-color -Wall -Wextra -pedantic
|
||||||
|
-ffast-math
|
||||||
-Wundef
|
-Wundef
|
||||||
-Wno-missing-field-initializers
|
-Wno-missing-field-initializers
|
||||||
-Wno-unused-parameter
|
-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)
|
static float distance_to_window(ImGuiWindow * window, ImVec2 position)
|
||||||
{
|
{
|
||||||
if (window->Hidden or not window->Active)
|
if (window->Hidden or not window->Active)
|
||||||
return std::numeric_limits<float>::infinity();
|
return std::numeric_limits<float>::max();
|
||||||
|
|
||||||
float dx;
|
float dx;
|
||||||
if (position.x < window->Pos.x)
|
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))
|
for (const auto & [controller, state, current_aim_interaction]: std::ranges::zip_view(controllers, new_states, aim_interaction))
|
||||||
{
|
{
|
||||||
const auto & ctrl = controller.first;
|
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> index_tip_position{{}, std::numeric_limits<float>::max()};
|
||||||
std::pair<std::optional<ImVec2>, float> palm_position{{}, std::numeric_limits<float>::infinity()};
|
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>::infinity()};
|
std::pair<std::optional<ImVec2>, float> controller_position{{}, std::numeric_limits<float>::max()};
|
||||||
|
|
||||||
// First hands, so we can set aim_interaction
|
// First hands, so we can set aim_interaction
|
||||||
current_aim_interaction = 1;
|
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);
|
auto intersections = ray_plane_intersection(state);
|
||||||
|
|
||||||
if (intersections.empty())
|
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())
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -907,7 +907,7 @@ std::vector<std::pair<int, XrCompositionLayerQuad>> imgui_context::end_frame()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compute the distance to the closest window
|
// 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)
|
for (ImGuiWindow * window: context->Windows)
|
||||||
{
|
{
|
||||||
distance = std::min(distance, distance_to_window(window, *position));
|
distance = std::min(distance, distance_to_window(window, *position));
|
||||||
|
|||||||
+2
-1
@@ -228,9 +228,10 @@ void scene::render_world(
|
|||||||
},
|
},
|
||||||
.minDepth = 0,
|
.minDepth = 0,
|
||||||
.maxDepth = 1,
|
.maxDepth = 1,
|
||||||
.nearZ = std::numeric_limits<float>::infinity(),
|
.nearZ = std::bit_cast<float>(0x7f800000), // infinity
|
||||||
.farZ = constants::lobby::near_plane,
|
.farZ = constants::lobby::near_plane,
|
||||||
});
|
});
|
||||||
|
static_assert(std::numeric_limits<float>::is_iec559);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user