Compare commits
2 Commits
static-lin
...
android6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
133fa00d73 | ||
|
|
ed39ec4738 |
@@ -125,16 +125,14 @@ if (YUZU_STATIC_BUILD)
|
|||||||
set(Boost_USE_STATIC_LIBS ON)
|
set(Boost_USE_STATIC_LIBS ON)
|
||||||
set(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
|
||||||
if (NOT PLATFORM_LINUX)
|
## find .a libs first (static, usually)
|
||||||
## find .a libs first (static, usually)
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
|
||||||
|
|
||||||
## some libraries define a Library::Name_static alternative ##
|
## some libraries define a Library::Name_static alternative ##
|
||||||
set(YUZU_STATIC_SUFFIX _static)
|
set(YUZU_STATIC_SUFFIX _static)
|
||||||
|
|
||||||
## some libraries use CMAKE_IMPORT_LIBRARY_SUFFIX e.g. Harfbuzz ##
|
## some libraries use CMAKE_IMPORT_LIBRARY_SUFFIX e.g. Harfbuzz ##
|
||||||
set(CMAKE_IMPORT_LIBRARY_SUFFIX ".a")
|
set(CMAKE_IMPORT_LIBRARY_SUFFIX ".a")
|
||||||
endif()
|
|
||||||
|
|
||||||
if (MINGW)
|
if (MINGW)
|
||||||
# simple hook to reject dynamic libs
|
# simple hook to reject dynamic libs
|
||||||
@@ -177,15 +175,6 @@ if (YUZU_STATIC_BUILD)
|
|||||||
set(SPIRV-Tools_FORCE_BUNDLED ON)
|
set(SPIRV-Tools_FORCE_BUNDLED ON)
|
||||||
set(SPIRV-Headers_FORCE_BUNDLED ON)
|
set(SPIRV-Headers_FORCE_BUNDLED ON)
|
||||||
set(zstd_FORCE_BUNDLED ON)
|
set(zstd_FORCE_BUNDLED ON)
|
||||||
elseif(PLATFORM_LINUX)
|
|
||||||
# Most distros don't package static libs :(
|
|
||||||
set(YUZU_USE_CPM ON)
|
|
||||||
set(CPMUTIL_FORCE_BUNDLED ON)
|
|
||||||
|
|
||||||
set(YUZU_USE_BUNDLED_FFMPEG ON)
|
|
||||||
set(YUZU_USE_BUNDLED_SDL2 ON)
|
|
||||||
set(YUZU_USE_BUNDLED_OPENSSL ON)
|
|
||||||
set(YUZU_USE_BUNDLED_SIRIT ON)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -813,16 +802,6 @@ if (YUZU_TESTS OR DYNARMIC_TESTS)
|
|||||||
find_package(Catch2)
|
find_package(Catch2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Qt expects this target
|
|
||||||
if (YUZU_STATIC_BUILD AND PLATFORM_LINUX)
|
|
||||||
get_target_property(RDOC_TARGET RenderDoc::API ALIASED_TARGET)
|
|
||||||
if (RDOC_TARGET)
|
|
||||||
add_library(RenderDoc::RenderDoc ALIAS ${RDOC_TARGET})
|
|
||||||
else()
|
|
||||||
add_library(RenderDoc::RenderDoc ALIAS RenderDoc::API)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (ENABLE_QT)
|
if (ENABLE_QT)
|
||||||
if (YUZU_USE_BUNDLED_QT)
|
if (YUZU_USE_BUNDLED_QT)
|
||||||
download_qt(6.8.3)
|
download_qt(6.8.3)
|
||||||
|
|||||||
@@ -16,15 +16,13 @@ function(static_qt_link target)
|
|||||||
# NB: yes, we have to put them here twice. I have no idea why
|
# NB: yes, we have to put them here twice. I have no idea why
|
||||||
|
|
||||||
# libtiff.a
|
# libtiff.a
|
||||||
if (MINGW)
|
extra_libs(tiff jbig bz2 lzma deflate jpeg tiff)
|
||||||
extra_libs(tiff jbig bz2 lzma deflate jpeg tiff)
|
|
||||||
|
|
||||||
# libfreetype.a
|
# libfreetype.a
|
||||||
extra_libs(freetype bz2 Lerc brotlidec brotlicommon freetype)
|
extra_libs(freetype bz2 Lerc brotlidec brotlicommon freetype)
|
||||||
|
|
||||||
# libharfbuzz.a
|
# libharfbuzz.a
|
||||||
extra_libs(harfbuzz graphite2)
|
extra_libs(harfbuzz graphite2)
|
||||||
endif()
|
|
||||||
|
|
||||||
# sijfjkfnjkdfjsbjsbsdfhvbdf
|
# sijfjkfnjkdfjsbjsbsdfhvbdf
|
||||||
if (ENABLE_OPENSSL)
|
if (ENABLE_OPENSSL)
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ else()
|
|||||||
add_compile_definitions(QT_STATICPLUGIN)
|
add_compile_definitions(QT_STATICPLUGIN)
|
||||||
|
|
||||||
# macos doesn't even let you make static executables... wtf?
|
# macos doesn't even let you make static executables... wtf?
|
||||||
if (NOT APPLE AND NOT PLATFORM_LINUX)
|
if (NOT APPLE)
|
||||||
add_compile_options(-static)
|
add_compile_options(-static)
|
||||||
if (YUZU_STATIC_BUILD)
|
if (YUZU_STATIC_BUILD)
|
||||||
# yuzu-cmd requires us to explicitly link libpthread, libgcc, and libstdc++ as static
|
# yuzu-cmd requires us to explicitly link libpthread, libgcc, and libstdc++ as static
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "dev.eden.eden_emulator"
|
applicationId = "dev.eden.eden_emulator"
|
||||||
minSdk = 24
|
minSdk = 23
|
||||||
targetSdk = 36
|
targetSdk = 36
|
||||||
versionName = getGitVersion()
|
versionName = getGitVersion()
|
||||||
versionCode = autoVersion
|
versionCode = autoVersion
|
||||||
|
|||||||
@@ -62,29 +62,41 @@ struct DrawParams {
|
|||||||
VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t index, float scale) {
|
VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t index, float scale) {
|
||||||
const auto& src = regs.viewport_transform[index];
|
const auto& src = regs.viewport_transform[index];
|
||||||
const auto conv = [scale](float value) {
|
const auto conv = [scale](float value) {
|
||||||
float const new_value = value * scale;
|
float new_value = value * scale;
|
||||||
return scale < 1.0f
|
if (scale < 1.0f) {
|
||||||
? std::round(std::abs(new_value)) * (std::signbit(new_value) ? -1.f : 1.f)
|
const bool sign = std::signbit(value);
|
||||||
: new_value;
|
new_value = std::round(std::abs(new_value));
|
||||||
|
new_value = sign ? -new_value : new_value;
|
||||||
|
}
|
||||||
|
return new_value;
|
||||||
};
|
};
|
||||||
float const w = src.scale_x;
|
const float x = conv(src.translate_x - src.scale_x);
|
||||||
float h = src.scale_y;
|
const float width = conv(src.scale_x * 2.0f);
|
||||||
if (regs.window_origin.mode == Maxwell::WindowOrigin::Mode::LowerLeft) // Flip by surface clip height
|
float y = conv(src.translate_y - src.scale_y);
|
||||||
h = -h;
|
float height = conv(src.scale_y * 2.0f);
|
||||||
if (!device.IsNvViewportSwizzleSupported() && src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY) // Flip by viewport height
|
|
||||||
h = -h;
|
const bool lower_left = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft;
|
||||||
// In theory, a raster flip is equivalent to a texture flip for a whole square viewport
|
const bool y_negate = !device.IsNvViewportSwizzleSupported() &&
|
||||||
// TODO: one day implement this properly and raster flip the triangles, not the whole viewport... guh
|
src.swizzle.y == Maxwell::ViewportSwizzle::NegativeY;
|
||||||
if(regs.viewport_transform[1].scale_y == 0 && regs.window_origin.flip_y != 0)
|
|
||||||
h = -h;
|
if (lower_left) {
|
||||||
float const x = src.translate_x - w;
|
// Flip by surface clip height
|
||||||
float const y = src.translate_y - h;
|
y += conv(static_cast<f32>(regs.surface_clip.height));
|
||||||
float const reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne ? 1.0f : 0.0f;
|
height = -height;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (y_negate) {
|
||||||
|
// Flip by viewport height
|
||||||
|
y += height;
|
||||||
|
height = -height;
|
||||||
|
}
|
||||||
|
|
||||||
|
const float reduce_z = regs.depth_mode == Maxwell::DepthMode::MinusOneToOne ? 1.0f : 0.0f;
|
||||||
VkViewport viewport{
|
VkViewport viewport{
|
||||||
.x = conv(x),
|
.x = x,
|
||||||
.y = conv(y),
|
.y = y,
|
||||||
.width = w != 0.0f ? conv(w * 2.f) : 1.0f,
|
.width = width != 0.0f ? width : 1.0f,
|
||||||
.height = h != 0.0f ? conv(h * 2.f) : 1.0f,
|
.height = height != 0.0f ? height : 1.0f,
|
||||||
.minDepth = src.translate_z - src.scale_z * reduce_z,
|
.minDepth = src.translate_z - src.scale_z * reduce_z,
|
||||||
.maxDepth = src.translate_z + src.scale_z,
|
.maxDepth = src.translate_z + src.scale_z,
|
||||||
};
|
};
|
||||||
@@ -1014,10 +1026,10 @@ void RasterizerVulkan::UpdateViewportsState(Tegra::Engines::Maxwell3D::Regs& reg
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!regs.viewport_scale_offset_enabled) {
|
if (!regs.viewport_scale_offset_enabled) {
|
||||||
float x = float(regs.surface_clip.x);
|
float x = static_cast<float>(regs.surface_clip.x);
|
||||||
float y = float(regs.surface_clip.y);
|
float y = static_cast<float>(regs.surface_clip.y);
|
||||||
float width = (std::max)(1.0f, float(regs.surface_clip.width));
|
float width = (std::max)(1.0f, static_cast<float>(regs.surface_clip.width));
|
||||||
float height = (std::max)(1.0f, float(regs.surface_clip.height));
|
float height = (std::max)(1.0f, static_cast<float>(regs.surface_clip.height));
|
||||||
if (regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft) {
|
if (regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft) {
|
||||||
y += height;
|
y += height;
|
||||||
height = -height;
|
height = -height;
|
||||||
|
|||||||
Reference in New Issue
Block a user