-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RetroPlayer: Merge savestate metadata into .sav file #14209
Conversation
a4099a3
to
01ea551
Compare
TODO: The savestate needs a version field (testing depends) jenkins build this please |
jenkins build this please |
363b707
to
8072f5d
Compare
jenkins build this please |
) | ||
|
||
core_add_messages(retroplayer_messages) | ||
set(EXTRA_INCLUDES ${EXTRA_INCLUDES} PARENT_SCOPE) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmake stuff doesn't conform to our standards and needs serious changes.
- move all flatbuffer building to depends
- fix the findmodule to allow bulding with external and internal flatbuffer and just use FLATBUFFER_INCLUDE_DIR
- no changes to core_add_library
finally: flatbuffers is not available for several linux distros, incl ubuntu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flatc and flatbuffers has to be added to https://github.com/xbmc/kodi-deps/, so it can be easily build from source (for windows) if needed.
I think this is the case.
Is there an existing example I can learn from?
How do I make other code depend on the generated headers?
Can we build flatc when not detected, à la TexturePacker? |
FFmpeg, Crossguid, Fmt, fstrcmp and RapidJSON can be built internal. |
0984934
to
ba8ec8e
Compare
cmake/modules/FindFlatBuffers.cmake
Outdated
set(FLATBUFFERS_INCLUDE_DIRS ${FLATBUFFERS_INCLUDE_DIR}) | ||
include_directories(${CMAKE_BINARY_DIR}) | ||
else() | ||
set(FLATBUFFERS_INCLUDE_DIR) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
cmake/modules/FindFlatBuffers.cmake
Outdated
set(FLATBUFFERS_INCLUDE_DIR) | ||
endif() | ||
|
||
include("${FLATBUFFERS_CMAKE_DIR}/BuildFlatBuffers.cmake") |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -11,3 +11,4 @@ jsonschemabuilder-1.0.0-win32-3.7z | |||
swig-3.0.10-win32.7z | |||
texturepacker-1.1.1-win32.7z | |||
vswhere-2.2.11-win32.7z | |||
flatc-1.9.0-win32.7z |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
VERSION=1.9.0 | ||
SOURCE=v$(VERSION) | ||
ARCHIVE=$(SOURCE).tar.gz | ||
BASE_URL=https://github.com/google/flatbuffers/archive |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
PLATFORM = native | ||
TARBALLS_LOCATION = $(ROOT_DIR) | ||
BASE_URL := https://github.com/google/flatbuffers/archive |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
#include "ISavestate.h" | ||
|
||
#include "flatbuffers/flatbuffers.h" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
4129ef2
to
d101aaf
Compare
cmake/modules/FindFlatBuffers.cmake
Outdated
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(flatbuffers | ||
DEFAULT_MSG FLATBUFFERS_FLATC_EXECUTABLE FLATBUFFERS_INCLUDE_DIR) | ||
|
||
if(FLATBUFFERS_FOUND) | ||
function(FLATBUFFERS_GENERATE_C_HEADERS Name) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@garbear see wsnipex@67e6b8d for some cmake fixes. |
d101aaf
to
4a6076d
Compare
fd0fe81
to
ef86085
Compare
cmake/scripts/common/Macros.cmake
Outdated
@@ -813,3 +813,4 @@ macro(find_addon_xml_in_files) | |||
# Append also versions.h to depends | |||
list(APPEND ADDON_XML_DEPENDS "${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h") | |||
endmacro() | |||
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
-DFLATBUFFERS_BUILD_TESTS=OFF \ | ||
-DFLATBUFFERS_INSTALL=ON \ | ||
-DFLATBUFFERS_BUILD_FLATLIB=OFF \ | ||
-DFLATBUFFERS_BUILD_FLATC=$(BUILD_FLATC) \ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
small fix for external flatbuffers: wsnipex@46527b8 |
cd5131b
to
f5727d9
Compare
jenkins build this please |
1 similar comment
jenkins build this please |
set_target_properties(retroplayer_messages PROPERTIES FOLDER "Generated Messages" | ||
INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR} | ||
SOURCES ${FLATC_OUTPUTS}) | ||
add_dependencies(retroplayer_messages flatbuffers) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
58b429a
to
742fab4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only one minor, otherwise looks good to me
cmake/modules/FindFlatBuffers.cmake
Outdated
else() | ||
find_program(FLATBUFFERS_FLATC_EXECUTABLE NAMES flatc) | ||
find_path(FLATBUFFERS_INCLUDE_DIR NAMES flatbuffers/flatbuffers.h) | ||
set(FLATBUFFERS_MESSAGES_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cores/RetroPlayer/messages CACHE INTERNAL "Generated Flatbuffer headers") |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@wsnipex updated. jenkins build this please |
jenkins build this please |
1 similar comment
jenkins build this please |
59fa126
to
14b1b66
Compare
jenkins build this please |
all green |
jenkins build this please |
The code was originally placed in games/ to minimize the size of RetroPlayer, which was crucial to rapidly scaling the player to handle the rendering system added in the GSoC 2017 shader project. Code shuffle only. No functional changes.
This transfers ownership of the playback system from the game client to RetroPlayer. Our goal is to move the memory stream (currently owned by playback) into a RetroPlayerMemory stream.
Code shuffle only. No functional changes.
31673d3
to
61a5cc1
Compare
Fedora has a flatbuffers package, so documentation has to be adjusted. |
This adds the flatc compiler to native depends and the flatbuffer headers to target depends.
This removes the auxiliary XML metadata file used for savestates. Now, metadata is serialized into the .sav file using FlatBuffers.
587ecfb
to
3ed099a
Compare
added package to fedora. jenkins build this please |
[cleanup] remove retroplayer leftovers after #14209
Description
Introduced in #12434, RetroPlayer uses two files for autosave: a .sav file for the memory data, and an .xml file for metadata. This combines both memory data and metadata into a single .sav file:
In this PR, FlatBuffers is used to serialize metadata. This library was chosen for performance reasons, as it is the only popular serialization library that allows for zero-copy. Although it requires a native compiler, the target library is headers-only.
Backwards compatibility with XML files was not retained due to the extra code it would take, and RetroPlayer is still alpha software.
As a result of this PR, savestates are several hundred kb smaller, half as many files, and loading/saving should be faster on slow devices due to skipping costly XML operations.
I spent a LONG time on the build system stuff, and I'm not sure if I did everything correctly.
Motivation and Context
First abstraction for the new Saved Games manager.
How Has This Been Tested?
Tested on Windows 7 and OSX.
Types of change