Remove libretro core - core will now be maintained by libretro

libretro have agreed to take over maintenance of the core.

Please see their fork at https://github.com/libretro/duckstation if you
wish to continue to use it.
This commit is contained in:
Connor McLaughlin
2021-01-08 01:11:19 +10:00
parent 573c8370d7
commit 419726f4cc
42 changed files with 108 additions and 8065 deletions

View File

@ -1,19 +1,13 @@
if(BUILD_LIBRETRO_CORE)
add_definitions("-DLIBRETRO=1")
endif()
add_subdirectory(common)
add_subdirectory(core)
add_subdirectory(scmversion)
if(NOT BUILD_LIBRETRO_CORE)
add_subdirectory(common-tests)
if(WIN32)
add_subdirectory(updater)
endif()
add_subdirectory(common-tests)
if(WIN32)
add_subdirectory(updater)
endif()
if(ANDROID OR BUILD_SDL_FRONTEND OR BUILD_QT_FRONTEND OR BUILD_LIBRETRO_CORE)
if(ANDROID OR BUILD_SDL_FRONTEND OR BUILD_QT_FRONTEND)
add_subdirectory(frontend-common)
endif()
@ -24,8 +18,3 @@ endif()
if(BUILD_QT_FRONTEND)
add_subdirectory(duckstation-qt)
endif()
if(BUILD_LIBRETRO_CORE)
add_subdirectory(duckstation-libretro)
endif()

View File

@ -179,9 +179,6 @@ endif()
if(APPLE)
# Needed for Vulkan Swap Chain.
target_link_libraries(common PRIVATE "objc")
endif()
if(APPLE AND NOT BUILD_LIBRETRO_CORE)
target_sources(common PRIVATE
gl/context_agl.mm
gl/context_agl.h

View File

@ -11,7 +11,7 @@ Log_SetChannel(GL::Context);
#if defined(WIN32) && !defined(_M_ARM64)
#include "context_wgl.h"
#elif defined(__APPLE__) && !defined(LIBERTRO)
#elif defined(__APPLE__)
#include "context_agl.h"
#endif
@ -77,7 +77,7 @@ std::unique_ptr<GL::Context> Context::Create(const WindowInfo& wi, const Version
std::unique_ptr<Context> context;
#if defined(WIN32) && !defined(_M_ARM64)
context = ContextWGL::Create(wi, versions_to_try, num_versions_to_try);
#elif defined(__APPLE__) && !defined(LIBRETRO)
#elif defined(__APPLE__)
context = ContextAGL::Create(wi, versions_to_try, num_versions_to_try);
#elif defined(ANDROID)
#ifdef USE_EGL

View File

@ -124,9 +124,7 @@ bool InitializeGlslang()
return false;
}
#ifndef LIBRETRO
std::atexit([]() { glslang::FinalizeProcess(); });
#endif
glslang_initialized = true;
return true;

View File

@ -12,7 +12,6 @@ struct WindowInfo
Wayland,
MacOS,
Android,
Libretro,
};
enum class SurfaceFormat

View File

@ -116,6 +116,9 @@ target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_link_libraries(core PUBLIC Threads::Threads common zlib vulkan-loader)
target_link_libraries(core PRIVATE glad stb xxhash)
target_compile_definitions(core PRIVATE "WITH_IMGUI=1")
target_link_libraries(core PRIVATE imgui)
if(WIN32)
target_sources(core PRIVATE
gpu_hw_d3d11.cpp
@ -148,8 +151,3 @@ elseif(${CPU_ARCH} STREQUAL "aarch64")
else()
message("Not building recompiler")
endif()
if(NOT BUILD_LIBRETRO_CORE)
target_link_libraries(core PRIVATE imgui)
target_compile_definitions(core PRIVATE "WITH_IMGUI=1")
endif()

View File

@ -1,44 +0,0 @@
add_library(duckstation_libretro SHARED
libretro_audio_stream.cpp
libretro_audio_stream.h
libretro_game_settings.cpp
libretro_game_settings.h
libretro_host_display.cpp
libretro_host_display.h
libretro_host_interface.cpp
libretro_host_interface.h
libretro_opengl_host_display.cpp
libretro_opengl_host_display.h
libretro_settings_interface.cpp
libretro_settings_interface.h
libretro_vulkan_host_display.cpp
libretro_vulkan_host_display.h
main.cpp
)
if(WIN32)
target_sources(duckstation_libretro PRIVATE
libretro_d3d11_host_display.cpp
libretro_d3d11_host_display.h
)
endif()
target_link_libraries(duckstation_libretro PRIVATE core common glad scmversion frontend-common vulkan-loader libretro-common)
# no lib prefix
set_target_properties(duckstation_libretro PROPERTIES PREFIX "")
# drop in the build directory
set_target_properties(duckstation_libretro PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set_target_properties(duckstation_libretro PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
# work around .sln issue of hardcoded config directories
if(WIN32)
set_target_properties(duckstation_libretro PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}")
set_target_properties(duckstation_libretro PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}")
endif()
# for android, suffix _android
if(ANDROID)
set_target_properties(duckstation_libretro PROPERTIES OUTPUT_NAME "duckstation_libretro_android")
endif()

View File

@ -1,582 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugFast|ARM64">
<Configuration>DebugFast</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugFast|Win32">
<Configuration>DebugFast</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugFast|x64">
<Configuration>DebugFast</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseLTCG|ARM64">
<Configuration>ReleaseLTCG</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseLTCG|Win32">
<Configuration>ReleaseLTCG</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseLTCG|x64">
<Configuration>ReleaseLTCG</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\dep\vulkan-loader\vulkan-loader.vcxproj">
<Project>{9c8ddeb0-2b8f-4f5f-ba86-127cdf27f035}</Project>
</ProjectReference>
<ProjectReference Include="..\common\common.vcxproj">
<Project>{ee054e08-3799-4a59-a422-18259c105ffd}</Project>
</ProjectReference>
<ProjectReference Include="..\core\core.vcxproj">
<Project>{868b98c8-65a1-494b-8346-250a73a48c0a}</Project>
</ProjectReference>
<ProjectReference Include="..\frontend-common\frontend-common.vcxproj">
<Project>{6245dec8-d2da-47ee-a373-cbd6fcf3ece6}</Project>
</ProjectReference>
<ProjectReference Include="..\scmversion\scmversion.vcxproj">
<Project>{075ced82-6a20-46df-94c7-9624ac9ddbeb}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="libretro_d3d11_host_display.cpp" />
<ClCompile Include="libretro_audio_stream.cpp" />
<ClCompile Include="libretro_game_settings.cpp" />
<ClCompile Include="libretro_host_display.cpp" />
<ClCompile Include="libretro_host_interface.cpp" />
<ClCompile Include="libretro_settings_interface.cpp" />
<ClCompile Include="libretro_vulkan_host_display.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="libretro_opengl_host_display.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="libretro_d3d11_host_display.h" />
<ClInclude Include="libretro_audio_stream.h" />
<ClInclude Include="libretro_game_settings.h" />
<ClInclude Include="libretro_host_display.h" />
<ClInclude Include="libretro_host_interface.h" />
<ClInclude Include="libretro_settings_interface.h" />
<ClInclude Include="libretro_opengl_host_display.h" />
<ClInclude Include="libretro_vulkan_host_display.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9D206548-DE8F-4D9D-A561-C7E5CD7A20DF}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>duckstation-libretro</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
<SpectreMitigation>false</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
<SpectreMitigation>false</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
<SpectreMitigation>false</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
<SpectreMitigation>false</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
<SpectreMitigation>false</SpectreMitigation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
<SpectreMitigation>false</SpectreMitigation>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|ARM64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|x64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|ARM64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
<SupportJustMyCode>false</SupportJustMyCode>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
<SupportJustMyCode>false</SupportJustMyCode>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|ARM64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
<SupportJustMyCode>false</SupportJustMyCode>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<OmitFramePointers>true</OmitFramePointers>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<OmitFramePointers>true</OmitFramePointers>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|ARM64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)dep\imgui\include;$(SolutionDir)dep\glad\include;$(SolutionDir)dep\vulkan-loader\include;$(SolutionDir)dep\libretro-common\include;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<OmitFramePointers>true</OmitFramePointers>
<ConformanceMode>true</ConformanceMode>
<AdditionalOptions>/Zo /utf-8 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="libretro_host_interface.cpp" />
<ClCompile Include="libretro_audio_stream.cpp" />
<ClCompile Include="libretro_host_display.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="libretro_settings_interface.cpp" />
<ClCompile Include="libretro_opengl_host_display.cpp" />
<ClCompile Include="libretro_d3d11_host_display.cpp" />
<ClCompile Include="libretro_vulkan_host_display.cpp" />
<ClCompile Include="libretro_game_settings.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="libretro_host_interface.h" />
<ClInclude Include="libretro_audio_stream.h" />
<ClInclude Include="libretro_host_display.h" />
<ClInclude Include="libretro_settings_interface.h" />
<ClInclude Include="libretro_opengl_host_display.h" />
<ClInclude Include="libretro_d3d11_host_display.h" />
<ClInclude Include="libretro_vulkan_host_display.h" />
<ClInclude Include="libretro_game_settings.h" />
</ItemGroup>
</Project>

View File

@ -1,23 +0,0 @@
#include "libretro_audio_stream.h"
#include "libretro_host_interface.h"
LibretroAudioStream::LibretroAudioStream() = default;
LibretroAudioStream::~LibretroAudioStream() = default;
bool LibretroAudioStream::OpenDevice()
{
m_output_buffer.resize(m_buffer_size * m_channels);
return true;
}
void LibretroAudioStream::PauseDevice(bool paused) {}
void LibretroAudioStream::CloseDevice() {}
void LibretroAudioStream::FramesAvailable()
{
const u32 num_frames = GetSamplesAvailable();
ReadFrames(m_output_buffer.data(), num_frames, false);
g_retro_audio_sample_batch_callback(m_output_buffer.data(), num_frames);
}

View File

@ -1,21 +0,0 @@
#pragma once
#include "common/audio_stream.h"
#include <cstdint>
#include <vector>
class LibretroAudioStream final : public AudioStream
{
public:
LibretroAudioStream();
~LibretroAudioStream();
protected:
bool OpenDevice() override;
void PauseDevice(bool paused) override;
void CloseDevice() override;
void FramesAvailable() override;
private:
// TODO: Optimize this buffer away.
std::vector<SampleType> m_output_buffer;
};

View File

@ -1,144 +0,0 @@
#include "libretro_d3d11_host_display.h"
#include "common/align.h"
#include "common/assert.h"
#include "common/d3d11/shader_compiler.h"
#include "common/log.h"
#include "libretro_host_interface.h"
Log_SetChannel(LibretroD3D11HostDisplay);
#define HAVE_D3D11
#include "libretro_d3d.h"
LibretroD3D11HostDisplay::LibretroD3D11HostDisplay() = default;
LibretroD3D11HostDisplay::~LibretroD3D11HostDisplay() = default;
void LibretroD3D11HostDisplay::SetVSync(bool enabled)
{
// The libretro frontend controls this.
Log_DevPrintf("Ignoring SetVSync(%u)", BoolToUInt32(enabled));
}
bool LibretroD3D11HostDisplay::RequestHardwareRendererContext(retro_hw_render_callback* cb)
{
cb->cache_context = false;
cb->bottom_left_origin = false;
cb->context_type = RETRO_HW_CONTEXT_DIRECT3D;
cb->version_major = 11;
cb->version_minor = 0;
return g_retro_environment_callback(RETRO_ENVIRONMENT_SET_HW_RENDER, cb);
}
bool LibretroD3D11HostDisplay::CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name,
bool debug_device, bool threaded_presentation)
{
retro_hw_render_interface* ri = nullptr;
if (!g_retro_environment_callback(RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE, &ri))
{
Log_ErrorPrint("Failed to get HW render interface");
return false;
}
else if (ri->interface_type != RETRO_HW_RENDER_INTERFACE_D3D11 ||
ri->interface_version != RETRO_HW_RENDER_INTERFACE_D3D11_VERSION)
{
Log_ErrorPrintf("Unexpected HW interface - type %u version %u", static_cast<unsigned>(ri->interface_type),
static_cast<unsigned>(ri->interface_version));
return false;
}
const retro_hw_render_interface_d3d11* d3d11_ri = reinterpret_cast<const retro_hw_render_interface_d3d11*>(ri);
if (!d3d11_ri->device || !d3d11_ri->context)
{
Log_ErrorPrintf("Missing D3D device or context");
return false;
}
m_device = d3d11_ri->device;
m_context = d3d11_ri->context;
return true;
}
void LibretroD3D11HostDisplay::DestroyResources()
{
D3D11HostDisplay::DestroyResources();
m_framebuffer.Destroy();
}
void LibretroD3D11HostDisplay::ResizeRenderWindow(s32 new_window_width, s32 new_window_height)
{
m_window_info.surface_width = static_cast<u32>(new_window_width);
m_window_info.surface_height = static_cast<u32>(new_window_height);
}
bool LibretroD3D11HostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
{
// Check that the device hasn't changed.
retro_hw_render_interface* ri = nullptr;
if (!g_retro_environment_callback(RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE, &ri))
{
Log_ErrorPrint("Failed to get HW render interface");
return false;
}
else if (ri->interface_type != RETRO_HW_RENDER_INTERFACE_D3D11 ||
ri->interface_version != RETRO_HW_RENDER_INTERFACE_D3D11_VERSION)
{
Log_ErrorPrintf("Unexpected HW interface - type %u version %u", static_cast<unsigned>(ri->interface_type),
static_cast<unsigned>(ri->interface_version));
return false;
}
const retro_hw_render_interface_d3d11* d3d11_ri = reinterpret_cast<const retro_hw_render_interface_d3d11*>(ri);
if (d3d11_ri->device != m_device.Get() || d3d11_ri->context != m_context.Get())
{
Log_ErrorPrintf("D3D device/context changed outside our control");
return false;
}
m_window_info = new_wi;
return true;
}
bool LibretroD3D11HostDisplay::Render()
{
const u32 resolution_scale = g_libretro_host_interface.GetResolutionScale();
const u32 display_width = static_cast<u32>(m_display_width) * resolution_scale;
const u32 display_height = static_cast<u32>(m_display_height) * resolution_scale;
if (!CheckFramebufferSize(display_width, display_height))
return false;
// Ensure we're not currently bound.
ID3D11ShaderResourceView* null_srv = nullptr;
m_context->PSSetShaderResources(0, 1, &null_srv);
m_context->OMSetRenderTargets(1u, m_framebuffer.GetD3DRTVArray(), nullptr);
if (HasDisplayTexture())
{
const auto [left, top, width, height] = CalculateDrawRect(display_width, display_height, 0, false);
RenderDisplay(left, top, width, height, m_display_texture_handle, m_display_texture_width, m_display_texture_height,
m_display_texture_view_x, m_display_texture_view_y, m_display_texture_view_width,
m_display_texture_view_height, m_display_linear_filtering);
}
if (HasSoftwareCursor())
{
// TODO: Scale mouse x/y
const auto [left, top, width, height] = CalculateSoftwareCursorDrawRect(m_mouse_position_x, m_mouse_position_y);
RenderSoftwareCursor(left, top, width, height, m_cursor_texture.get());
}
// NOTE: libretro frontend expects the data bound to PS SRV slot 0.
m_context->OMSetRenderTargets(0, nullptr, nullptr);
m_context->PSSetShaderResources(0, 1, m_framebuffer.GetD3DSRVArray());
g_retro_video_refresh_callback(RETRO_HW_FRAME_BUFFER_VALID, display_width, display_height, 0);
return true;
}
bool LibretroD3D11HostDisplay::CheckFramebufferSize(u32 width, u32 height)
{
if (m_framebuffer.GetWidth() == width && m_framebuffer.GetHeight() == height)
return true;
return m_framebuffer.Create(m_device.Get(), width, height, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM,
D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET);
}

View File

@ -1,31 +0,0 @@
#pragma once
#include "common/d3d11/texture.h"
#include "frontend-common/d3d11_host_display.h"
#include "libretro.h"
class LibretroD3D11HostDisplay final : public FrontendCommon::D3D11HostDisplay
{
public:
LibretroD3D11HostDisplay();
~LibretroD3D11HostDisplay();
static bool RequestHardwareRendererContext(retro_hw_render_callback* cb);
bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
bool threaded_presentation) override;
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
bool ChangeRenderWindow(const WindowInfo& new_wi) override;
void SetVSync(bool enabled) override;
bool Render() override;
protected:
void DestroyResources() override;
private:
bool CheckFramebufferSize(u32 width, u32 height);
D3D11::Texture m_framebuffer;
};

View File

@ -1,639 +0,0 @@
#include "libretro_game_settings.h"
std::unique_ptr<GameSettings::Entry> GetSettingsForGame(const std::string& game_code)
{
std::unique_ptr<GameSettings::Entry> gs = std::make_unique<GameSettings::Entry>();
if (game_code == "SLUS-00530")
{
gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
return gs;
}
if (game_code == "SLUS-00634")
{
gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
return gs;
}
if (game_code == "SLUS-00077")
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLPM-87089")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLPS-03336")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-01260")
{
gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLES-01211")
{
gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-01261")
{
gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLES-02466")
{
gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLES-00259")
{
gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLES-00606")
{
gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-00639")
{
gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-90039")
{
gs->AddTrait(GameSettings::Trait::ForceSoftwareRenderer);
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-00337")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-00606")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLPS-03553")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLPS-01211")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-00656")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-00952")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-01222")
{
gs->display_active_start_offset = 64;
gs->display_active_end_offset = 68;
return gs;
}
if (game_code == "SLUS-00297")
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
gs->AddTrait(GameSettings::Trait::DisablePGXP);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SCUS-94350")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SCUS-94900")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "PCPX-96085")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00590")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00403")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SCUS-94300")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00214")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00204")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00006")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00213")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SCES-00344")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00355")
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00331")
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00106")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00005")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-01265")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00601")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLPS-00435")
{
gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
return gs;
}
if (game_code == "SLUS-00388")
{
gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
return gs;
}
if (game_code == "SCES-02834")
{
gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
return gs;
}
if (game_code == "SLUS-00870")
{
gs->AddTrait(GameSettings::Trait::ForceInterpreter);
return gs;
}
if (game_code == "SLUS-00183")
{
gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
return gs;
}
if (game_code == "SLES-00483")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLPS-02361")
{
gs->AddTrait(GameSettings::Trait::ForcePGXPVertexCache);
return gs;
}
if (game_code == "SLPM-86023")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00067")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLES-00524")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLPS-00712")
{
gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
return gs;
}
if (game_code == "SLPS-01434")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-00684")
{
gs->AddTrait(GameSettings::Trait::ForceInterpreter);
return gs;
}
if (game_code == "SLPS-02459")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLPM-86750")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLPS-02120")
{
gs->AddTrait(GameSettings::Trait::ForceInterlacing);
return gs;
}
if (game_code == "SLUS-00102")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00152")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00603")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00348")
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00042")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00561")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00035")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00057")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00014")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SCUS-94403")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00549")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00240")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00027")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00119")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00224")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00453")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00753")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00811")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00208")
{
gs->display_active_start_offset = -62;
gs->display_active_end_offset = 72;
return gs;
}
if (game_code == "SLPS-01762")
{
gs->AddTrait(GameSettings::Trait::DisablePGXPCulling);
return gs;
}
if (game_code == "SLPS-01567")
{
gs->display_active_start_offset = -62;
gs->display_active_end_offset = 51;
return gs;
}
if (game_code == "SLPS-00360")
{
gs->display_active_start_offset = -62;
gs->display_active_end_offset = 72;
return gs;
}
if (game_code == "SCES-02835")
{
gs->AddTrait(GameSettings::Trait::ForceInterpreter);
gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
return gs;
}
if (game_code == "SCES-02104")
{
gs->AddTrait(GameSettings::Trait::ForceInterpreter);
gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
return gs;
}
if (game_code == "SCES-01438")
{
gs->AddTrait(GameSettings::Trait::DisablePGXPCulling);
gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
return gs;
}
if (game_code == "SCUS-94467")
{
gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
return gs;
}
if (game_code == "SCUS-94425")
{
gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
return gs;
}
if (game_code == "SCPS-10085")
{
gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
return gs;
}
if (game_code == "SCUS-94228")
{
gs->AddTrait(GameSettings::Trait::DisablePGXPCulling);
gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
return gs;
}
if (game_code == "SCUS-94290")
{
gs->AddTrait(GameSettings::Trait::ForcePGXPCPUMode);
return gs;
}
if (game_code == "SLUS-01138")
{
gs->dma_max_slice_ticks = 200;
gs->gpu_max_run_ahead = 1;
return gs;
}
if (game_code == "SLPS-02376")
{
gs->dma_max_slice_ticks = 100;
gs->gpu_max_run_ahead = 1;
return gs;
}
if (game_code == "SLUS-00282")
{
gs->dma_max_slice_ticks = 200;
gs->gpu_max_run_ahead = 1;
return gs;
}
if (game_code == "SLUS-00022")
{
gs->AddTrait(GameSettings::Trait::DisableUpscaling);
return gs;
}
if (game_code == "SLUS-00292")
{
gs->AddTrait(GameSettings::Trait::ForceRecompilerICache);
return gs;
}
if (game_code == "SLUS-00522")
{
gs->dma_max_slice_ticks = 200;
return gs;
}
if (game_code == "SLES-00469")
{
gs->dma_max_slice_ticks = 100;
return gs;
}
if (game_code == "SLPS-01163")
{
gs->dma_max_slice_ticks = 100;
return gs;
}
if (game_code == "SLUS-00498")
{
gs->dma_max_slice_ticks = 100;
return gs;
}
if (game_code == "SLPS-00433")
{
gs->dma_max_slice_ticks = 100;
return gs;
}
if (game_code == "SLUS-01029")
{
gs->AddTrait(GameSettings::Trait::DisableAnalogModeForcing);
return gs;
}
if (game_code == "SLUS-00506")
{
gs->dma_max_slice_ticks = 100;
return gs;
}
if (game_code == "SLES-00704")
{
gs->dma_max_slice_ticks = 100;
return gs;
}
if (game_code == "SLPS-01399")
{
gs->dma_max_slice_ticks = 100;
return gs;
}
if (game_code == "SLUS-00232")
{
gs->dma_max_slice_ticks = 100;
return gs;
}
if (game_code == "SLES-00526")
{
gs->dma_max_slice_ticks = 100;
return gs;
}
if (game_code == "SLED-00570")
{
gs->dma_max_slice_ticks = 100;
return gs;
}
return {};
}

View File

@ -1,4 +0,0 @@
#include "frontend-common/game_settings.h"
#include <memory>
std::unique_ptr<GameSettings::Entry> GetSettingsForGame(const std::string& game_code);

View File

@ -1,233 +0,0 @@
#include "libretro_host_display.h"
#include "common/align.h"
#include "common/assert.h"
#include "common/log.h"
#include "libretro.h"
#include "libretro_host_interface.h"
#include <array>
#include <tuple>
Log_SetChannel(LibretroHostDisplay);
static retro_pixel_format GetRetroPixelFormat(HostDisplayPixelFormat format)
{
switch (format)
{
case HostDisplayPixelFormat::BGRA8:
return RETRO_PIXEL_FORMAT_XRGB8888;
case HostDisplayPixelFormat::RGB565:
return RETRO_PIXEL_FORMAT_RGB565;
case HostDisplayPixelFormat::RGBA5551:
return RETRO_PIXEL_FORMAT_0RGB1555;
default:
return RETRO_PIXEL_FORMAT_UNKNOWN;
}
}
LibretroHostDisplay::LibretroHostDisplay()
{
retro_pixel_format pf = RETRO_PIXEL_FORMAT_RGB565;
if (!g_retro_environment_callback(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &pf))
Log_ErrorPrint("Failed to set pixel format to RGB565");
else
m_current_pixel_format = pf;
}
LibretroHostDisplay::~LibretroHostDisplay() = default;
bool LibretroHostDisplay::CheckPixelFormat(retro_pixel_format new_format)
{
if (new_format == RETRO_PIXEL_FORMAT_UNKNOWN || m_current_pixel_format == new_format)
return true;
if (!g_retro_environment_callback(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &new_format))
{
Log_ErrorPrintf("g_retro_environment_callback(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, %u) failed",
static_cast<unsigned>(new_format));
return false;
}
if (!g_libretro_host_interface.UpdateSystemAVInfo(false))
return false;
m_current_pixel_format = new_format;
return true;
}
HostDisplay::RenderAPI LibretroHostDisplay::GetRenderAPI() const
{
return RenderAPI::None;
}
void* LibretroHostDisplay::GetRenderDevice() const
{
return nullptr;
}
void* LibretroHostDisplay::GetRenderContext() const
{
return nullptr;
}
bool LibretroHostDisplay::HasRenderDevice() const
{
return true;
}
bool LibretroHostDisplay::HasRenderSurface() const
{
return true;
}
bool LibretroHostDisplay::CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
bool threaded_presentation)
{
m_window_info = wi;
return true;
}
bool LibretroHostDisplay::InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device,
bool threaded_presentation)
{
return true;
}
bool LibretroHostDisplay::MakeRenderContextCurrent()
{
return true;
}
bool LibretroHostDisplay::DoneRenderContextCurrent()
{
return true;
}
void LibretroHostDisplay::DestroyRenderDevice() {}
void LibretroHostDisplay::DestroyRenderSurface() {}
bool LibretroHostDisplay::CreateResources()
{
return true;
}
void LibretroHostDisplay::DestroyResources() {}
bool LibretroHostDisplay::ChangeRenderWindow(const WindowInfo& wi)
{
m_window_info = wi;
return true;
}
void LibretroHostDisplay::ResizeRenderWindow(s32 new_window_width, s32 new_window_height)
{
m_window_info.surface_width = new_window_width;
m_window_info.surface_height = new_window_height;
}
bool LibretroHostDisplay::SupportsFullscreen() const
{
return false;
}
bool LibretroHostDisplay::IsFullscreen()
{
return false;
}
bool LibretroHostDisplay::SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate)
{
return false;
}
bool LibretroHostDisplay::SetPostProcessingChain(const std::string_view& config)
{
return false;
}
std::unique_ptr<HostDisplayTexture> LibretroHostDisplay::CreateTexture(u32 width, u32 height, const void* data,
u32 data_stride, bool dynamic)
{
return nullptr;
}
void LibretroHostDisplay::UpdateTexture(HostDisplayTexture* texture, u32 x, u32 y, u32 width, u32 height,
const void* data, u32 data_stride)
{
}
bool LibretroHostDisplay::DownloadTexture(const void* texture_handle, HostDisplayPixelFormat texture_format, u32 x,
u32 y, u32 width, u32 height, void* out_data, u32 out_data_stride)
{
return false;
}
bool LibretroHostDisplay::SupportsDisplayPixelFormat(HostDisplayPixelFormat format) const
{
// For when we can change the pixel format.
// return (GetRetroPixelFormat(format) != RETRO_PIXEL_FORMAT_UNKNOWN);
return (GetRetroPixelFormat(format) == m_current_pixel_format);
}
bool LibretroHostDisplay::BeginSetDisplayPixels(HostDisplayPixelFormat format, u32 width, u32 height, void** out_buffer,
u32* out_pitch)
{
const retro_pixel_format retro_pf = GetRetroPixelFormat(format);
if (!CheckPixelFormat(retro_pf))
return false;
m_software_fb.data = nullptr;
m_software_fb.width = width;
m_software_fb.height = height;
m_software_fb.pitch = 0;
m_software_fb.format = RETRO_PIXEL_FORMAT_UNKNOWN;
m_software_fb.access_flags = RETRO_MEMORY_ACCESS_WRITE;
m_software_fb.memory_flags = 0;
if (g_retro_environment_callback(RETRO_ENVIRONMENT_GET_CURRENT_SOFTWARE_FRAMEBUFFER, &m_software_fb) &&
m_software_fb.format == retro_pf)
{
SetDisplayTexture(m_software_fb.data, format, m_software_fb.width, m_software_fb.height, 0, 0, m_software_fb.width,
m_software_fb.height);
*out_buffer = m_software_fb.data;
*out_pitch = static_cast<u32>(m_software_fb.pitch);
return true;
}
const u32 pitch = Common::AlignUpPow2(width * GetDisplayPixelFormatSize(format), 4);
const u32 required_size = height * pitch;
if (m_frame_buffer.size() < (required_size / 4))
m_frame_buffer.resize(required_size / 4);
m_frame_buffer_pitch = pitch;
SetDisplayTexture(m_frame_buffer.data(), format, width, height, 0, 0, width, height);
*out_buffer = m_frame_buffer.data();
*out_pitch = pitch;
return true;
}
void LibretroHostDisplay::EndSetDisplayPixels()
{
// noop
}
void LibretroHostDisplay::SetVSync(bool enabled)
{
// The libretro frontend controls this.
Log_DevPrintf("Ignoring SetVSync(%u)", BoolToUInt32(enabled));
}
bool LibretroHostDisplay::Render()
{
if (HasDisplayTexture())
{
g_retro_video_refresh_callback(m_display_texture_handle, m_display_texture_view_width,
m_display_texture_view_height, m_frame_buffer_pitch);
if (m_display_texture_handle == m_software_fb.data)
ClearDisplayTexture();
}
return true;
}

View File

@ -1,63 +0,0 @@
#pragma once
#include "core/host_display.h"
#include "libretro.h"
class LibretroHostDisplay final : public HostDisplay
{
public:
LibretroHostDisplay();
~LibretroHostDisplay();
RenderAPI GetRenderAPI() const override;
void* GetRenderDevice() const override;
void* GetRenderContext() const override;
bool HasRenderDevice() const override;
bool HasRenderSurface() const override;
bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
bool threaded_presentation) override;
bool InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device,
bool threaded_presentation) override;
void DestroyRenderDevice() override;
bool MakeRenderContextCurrent() override;
bool DoneRenderContextCurrent() override;
bool ChangeRenderWindow(const WindowInfo& wi) override;
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
bool SupportsFullscreen() const override;
bool IsFullscreen() override;
bool SetFullscreen(bool fullscreen, u32 width, u32 height, float refresh_rate) override;
void DestroyRenderSurface() override;
bool SetPostProcessingChain(const std::string_view& config) override;
bool CreateResources() override;
void DestroyResources() override;
std::unique_ptr<HostDisplayTexture> CreateTexture(u32 width, u32 height, const void* data, u32 data_stride,
bool dynamic) override;
void UpdateTexture(HostDisplayTexture* texture, u32 x, u32 y, u32 width, u32 height, const void* data,
u32 data_stride) override;
bool DownloadTexture(const void* texture_handle, HostDisplayPixelFormat texture_format, u32 x, u32 y, u32 width,
u32 height, void* out_data, u32 out_data_stride) override;
void SetVSync(bool enabled) override;
bool Render() override;
bool SupportsDisplayPixelFormat(HostDisplayPixelFormat format) const override;
bool BeginSetDisplayPixels(HostDisplayPixelFormat format, u32 width, u32 height, void** out_buffer,
u32* out_pitch) override;
void EndSetDisplayPixels() override;
private:
bool CheckPixelFormat(retro_pixel_format new_format);
std::vector<u32> m_frame_buffer;
u32 m_frame_buffer_pitch = 0;
retro_framebuffer m_software_fb = {};
retro_pixel_format m_current_pixel_format = RETRO_PIXEL_FORMAT_UNKNOWN;
};

File diff suppressed because it is too large Load Diff

View File

@ -1,124 +0,0 @@
#pragma once
#include "core/host_interface.h"
#include "core/system.h"
#include "libretro.h"
#include <limits>
#include <optional>
#include <memory>
namespace GameSettings
{
struct Entry;
}
class LibretroHostInterface : public HostInterface
{
public:
LibretroHostInterface();
~LibretroHostInterface() override;
ALWAYS_INLINE u32 GetResolutionScale() const { return g_settings.gpu_resolution_scale; }
bool Initialize() override;
void Shutdown() override;
void ReportError(const char* message) override;
void ReportMessage(const char* message) override;
bool ConfirmMessage(const char* message) override;
void AddOSDMessage(std::string message, float duration = 2.0f) override;
void GetGameInfo(const char* path, CDImage* image, std::string* code, std::string* title) override;
std::string GetSharedMemoryCardPath(u32 slot) const override;
std::string GetGameMemoryCardPath(const char* game_code, u32 slot) const override;
std::string GetShaderCacheBasePath() const override;
std::string GetStringSettingValue(const char* section, const char* key, const char* default_value = "") override;
std::string GetBIOSDirectory() override;
std::unique_ptr<ByteStream> OpenPackageFile(const char* path, u32 flags) override;
bool UpdateSystemAVInfo(bool use_resolution_scale);
// Called by frontend
void retro_set_environment();
void retro_get_system_av_info(struct retro_system_av_info* info);
bool retro_load_game(const struct retro_game_info* game);
void retro_run_frame();
unsigned retro_get_region();
size_t retro_serialize_size();
bool retro_serialize(void* data, size_t size);
bool retro_unserialize(const void* data, size_t size);
void* retro_get_memory_data(unsigned id);
size_t retro_get_memory_size(unsigned id);
void retro_cheat_reset();
void retro_cheat_set(unsigned index, bool enabled, const char* code);
protected:
bool AcquireHostDisplay() override;
void ReleaseHostDisplay() override;
std::unique_ptr<AudioStream> CreateAudioStream(AudioBackend backend) override;
void OnSystemDestroyed() override;
void CheckForSettingsChanges(const Settings& old_settings) override;
void OnRunningGameChanged() override;
private:
bool SetCoreOptions();
bool HasCoreVariablesChanged();
void InitInterfaces();
void InitLogging();
void InitDiskControlInterface();
void InitRumbleInterface();
void LoadSettings() override;
void UpdateSettings();
void UpdateControllers();
void UpdateControllersDigitalController(u32 index);
void UpdateControllersAnalogController(u32 index);
void GetSystemAVInfo(struct retro_system_av_info* info, bool use_resolution_scale);
void UpdateGeometry();
void UpdateLogging();
bool UpdateGameSettings();
void ApplyGameSettings();
// Hardware renderer setup.
bool RequestHardwareRendererContext();
void SwitchToHardwareRenderer();
void SwitchToSoftwareRenderer();
static void HardwareRendererContextReset();
static void HardwareRendererContextDestroy();
// Disk control callbacks
static bool RETRO_CALLCONV DiskControlSetEjectState(bool ejected);
static bool RETRO_CALLCONV DiskControlGetEjectState();
static unsigned RETRO_CALLCONV DiskControlGetImageIndex();
static bool RETRO_CALLCONV DiskControlSetImageIndex(unsigned index);
static unsigned RETRO_CALLCONV DiskControlGetNumImages();
static bool RETRO_CALLCONV DiskControlReplaceImageIndex(unsigned index, const retro_game_info* info);
static bool RETRO_CALLCONV DiskControlAddImageIndex();
static bool RETRO_CALLCONV DiskControlSetInitialImage(unsigned index, const char* path);
static bool RETRO_CALLCONV DiskControlGetImagePath(unsigned index, char* path, size_t len);
static bool RETRO_CALLCONV DiskControlGetImageLabel(unsigned index, char* label, size_t len);
std::unique_ptr<GameSettings::Entry> m_game_settings;
float m_last_aspect_ratio = 4.0f / 3.0f;
retro_hw_render_callback m_hw_render_callback = {};
std::unique_ptr<HostDisplay> m_hw_render_display;
bool m_hw_render_callback_valid = false;
bool m_using_hardware_renderer = false;
std::optional<u32> m_next_disc_index;
retro_rumble_interface m_rumble_interface = {};
bool m_rumble_interface_valid = false;
bool m_supports_input_bitmasks = false;
};
extern LibretroHostInterface g_libretro_host_interface;
// libretro callbacks
extern retro_environment_t g_retro_environment_callback;
extern retro_video_refresh_t g_retro_video_refresh_callback;
extern retro_audio_sample_t g_retro_audio_sample_callback;
extern retro_audio_sample_batch_t g_retro_audio_sample_batch_callback;
extern retro_input_poll_t g_retro_input_poll_callback;
extern retro_input_state_t g_retro_input_state_callback;

View File

@ -1,177 +0,0 @@
#include "libretro_opengl_host_display.h"
#include "common/assert.h"
#include "common/log.h"
#include "core/gpu.h"
#include "libretro.h"
#include "libretro_host_interface.h"
#include <array>
#include <tuple>
Log_SetChannel(LibretroOpenGLHostDisplay);
LibretroOpenGLHostDisplay::LibretroOpenGLHostDisplay() = default;
LibretroOpenGLHostDisplay::~LibretroOpenGLHostDisplay() = default;
HostDisplay::RenderAPI LibretroOpenGLHostDisplay::GetRenderAPI() const
{
return m_is_gles ? HostDisplay::RenderAPI::OpenGLES : HostDisplay::RenderAPI::OpenGL;
}
void LibretroOpenGLHostDisplay::SetVSync(bool enabled)
{
// The libretro frontend controls this.
Log_DevPrintf("Ignoring SetVSync(%u)", BoolToUInt32(enabled));
}
static bool TryDesktopVersions(retro_hw_render_callback* cb)
{
static constexpr std::array<std::tuple<u32, u32>, 11> desktop_versions_to_try = {
{/*{4, 6}, {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, */ {3, 3}, {3, 2}, {3, 1}, {3, 0}}};
for (const auto& [major, minor] : desktop_versions_to_try)
{
if (major > 3 || (major == 3 && minor >= 2))
{
cb->context_type = RETRO_HW_CONTEXT_OPENGL_CORE;
cb->version_major = major;
cb->version_minor = minor;
}
else
{
cb->context_type = RETRO_HW_CONTEXT_OPENGL;
cb->version_major = 0;
cb->version_minor = 0;
}
if (g_retro_environment_callback(RETRO_ENVIRONMENT_SET_HW_RENDER, cb))
return true;
}
return false;
}
static bool TryESVersions(retro_hw_render_callback* cb)
{
static constexpr std::array<std::tuple<u32, u32>, 4> es_versions_to_try = {{{3, 2}, {3, 1}, {3, 0}}};
for (const auto& [major, minor] : es_versions_to_try)
{
if (major >= 3 && minor > 0)
{
cb->context_type = RETRO_HW_CONTEXT_OPENGLES_VERSION;
cb->version_major = major;
cb->version_minor = minor;
}
else
{
cb->context_type = RETRO_HW_CONTEXT_OPENGLES3;
cb->version_major = 0;
cb->version_minor = 0;
}
if (g_retro_environment_callback(RETRO_ENVIRONMENT_SET_HW_RENDER, cb))
return true;
}
return false;
}
bool LibretroOpenGLHostDisplay::RequestHardwareRendererContext(retro_hw_render_callback* cb, bool prefer_gles)
{
// Prefer a desktop OpenGL context where possible. If we can't get this, try OpenGL ES.
cb->cache_context = false;
cb->bottom_left_origin = true;
if (!prefer_gles)
{
if (TryDesktopVersions(cb) || TryESVersions(cb))
return true;
}
else
{
if (TryESVersions(cb) || TryDesktopVersions(cb))
return true;
}
Log_ErrorPrint("Failed to set any GL HW renderer");
return false;
}
bool LibretroOpenGLHostDisplay::CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name,
bool debug_device, bool threaded_presentation)
{
Assert(wi.type == WindowInfo::Type::Libretro);
// gross - but can't do much because of the GLADloadproc below.
static retro_hw_render_callback* cb;
cb = static_cast<retro_hw_render_callback*>(wi.display_connection);
m_window_info = wi;
m_is_gles = (cb->context_type == RETRO_HW_CONTEXT_OPENGLES3 || cb->context_type == RETRO_HW_CONTEXT_OPENGLES_VERSION);
const GLADloadproc get_proc_address = [](const char* sym) -> void* {
return reinterpret_cast<void*>(cb->get_proc_address(sym));
};
// Load GLAD.
const auto load_result = m_is_gles ? gladLoadGLES2Loader(get_proc_address) : gladLoadGLLoader(get_proc_address);
if (!load_result)
{
Log_ErrorPrintf("Failed to load GL functions");
return false;
}
return true;
}
void LibretroOpenGLHostDisplay::DestroyRenderDevice()
{
DestroyResources();
}
void LibretroOpenGLHostDisplay::ResizeRenderWindow(s32 new_window_width, s32 new_window_height)
{
m_window_info.surface_width = static_cast<u32>(new_window_width);
m_window_info.surface_height = static_cast<u32>(new_window_height);
}
bool LibretroOpenGLHostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
{
m_window_info = new_wi;
return true;
}
bool LibretroOpenGLHostDisplay::Render()
{
const GLuint fbo = static_cast<GLuint>(
static_cast<retro_hw_render_callback*>(m_window_info.display_connection)->get_current_framebuffer());
const u32 resolution_scale = g_libretro_host_interface.GetResolutionScale();
const u32 display_width = static_cast<u32>(m_display_width) * resolution_scale;
const u32 display_height = static_cast<u32>(m_display_height) * resolution_scale;
glEnable(GL_SCISSOR_TEST);
glScissor(0, 0, display_width, display_height);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
if (HasDisplayTexture())
{
const auto [left, top, width, height] = CalculateDrawRect(display_width, display_height, 0, false);
RenderDisplay(left, top, width, height, m_display_texture_handle, m_display_texture_width, m_display_texture_height,
m_display_texture_view_x, m_display_texture_view_y, m_display_texture_view_width,
m_display_texture_view_height, m_display_linear_filtering);
}
if (HasSoftwareCursor())
{
// TODO: Scale mouse x/y
const auto [left, top, width, height] = CalculateSoftwareCursorDrawRect(m_mouse_position_x, m_mouse_position_y);
RenderSoftwareCursor(left, display_height - top - height, width, height, m_cursor_texture.get());
}
g_retro_video_refresh_callback(RETRO_HW_FRAME_BUFFER_VALID, display_width, display_height, 0);
GL::Program::ResetLastProgram();
return true;
}

View File

@ -1,33 +0,0 @@
#pragma once
#include "common/gl/program.h"
#include "common/gl/texture.h"
#include "core/host_display.h"
#include "frontend-common/opengl_host_display.h"
#include "libretro.h"
#include <memory>
#include <string>
class LibretroOpenGLHostDisplay final : public FrontendCommon::OpenGLHostDisplay
{
public:
LibretroOpenGLHostDisplay();
~LibretroOpenGLHostDisplay();
static bool RequestHardwareRendererContext(retro_hw_render_callback* cb, bool prefer_gles);
RenderAPI GetRenderAPI() const override;
bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
bool threaded_presentation) override;
void DestroyRenderDevice() override;
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
bool ChangeRenderWindow(const WindowInfo& new_wi) override;
void SetVSync(bool enabled) override;
bool Render() override;
private:
bool m_is_gles = false;
};

View File

@ -1,122 +0,0 @@
#include "libretro_settings_interface.h"
#include "common/log.h"
#include "common/string_util.h"
#include "libretro_host_interface.h"
#include <type_traits>
Log_SetChannel(LibretroSettingsInterface);
template<typename T, typename DefaultValueType>
static T GetVariable(const char* section, const char* key, DefaultValueType default_value)
{
TinyString full_key;
full_key.Format("duckstation_%s.%s", section, key);
retro_variable rv = {full_key.GetCharArray(), nullptr};
if (!g_retro_environment_callback(RETRO_ENVIRONMENT_GET_VARIABLE, &rv) || !rv.value)
return T(default_value);
if constexpr (std::is_same_v<T, std::string>)
{
return T(rv.value);
}
else if constexpr (std::is_same_v<T, bool>)
{
return (StringUtil::Strcasecmp(rv.value, "true") == 0 || StringUtil::Strcasecmp(rv.value, "1") == 0);
}
else if constexpr (std::is_same_v<T, float>)
{
return std::strtof(rv.value, nullptr);
}
else
{
std::optional<T> parsed = StringUtil::FromChars<T>(rv.value);
if (!parsed.has_value())
return T(default_value);
return parsed.value();
}
}
void LibretroSettingsInterface::Clear()
{
Log_WarningPrintf("Clear not implemented");
}
int LibretroSettingsInterface::GetIntValue(const char* section, const char* key, int default_value /*= 0*/)
{
return GetVariable<int>(section, key, default_value);
}
float LibretroSettingsInterface::GetFloatValue(const char* section, const char* key, float default_value /*= 0.0f*/)
{
return GetVariable<float>(section, key, default_value);
}
bool LibretroSettingsInterface::GetBoolValue(const char* section, const char* key, bool default_value /*= false*/)
{
return GetVariable<bool>(section, key, default_value);
}
std::string LibretroSettingsInterface::GetStringValue(const char* section, const char* key,
const char* default_value /*= ""*/)
{
return GetVariable<std::string>(section, key, default_value);
}
void LibretroSettingsInterface::SetIntValue(const char* section, const char* key, int value)
{
Log_ErrorPrintf("SetIntValue(\"%s\", \"%s\", %d) not implemented", section, key, value);
}
void LibretroSettingsInterface::SetFloatValue(const char* section, const char* key, float value)
{
Log_ErrorPrintf("SetFloatValue(\"%s\", \"%s\", %f) not implemented", section, key, value);
}
void LibretroSettingsInterface::SetBoolValue(const char* section, const char* key, bool value)
{
Log_ErrorPrintf("SetBoolValue(\"%s\", \"%s\", %u) not implemented", section, key, static_cast<unsigned>(value));
}
void LibretroSettingsInterface::SetStringValue(const char* section, const char* key, const char* value)
{
Log_ErrorPrintf("SetStringValue(\"%s\", \"%s\", \"%s\") not implemented", section, key, value);
}
std::vector<std::string> LibretroSettingsInterface::GetStringList(const char* section, const char* key)
{
std::string value = GetVariable<std::string>(section, key, "");
if (value.empty())
return {};
return std::vector<std::string>({std::move(value)});
}
void LibretroSettingsInterface::SetStringList(const char* section, const char* key,
const std::vector<std::string>& items)
{
Log_ErrorPrintf("SetStringList(\"%s\", \"%s\") not implemented", section, key);
}
bool LibretroSettingsInterface::RemoveFromStringList(const char* section, const char* key, const char* item)
{
Log_ErrorPrintf("RemoveFromStringList(\"%s\", \"%s\", \"%s\") not implemented", section, key, item);
return false;
}
bool LibretroSettingsInterface::AddToStringList(const char* section, const char* key, const char* item)
{
Log_ErrorPrintf("AddToStringList(\"%s\", \"%s\", \"%s\") not implemented", section, key, item);
return false;
}
void LibretroSettingsInterface::DeleteValue(const char* section, const char* key)
{
Log_ErrorPrintf("DeleteValue(\"%s\", \"%s\") not implemented", section, key);
}
void LibretroSettingsInterface::ClearSection(const char* section)
{
Log_ErrorPrintf("ClearSection(\"%s\") not implemented", section);
}

View File

@ -1,26 +0,0 @@
#pragma once
#include "core/settings.h"
class LibretroSettingsInterface : public SettingsInterface
{
public:
void Clear() override;
int GetIntValue(const char* section, const char* key, int default_value = 0) override;
float GetFloatValue(const char* section, const char* key, float default_value = 0.0f) override;
bool GetBoolValue(const char* section, const char* key, bool default_value = false) override;
std::string GetStringValue(const char* section, const char* key, const char* default_value = "") override;
void SetIntValue(const char* section, const char* key, int value) override;
void SetFloatValue(const char* section, const char* key, float value) override;
void SetBoolValue(const char* section, const char* key, bool value) override;
void SetStringValue(const char* section, const char* key, const char* value) override;
std::vector<std::string> GetStringList(const char* section, const char* key) override;
void SetStringList(const char* section, const char* key, const std::vector<std::string>& items) override;
bool RemoveFromStringList(const char* section, const char* key, const char* item) override;
bool AddToStringList(const char* section, const char* key, const char* item) override;
void DeleteValue(const char* section, const char* key) override;
void ClearSection(const char* section) override;
};

View File

@ -1,268 +0,0 @@
#include "libretro_vulkan_host_display.h"
#include "common/align.h"
#include "common/assert.h"
#include "common/log.h"
#include "common/vulkan/builders.h"
#include "common/vulkan/context.h"
#include "common/vulkan/shader_cache.h"
#include "common/vulkan/util.h"
#include "libretro_host_interface.h"
#include "vulkan_loader.h"
Log_SetChannel(LibretroVulkanHostDisplay);
LibretroVulkanHostDisplay::LibretroVulkanHostDisplay() = default;
LibretroVulkanHostDisplay::~LibretroVulkanHostDisplay() = default;
void LibretroVulkanHostDisplay::SetVSync(bool enabled)
{
// The libretro frontend controls this.
Log_DevPrintf("Ignoring SetVSync(%u)", BoolToUInt32(enabled));
}
static bool RetroCreateVulkanDevice(struct retro_vulkan_context* context, VkInstance instance, VkPhysicalDevice gpu,
VkSurfaceKHR surface, PFN_vkGetInstanceProcAddr get_instance_proc_addr,
const char** required_device_extensions, unsigned num_required_device_extensions,
const char** required_device_layers, unsigned num_required_device_layers,
const VkPhysicalDeviceFeatures* required_features)
{
// We need some module functions.
vkGetInstanceProcAddr = get_instance_proc_addr;
if (!Vulkan::LoadVulkanInstanceFunctions(instance))
{
Log_ErrorPrintf("Failed to load Vulkan instance functions");
Vulkan::ResetVulkanLibraryFunctionPointers();
return false;
}
if (gpu == VK_NULL_HANDLE)
{
Vulkan::Context::GPUList gpus = Vulkan::Context::EnumerateGPUs(instance);
if (gpus.empty())
{
g_libretro_host_interface.ReportError("No GPU provided and none available, cannot create device");
Vulkan::ResetVulkanLibraryFunctionPointers();
return false;
}
Log_InfoPrintf("No GPU provided, using first/default");
gpu = gpus[0];
}
if (!Vulkan::Context::CreateFromExistingInstance(
instance, gpu, surface, false, false, false, required_device_extensions, num_required_device_extensions,
required_device_layers, num_required_device_layers, required_features))
{
Vulkan::ResetVulkanLibraryFunctionPointers();
return false;
}
context->gpu = g_vulkan_context->GetPhysicalDevice();
context->device = g_vulkan_context->GetDevice();
context->queue = g_vulkan_context->GetGraphicsQueue();
context->queue_family_index = g_vulkan_context->GetGraphicsQueueFamilyIndex();
context->presentation_queue = g_vulkan_context->GetPresentQueue();
context->presentation_queue_family_index = g_vulkan_context->GetPresentQueueFamilyIndex();
return true;
}
static retro_hw_render_context_negotiation_interface_vulkan s_vulkan_context_negotiation_interface = {
RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN, // interface_type
RETRO_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE_VULKAN_VERSION, // interface_version
nullptr, // get_application_info
RetroCreateVulkanDevice, // create_device
nullptr // destroy_device
};
bool LibretroVulkanHostDisplay::RequestHardwareRendererContext(retro_hw_render_callback* cb)
{
cb->cache_context = false;
cb->bottom_left_origin = false;
cb->context_type = RETRO_HW_CONTEXT_VULKAN;
return g_retro_environment_callback(RETRO_ENVIRONMENT_SET_HW_RENDER, cb) &&
g_retro_environment_callback(RETRO_ENVIRONMENT_SET_HW_RENDER_CONTEXT_NEGOTIATION_INTERFACE,
&s_vulkan_context_negotiation_interface);
}
bool LibretroVulkanHostDisplay::CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name,
bool debug_device, bool threaded_presentation)
{
retro_hw_render_interface* ri = nullptr;
if (!g_retro_environment_callback(RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE, &ri))
{
Log_ErrorPrint("Failed to get HW render interface");
return false;
}
else if (ri->interface_type != RETRO_HW_RENDER_INTERFACE_VULKAN ||
ri->interface_version != RETRO_HW_RENDER_INTERFACE_VULKAN_VERSION)
{
Log_ErrorPrintf("Unexpected HW interface - type %u version %u", static_cast<unsigned>(ri->interface_type),
static_cast<unsigned>(ri->interface_version));
return false;
}
if (!g_vulkan_context)
{
Log_ErrorPrintf("Vulkan context was not negotiated/created");
return false;
}
// TODO: Grab queue? it should be the same
m_ri = reinterpret_cast<retro_hw_render_interface_vulkan*>(ri);
return true;
}
void LibretroVulkanHostDisplay::DestroyRenderDevice()
{
VulkanHostDisplay::DestroyRenderDevice();
Vulkan::ResetVulkanLibraryFunctionPointers();
}
bool LibretroVulkanHostDisplay::CreateResources()
{
m_frame_render_pass = g_vulkan_context->GetRenderPass(FRAMEBUFFER_FORMAT, VK_FORMAT_UNDEFINED, VK_SAMPLE_COUNT_1_BIT,
VK_ATTACHMENT_LOAD_OP_CLEAR);
if (m_frame_render_pass == VK_NULL_HANDLE)
return false;
return VulkanHostDisplay::CreateResources();
}
void LibretroVulkanHostDisplay::DestroyResources()
{
VulkanHostDisplay::DestroyResources();
Vulkan::Util::SafeDestroyFramebuffer(m_frame_framebuffer);
m_frame_texture.Destroy();
Vulkan::ShaderCompiler::DeinitializeGlslang();
}
VkRenderPass LibretroVulkanHostDisplay::GetRenderPassForDisplay() const
{
return m_frame_render_pass;
}
void LibretroVulkanHostDisplay::ResizeRenderWindow(s32 new_window_width, s32 new_window_height)
{
m_window_info.surface_width = static_cast<u32>(new_window_width);
m_window_info.surface_height = static_cast<u32>(new_window_height);
}
bool LibretroVulkanHostDisplay::ChangeRenderWindow(const WindowInfo& new_wi)
{
// re-query hardware render interface - in vulkan, things get recreated without us being notified
retro_hw_render_interface* ri = nullptr;
if (!g_retro_environment_callback(RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE, &ri))
{
Log_ErrorPrint("Failed to get HW render interface");
return false;
}
else if (ri->interface_type != RETRO_HW_RENDER_INTERFACE_VULKAN ||
ri->interface_version != RETRO_HW_RENDER_INTERFACE_VULKAN_VERSION)
{
Log_ErrorPrintf("Unexpected HW interface - type %u version %u", static_cast<unsigned>(ri->interface_type),
static_cast<unsigned>(ri->interface_version));
return false;
}
retro_hw_render_interface_vulkan* vri = reinterpret_cast<retro_hw_render_interface_vulkan*>(ri);
if (vri != m_ri)
{
Log_WarningPrintf("HW render interface pointer changed without us being notified, this might cause issues?");
m_ri = vri;
}
return true;
}
bool LibretroVulkanHostDisplay::Render()
{
const u32 resolution_scale = g_libretro_host_interface.GetResolutionScale();
const u32 display_width = static_cast<u32>(m_display_width) * resolution_scale;
const u32 display_height = static_cast<u32>(m_display_height) * resolution_scale;
if (display_width == 0 || display_height == 0 || !CheckFramebufferSize(display_width, display_height))
return false;
VkCommandBuffer cmdbuffer = g_vulkan_context->GetCurrentCommandBuffer();
m_frame_texture.OverrideImageLayout(m_frame_view.image_layout);
m_frame_texture.TransitionToLayout(cmdbuffer, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
const VkClearValue clear_value = {};
const VkRenderPassBeginInfo rp = {
VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, nullptr, m_frame_render_pass, m_frame_framebuffer,
{{0, 0}, {display_width, display_height}}, 1u, &clear_value};
vkCmdBeginRenderPass(cmdbuffer, &rp, VK_SUBPASS_CONTENTS_INLINE);
if (HasDisplayTexture())
{
const auto [left, top, width, height] = CalculateDrawRect(display_width, display_height, 0, false);
RenderDisplay(left, top, width, height, m_display_texture_handle, m_display_texture_width, m_display_texture_height,
m_display_texture_view_x, m_display_texture_view_y, m_display_texture_view_width,
m_display_texture_view_height, m_display_linear_filtering);
}
if (HasSoftwareCursor())
{
// TODO: Scale mouse x/y
const auto [left, top, width, height] = CalculateSoftwareCursorDrawRect(m_mouse_position_x, m_mouse_position_y);
RenderSoftwareCursor(left, top, width, height, m_cursor_texture.get());
}
vkCmdEndRenderPass(cmdbuffer);
m_frame_texture.TransitionToLayout(cmdbuffer, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
m_frame_view.image_layout = m_frame_texture.GetLayout();
m_ri->set_image(m_ri->handle, &m_frame_view, 0, nullptr, VK_QUEUE_FAMILY_IGNORED);
// TODO: We can't use this because it doesn't support passing fences...
// m_ri.set_command_buffers(m_ri.handle, 1, &cmdbuffer);
m_ri->lock_queue(m_ri->handle);
g_vulkan_context->SubmitCommandBuffer();
m_ri->unlock_queue(m_ri->handle);
g_vulkan_context->MoveToNextCommandBuffer();
g_retro_video_refresh_callback(RETRO_HW_FRAME_BUFFER_VALID, display_width, display_height, 0);
return true;
}
bool LibretroVulkanHostDisplay::CheckFramebufferSize(u32 width, u32 height)
{
static constexpr VkImageUsageFlags usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
static constexpr VkImageViewType view_type = VK_IMAGE_VIEW_TYPE_2D;
static constexpr VkImageTiling tiling = VK_IMAGE_TILING_OPTIMAL;
if (m_frame_texture.GetWidth() == width && m_frame_texture.GetHeight() == height)
return true;
g_vulkan_context->DeferFramebufferDestruction(m_frame_framebuffer);
m_frame_texture.Destroy(true);
if (!m_frame_texture.Create(width, height, 1, 1, FRAMEBUFFER_FORMAT, VK_SAMPLE_COUNT_1_BIT, view_type, tiling, usage))
return false;
VkCommandBuffer cmdbuf = g_vulkan_context->GetCurrentCommandBuffer();
m_frame_texture.TransitionToLayout(cmdbuf, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
static constexpr VkClearColorValue cc = {};
static constexpr VkImageSubresourceRange range = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
vkCmdClearColorImage(cmdbuf, m_frame_texture.GetImage(), m_frame_texture.GetLayout(), &cc, 1, &range);
Vulkan::FramebufferBuilder fbb;
fbb.SetRenderPass(m_frame_render_pass);
fbb.AddAttachment(m_frame_texture.GetView());
fbb.SetSize(width, height, 1);
m_frame_framebuffer = fbb.Create(g_vulkan_context->GetDevice(), false);
if (m_frame_framebuffer == VK_NULL_HANDLE)
return false;
m_frame_view = {};
m_frame_view.image_view = m_frame_texture.GetView();
m_frame_view.image_layout = m_frame_texture.GetLayout();
m_frame_view.create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
m_frame_view.create_info.image = m_frame_texture.GetImage();
m_frame_view.create_info.viewType = view_type;
m_frame_view.create_info.format = FRAMEBUFFER_FORMAT;
m_frame_view.create_info.components = {VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B,
VK_COMPONENT_SWIZZLE_A};
m_frame_view.create_info.subresourceRange = range;
return true;
}

View File

@ -1,44 +0,0 @@
#pragma once
#include "common/vulkan/texture.h"
#include "frontend-common/vulkan_host_display.h"
#include "libretro.h"
#define HAVE_VULKAN
#include "libretro_vulkan.h"
class LibretroVulkanHostDisplay final : public FrontendCommon::VulkanHostDisplay
{
public:
LibretroVulkanHostDisplay();
~LibretroVulkanHostDisplay();
static bool RequestHardwareRendererContext(retro_hw_render_callback* cb);
bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device,
bool threaded_presentation) override;
void DestroyRenderDevice() override;
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
bool ChangeRenderWindow(const WindowInfo& new_wi) override;
void SetVSync(bool enabled) override;
bool Render() override;
protected:
bool CreateResources() override;
void DestroyResources() override;
VkRenderPass GetRenderPassForDisplay() const override;
private:
static constexpr VkFormat FRAMEBUFFER_FORMAT = VK_FORMAT_R8G8B8A8_UNORM;
bool CheckFramebufferSize(u32 width, u32 height);
retro_hw_render_interface_vulkan* m_ri = nullptr;
Vulkan::Texture m_frame_texture;
retro_vulkan_image m_frame_view = {};
VkFramebuffer m_frame_framebuffer = VK_NULL_HANDLE;
VkRenderPass m_frame_render_pass = VK_NULL_HANDLE;
};

View File

@ -1,153 +0,0 @@
#include "common/assert.h"
#include "common/log.h"
#include "libretro_host_interface.h"
#include "scmversion/scmversion.h"
Log_SetChannel(Main);
RETRO_API unsigned retro_api_version(void)
{
return RETRO_API_VERSION;
}
RETRO_API void retro_init(void)
{
// default log to stdout until we get an interface
Log::SetConsoleOutputParams(true, nullptr, LOGLEVEL_INFO);
if (!g_libretro_host_interface.Initialize())
Panic("Host interface initialization failed");
}
RETRO_API void retro_deinit(void)
{
g_libretro_host_interface.Shutdown();
}
RETRO_API void retro_get_system_info(struct retro_system_info* info)
{
std::memset(info, 0, sizeof(*info));
#if defined(_DEBUGFAST)
info->library_name = "DuckStation DebugFast";
#elif defined(_DEBUG)
info->library_name = "DuckStation Debug";
#else
info->library_name = "DuckStation";
#endif
info->library_version = g_scm_tag_str;
info->valid_extensions = "exe|cue|bin|chd|psf|m3u";
info->need_fullpath = true;
info->block_extract = false;
}
RETRO_API void retro_get_system_av_info(struct retro_system_av_info* info)
{
g_libretro_host_interface.retro_get_system_av_info(info);
}
RETRO_API void retro_set_controller_port_device(unsigned port, unsigned device)
{
Log_ErrorPrintf("retro_set_controller_port_device(%u, %u)", port, device);
}
RETRO_API void retro_reset(void)
{
Log_InfoPrint("retro_reset()");
g_libretro_host_interface.ResetSystem();
}
RETRO_API void retro_run(void)
{
g_libretro_host_interface.retro_run_frame();
}
RETRO_API size_t retro_serialize_size(void)
{
return g_libretro_host_interface.retro_serialize_size();
}
RETRO_API bool retro_serialize(void* data, size_t size)
{
return g_libretro_host_interface.retro_serialize(data, size);
}
RETRO_API bool retro_unserialize(const void* data, size_t size)
{
return g_libretro_host_interface.retro_unserialize(data, size);
}
RETRO_API void retro_cheat_reset(void)
{
Log_InfoPrint("retro_cheat_reset()");
g_libretro_host_interface.retro_cheat_reset();
}
RETRO_API void retro_cheat_set(unsigned index, bool enabled, const char* code)
{
Log_InfoPrintf("retro_cheat_set(%u, %u, %s)", index, enabled, code);
g_libretro_host_interface.retro_cheat_set(index, enabled, code);
}
RETRO_API bool retro_load_game(const struct retro_game_info* game)
{
Log_InfoPrintf("retro_load_game(%s)", game->path);
return g_libretro_host_interface.retro_load_game(game);
}
RETRO_API bool retro_load_game_special(unsigned game_type, const struct retro_game_info* info, size_t num_info)
{
Log_ErrorPrintf("retro_load_game_special()");
return false;
}
RETRO_API void retro_unload_game(void)
{
g_libretro_host_interface.DestroySystem();
}
RETRO_API unsigned retro_get_region(void)
{
return g_libretro_host_interface.retro_get_region();
}
RETRO_API void* retro_get_memory_data(unsigned id)
{
return g_libretro_host_interface.retro_get_memory_data(id);
}
RETRO_API size_t retro_get_memory_size(unsigned id)
{
return g_libretro_host_interface.retro_get_memory_size(id);
}
RETRO_API void retro_set_environment(retro_environment_t f)
{
g_retro_environment_callback = f;
g_libretro_host_interface.retro_set_environment();
}
RETRO_API void retro_set_video_refresh(retro_video_refresh_t f)
{
g_retro_video_refresh_callback = f;
}
RETRO_API void retro_set_audio_sample(retro_audio_sample_t f)
{
g_retro_audio_sample_callback = f;
}
RETRO_API void retro_set_audio_sample_batch(retro_audio_sample_batch_t f)
{
g_retro_audio_sample_batch_callback = f;
}
RETRO_API void retro_set_input_poll(retro_input_poll_t f)
{
g_retro_input_poll_callback = f;
}
RETRO_API void retro_set_input_state(retro_input_state_t f)
{
g_retro_input_state_callback = f;
}

View File

@ -1,6 +1,24 @@
add_library(frontend-common
common_host_interface.cpp
common_host_interface.h
controller_interface.cpp
controller_interface.h
cubeb_audio_stream.cpp
cubeb_audio_stream.h
game_list.cpp
game_list.h
game_settings.cpp
game_settings.h
icon.cpp
icon.h
ini_settings_interface.cpp
ini_settings_interface.h
imgui_impl_opengl3.cpp
imgui_impl_opengl3.h
imgui_impl_vulkan.cpp
imgui_impl_vulkan.h
imgui_styles.cpp
imgui_styles.h
opengl_host_display.cpp
opengl_host_display.h
postprocessing_chain.cpp
@ -9,97 +27,55 @@ add_library(frontend-common
postprocessing_shader.h
postprocessing_shadergen.cpp
postprocessing_shadergen.h
save_state_selector_ui.cpp
save_state_selector_ui.h
vulkan_host_display.cpp
vulkan_host_display.h
)
target_link_libraries(frontend-common PUBLIC core common glad vulkan-loader)
target_compile_definitions(frontend-common PRIVATE "WITH_IMGUI=1")
target_link_libraries(frontend-common PUBLIC core common glad vulkan-loader cubeb imgui simpleini tinyxml2 scmversion)
if(WIN32)
target_sources(frontend-common PRIVATE
d3d11_host_display.cpp
d3d11_host_display.h
dinput_controller_interface.cpp
dinput_controller_interface.h
imgui_impl_dx11.cpp
imgui_impl_dx11.h
xinput_controller_interface.cpp
xinput_controller_interface.h
)
target_link_libraries(frontend-common PRIVATE d3d11.lib dxgi.lib)
endif()
if(NOT BUILD_LIBRETRO_CORE)
target_sources(frontend-common PRIVATE
imgui_impl_opengl3.h
imgui_impl_opengl3.cpp
)
target_sources(frontend-common PRIVATE
imgui_impl_vulkan.h
imgui_impl_vulkan.cpp
if(SDL2_FOUND)
target_sources(frontend-common PRIVATE
sdl_audio_stream.cpp
sdl_audio_stream.h
sdl_controller_interface.cpp
sdl_controller_interface.h
sdl_initializer.cpp
sdl_initializer.h
)
target_compile_definitions(frontend-common PUBLIC "WITH_SDL2=1")
target_include_directories(frontend-common PRIVATE ${SDL2_INCLUDE_DIRS})
target_link_libraries(frontend-common PRIVATE ${SDL2_LIBRARIES})
# Copy bundled SDL2 to output on Windows.
if(WIN32)
target_sources(frontend-common PRIVATE
imgui_impl_dx11.h
imgui_impl_dx11.cpp
)
add_custom_command(TARGET frontend-common POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${SDL2_DLL_PATH}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SDL2.dll")
endif()
target_sources(frontend-common PRIVATE
common_host_interface.cpp
common_host_interface.h
controller_interface.cpp
controller_interface.h
cubeb_audio_stream.cpp
cubeb_audio_stream.h
game_list.cpp
game_list.h
icon.cpp
icon.h
imgui_styles.cpp
imgui_styles.h
ini_settings_interface.cpp
ini_settings_interface.h
save_state_selector_ui.cpp
save_state_selector_ui.h
)
if(WIN32)
target_sources(frontend-common PRIVATE
dinput_controller_interface.cpp
dinput_controller_interface.h
xinput_controller_interface.cpp
xinput_controller_interface.h
)
endif()
target_compile_definitions(frontend-common PRIVATE "WITH_IMGUI=1")
target_link_libraries(frontend-common PUBLIC cubeb imgui simpleini tinyxml2 scmversion)
if(SDL2_FOUND)
target_sources(frontend-common PRIVATE
sdl_audio_stream.cpp
sdl_audio_stream.h
sdl_controller_interface.cpp
sdl_controller_interface.h
sdl_initializer.cpp
sdl_initializer.h
)
target_compile_definitions(frontend-common PUBLIC "WITH_SDL2=1")
target_include_directories(frontend-common PRIVATE ${SDL2_INCLUDE_DIRS})
target_link_libraries(frontend-common PRIVATE ${SDL2_LIBRARIES})
# Copy bundled SDL2 to output on Windows.
if(WIN32)
add_custom_command(TARGET frontend-common POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${SDL2_DLL_PATH}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SDL2.dll")
endif()
endif()
if(ENABLE_DISCORD_PRESENCE AND NOT BUILD_LIBRETRO_CORE)
target_compile_definitions(frontend-common PUBLIC -DWITH_DISCORD_PRESENCE=1)
target_link_libraries(frontend-common PRIVATE discord-rpc)
endif()
# Copy the provided data directory to the output directory.
add_custom_command(TARGET frontend-common POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/data" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)
endif()
if(ENABLE_DISCORD_PRESENCE)
target_compile_definitions(frontend-common PUBLIC -DWITH_DISCORD_PRESENCE=1)
target_link_libraries(frontend-common PRIVATE discord-rpc)
endif()
# Copy the provided data directory to the output directory.
add_custom_command(TARGET frontend-common POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/data" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)

View File

@ -344,11 +344,8 @@ bool D3D11HostDisplay::CreateRenderDevice(const WindowInfo& wi, std::string_view
bool D3D11HostDisplay::InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device,
bool threaded_presentation)
{
if (m_window_info.type != WindowInfo::Type::Surfaceless && m_window_info.type != WindowInfo::Type::Libretro &&
!CreateSwapChain(nullptr))
{
if (m_window_info.type != WindowInfo::Type::Surfaceless && !CreateSwapChain(nullptr))
return false;
}
if (!CreateResources())
return false;

View File

@ -11,12 +11,10 @@
#include <utility>
Log_SetChannel(GameSettings);
#ifndef LIBRETRO
#ifdef WIN32
#include "common/windows_headers.h"
#endif
#include "SimpleIni.h"
#endif
namespace GameSettings {
@ -183,8 +181,6 @@ bool Entry::SaveToStream(ByteStream* stream) const
WriteStringToStream(stream, memory_card_2_shared_path) && WriteStringToStream(stream, input_profile_name);
}
#ifndef LIBRETRO
static void ParseIniSection(Entry* entry, const char* section, const CSimpleIniA& ini)
{
for (u32 trait = 0; trait < static_cast<u32>(Trait::Count); trait++)
@ -897,8 +893,6 @@ void Entry::SetValueForKey(const std::string_view& key, const std::optional<std:
SetEntryValueForKey(*this, key, value);
}
#endif
void Entry::ApplySettings(bool display_osd_messages) const
{
constexpr float osd_duration = 10.0f;

View File

@ -93,8 +93,6 @@ struct Entry
void SetValueForKey(const std::string_view& key, const std::optional<std::string>& value);
};
#ifndef LIBRETRO
class Database
{
public:
@ -110,6 +108,4 @@ private:
std::unordered_map<std::string, Entry> m_entries;
};
#endif
}; // namespace GameSettings

View File

@ -9,7 +9,7 @@
#include "imgui_impl_opengl3.h"
#endif
#include "postprocessing_shadergen.h"
Log_SetChannel(LibretroOpenGLHostDisplay);
Log_SetChannel(OpenGLHostDisplay);
namespace FrontendCommon {

View File

@ -499,7 +499,6 @@ void main()
void VulkanHostDisplay::DestroyResources()
{
#ifndef LIBRETRO
Vulkan::Util::SafeDestroyPipelineLayout(m_post_process_pipeline_layout);
Vulkan::Util::SafeDestroyPipelineLayout(m_post_process_ubo_pipeline_layout);
Vulkan::Util::SafeDestroyDescriptorSetLayout(m_post_process_descriptor_set_layout);
@ -509,7 +508,6 @@ void VulkanHostDisplay::DestroyResources()
m_post_processing_stages.clear();
m_post_processing_ubo.Destroy(true);
m_post_processing_chain.ClearStages();
#endif
m_display_pixels_texture.Destroy(false);
m_readback_staging_texture.Destroy(false);