mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-04-26 13:05:34 -06:00
Merge branch 'cemu-project:main' into feat/gfxpack-url
This commit is contained in:
commit
736ce1f44c
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -230,7 +230,7 @@ jobs:
|
||||
- name: "Install system dependencies"
|
||||
run: |
|
||||
brew update
|
||||
brew install ninja nasm automake libtool
|
||||
brew install nasm automake libtool
|
||||
|
||||
- name: "Install molten-vk"
|
||||
run: |
|
||||
|
||||
@ -79,6 +79,8 @@ if(WIN32)
|
||||
)
|
||||
endif()
|
||||
|
||||
string(TIMESTAMP CURRENT_YEAR "%Y" UTC)
|
||||
|
||||
set_property(TARGET CemuBin PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
set_property(TARGET CemuBin PROPERTY WIN32_EXECUTABLE $<NOT:$<CONFIG:Debug>>)
|
||||
set(OUTPUT_NAME "Cemu_$<LOWER_CASE:$<CONFIG>>")
|
||||
@ -94,7 +96,7 @@ if (MACOS_BUNDLE)
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME "Cemu")
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${EMULATOR_VERSION_MAJOR}.${EMULATOR_VERSION_MINOR}.${EMULATOR_VERSION_PATCH}")
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION "${EMULATOR_VERSION_MAJOR}.${EMULATOR_VERSION_MINOR}.${EMULATOR_VERSION_PATCH}")
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2024 Cemu Project")
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © ${CURRENT_YEAR} Cemu Project")
|
||||
|
||||
set(MACOSX_BUNDLE_CATEGORY "public.app-category.games")
|
||||
set(MACOSX_MINIMUM_SYSTEM_VERSION "13.4")
|
||||
|
||||
@ -539,7 +539,23 @@ namespace CafeSystem
|
||||
else
|
||||
platform = "Linux";
|
||||
#elif BOOST_OS_MACOS
|
||||
platform = "MacOS";
|
||||
char productVersion[256]{};
|
||||
size_t productVersionSize = sizeof(productVersion);
|
||||
const int productVersionResult = sysctlbyname("kern.osproductversion", productVersion, &productVersionSize, nullptr, 0);
|
||||
|
||||
char buildVersion[256]{};
|
||||
size_t buildVersionSize = sizeof(buildVersion);
|
||||
const int buildVersionResult = sysctlbyname("kern.osversion", buildVersion, &buildVersionSize, nullptr, 0);
|
||||
|
||||
if (productVersionResult == 0 && buildVersionResult == 0)
|
||||
buffer = fmt::format("macOS {} ({})", productVersion, buildVersion);
|
||||
else if (productVersionResult == 0)
|
||||
buffer = fmt::format("macOS {}", productVersion);
|
||||
else
|
||||
buffer = "macOS";
|
||||
|
||||
platform = buffer.c_str();
|
||||
|
||||
#elif BOOST_OS_BSD
|
||||
#if defined(__FreeBSD__)
|
||||
platform = "FreeBSD";
|
||||
|
||||
@ -146,6 +146,14 @@ RendererShaderGL::RendererShaderGL(ShaderType type, uint64 baseHash, uint64 auxH
|
||||
}
|
||||
|
||||
RendererShaderGL::~RendererShaderGL()
|
||||
{
|
||||
CleanupShaderObj();
|
||||
|
||||
if (m_program != 0)
|
||||
glDeleteProgram(m_program);
|
||||
}
|
||||
|
||||
void RendererShaderGL::CleanupShaderObj()
|
||||
{
|
||||
if (m_shader_object != 0 && m_shader_attached)
|
||||
glDetachShader(m_program, m_shader_object);
|
||||
@ -153,8 +161,7 @@ RendererShaderGL::~RendererShaderGL()
|
||||
if (m_shader_object != 0)
|
||||
glDeleteShader(m_shader_object);
|
||||
|
||||
if (m_program != 0)
|
||||
glDeleteProgram(m_program);
|
||||
m_shader_object = 0;
|
||||
}
|
||||
|
||||
void RendererShaderGL::PreponeCompilation(bool isRenderThread)
|
||||
@ -192,9 +199,8 @@ bool RendererShaderGL::WaitForCompiled()
|
||||
cemuLog_log(LogType::Force, "Compile error in shader. Log:");
|
||||
cemuLog_log(LogType::Force, infoLog);
|
||||
}
|
||||
if (m_shader_object != 0)
|
||||
glDeleteShader(m_shader_object);
|
||||
m_isCompiled = true;
|
||||
CleanupShaderObj();
|
||||
return false;
|
||||
}
|
||||
// get shader binary
|
||||
@ -213,12 +219,12 @@ bool RendererShaderGL::WaitForCompiled()
|
||||
cemuLog_log(LogType::Force, infoLog);
|
||||
}
|
||||
m_isCompiled = true;
|
||||
CleanupShaderObj();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*glDetachShader(m_program, m_shader_object);
|
||||
m_shader_attached = false;*/
|
||||
m_isCompiled = true;
|
||||
CleanupShaderObj();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ public:
|
||||
|
||||
virtual ~RendererShaderGL();
|
||||
|
||||
void CleanupShaderObj();
|
||||
void PreponeCompilation(bool isRenderThread) override;
|
||||
bool IsCompiled() override;
|
||||
bool WaitForCompiled() override;
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
#include "cpu_features.h"
|
||||
|
||||
#if BOOST_OS_MACOS
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
// wrappers with uniform prototype for implementation-specific x86 CPU id
|
||||
#if defined(ARCH_X86_64)
|
||||
#ifdef __GNUC__
|
||||
@ -30,7 +35,23 @@ inline void cpuidex(int cpuInfo[4], int functionId, int subFunctionId) {
|
||||
|
||||
CPUFeaturesImpl::CPUFeaturesImpl()
|
||||
{
|
||||
#if defined(ARCH_X86_64)
|
||||
#if BOOST_OS_MACOS
|
||||
std::string cpuName;
|
||||
size_t size = 0;
|
||||
|
||||
if (sysctlbyname("machdep.cpu.brand_string", nullptr, &size, nullptr, 0) == 0 && size > 0)
|
||||
{
|
||||
std::vector<char> buffer(size);
|
||||
|
||||
if (sysctlbyname("machdep.cpu.brand_string", buffer.data(), &size, nullptr, 0) == 0 && size > 0)
|
||||
{
|
||||
cpuName.assign(buffer.data());
|
||||
}
|
||||
}
|
||||
|
||||
strncpy(m_cpuBrandName, cpuName.c_str(), sizeof(m_cpuBrandName) - 1);
|
||||
m_cpuBrandName[sizeof(m_cpuBrandName) - 1] = '\0';
|
||||
#elif defined(ARCH_X86_64)
|
||||
int cpuInfo[4];
|
||||
cpuid(cpuInfo, 0x80000001);
|
||||
x86.lzcnt = ((cpuInfo[2] >> 5) & 1) != 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user