Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Merge branch 'httpc' into online
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloMK7 committed Oct 7, 2023
2 parents 9a12f84 + 718ff25 commit 8260d55
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ option(USE_SYSTEM_LIBUSB "Use the system libusb (instead of the bundled libusb)"
option(USE_SYSTEM_CPP_JWT "Use the system cpp-jwt (instead of the bundled one)" OFF)
option(USE_SYSTEM_SOUNDTOUCH "Use the system SoundTouch (instead of the bundled one)" OFF)
option(USE_SYSTEM_CPP_HTTPLIB "Use the system cpp-httplib (instead of the bundled one)" OFF)
option(USE_SYSTEM_JSON "Use the system JSON (nlohmann-json3) package (instead of the bundled one)" OFF)

if (CITRA_USE_PRECOMPILED_HEADERS)
message(STATUS "Using Precompiled Headers.")
Expand Down
20 changes: 17 additions & 3 deletions externals/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,16 @@ endif()

# JSON
add_library(json-headers INTERFACE)
target_include_directories(json-headers INTERFACE ./json)
if (USE_SYSTEM_JSON)
find_package(nlohmann_json REQUIRED)
target_link_libraries(json-headers INTERFACE nlohmann_json::nlohmann_json)
get_target_property(NLOHMANN_PREFIX nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES)
# The nlohmann-json3 package expects "#include <nlohmann/json.hpp>"
# Citra uses "#include <json.hpp>" so we have to add this manually
target_include_directories(json-headers SYSTEM INTERFACE "${NLOHMANN_PREFIX}/nlohmann")
else()
target_include_directories(json-headers SYSTEM INTERFACE ./json)
endif()

# OpenSSL
if (USE_SYSTEM_OPENSSL)
Expand All @@ -200,8 +209,13 @@ endif()
# httplib
add_library(httplib INTERFACE)
if(USE_SYSTEM_CPP_HTTPLIB)
find_package(CppHttp REQUIRED)
target_link_libraries(httplib SYSTEM INTERFACE cpp-httplib::cpp-httplib)
find_package(CppHttp 0.14.1)
if(CppHttp_FOUND)
target_link_libraries(httplib SYSTEM INTERFACE cpp-httplib::cpp-httplib)
else()
message(STATUS "Cpp-httplib not found or not suitable version! Falling back to bundled...")
target_include_directories(httplib SYSTEM INTERFACE ./httplib)
endif()
else()
target_include_directories(httplib SYSTEM INTERFACE ./httplib)
endif()
Expand Down
10 changes: 2 additions & 8 deletions externals/cmake-modules/FindCppHttp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@ if(NOT CppHttp_FOUND)
/usr/lib
/usr/local/lib
)

if(CPP-HTTP_INCLUDE_DIR AND CPP-HTTP_LIBRARIES)
set(CppHttp_FOUND TRUE CACHE INTERNAL "cpp-httplib found")
message(STATUS "Found cpp-httplib: ${CPP-HTTP_INCLUDE_DIR}, ${CPP-HTTP_LIBRARIES}")
else()
set(CppHttp_FOUND FALSE CACHE INTERNAL "cpp-httplib found")
message(STATUS "Cpp-httplib not found.")
endif()

find_package_handle_standard_args(CppHttp REQUIRED_VARS CPP-HTTP_INCLUDE_DIR CPP-HTTP_LIBRARIES VERSION_VAR HTTP_TMP_VERSION)

endif()

Expand Down
8 changes: 0 additions & 8 deletions src/video_core/shader/generator/glsl_shader_decompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,21 +828,13 @@ class GLSLGenerator {

void Generate() {
if (sanitize_mul) {
#ifdef ANDROID
// Use a cheaper sanitize_mul on Android, as mobile GPUs struggle here
// This seems to be sufficient at least for Ocarina of Time and Attack on Titan accurate
// multiplication bugs
shader.AddLine(
"#define sanitize_mul(lhs, rhs) mix(lhs * rhs, vec4(0.0), isnan(lhs * rhs))");
#else
shader.AddLine("vec4 sanitize_mul(vec4 lhs, vec4 rhs) {{");
++shader.scope;
shader.AddLine("vec4 product = lhs * rhs;");
shader.AddLine("return mix(product, mix(mix(vec4(0.0), product, isnan(rhs)), product, "
"isnan(lhs)), isnan(product));");
--shader.scope;
shader.AddLine("}}\n");
#endif
}

shader.AddLine("vec4 get_offset_register(int base_index, int offset) {{");
Expand Down

0 comments on commit 8260d55

Please sign in to comment.