Skip to content

Implement an abstract renderer#163

Merged
CryZe merged 8 commits intoLiveSplit:masterfrom
CryZe:rendering
Feb 13, 2019
Merged

Implement an abstract renderer#163
CryZe merged 8 commits intoLiveSplit:masterfrom
CryZe:rendering

Conversation

@CryZe
Copy link
Copy Markdown
Collaborator

@CryZe CryZe commented Feb 10, 2019

This PR adds a rendering module behind a new feature rendering to livesplit-core. The renderer here takes a LayoutState and an implementation of the Backend trait. The renderer takes the layout state and instructs the backend to creates meshes, textures and to render them out. By abstracting out the backend we can use this rendering on a lot of platforms without needing to focus on a specific rendering framework.

Additionally there's software rendering backend based on the euc crate behind the new software-rendering feature gate. This will allow us to unit test the rendering across a variety of platforms without needing to rely on a GPU framework.

@CryZe CryZe added suitable for contributions The issue is suitable those who are contributing to livesplit-core. work in progress labels Feb 10, 2019
@CryZe
Copy link
Copy Markdown
Collaborator Author

CryZe commented Feb 10, 2019

This is still heavily WIP, as there's no unit tests yet, some documentation is missing and it could use some more refactoring.

@CryZe CryZe added enhancement An improvement for livesplit-core. and removed suitable for contributions The issue is suitable those who are contributing to livesplit-core. labels Feb 10, 2019
This commit adds a rendering module behind a new feature `rendering` to
livesplit-core. The renderer here takes a LayoutState and an
implementation of the Backend trait. The renderer takes the layout state
and instructs the backend to creates meshes, textures and to render them
out. By abstracting out the backend we can use this rendering on a lot
of platforms without needing to focus on a specific rendering framework.
Starting to clean up the code for bringing it into the master branch.
Before we had an arbitrary array of three indices that we needed to hack
around on every backend. This works much better.
This adds a software rendering backend based on the euc crate behind the
new `software-rendering` feature gate. This will allow us to unit test
the rendering across a variety of platforms without needing to rely on a
GPU framework.
We use checksums for the actual comparisons and the actual images are
stored temporarily in Rust's target folder. The individual images there
are postfixed by the checksum, so if there's a mismatch you can compare
the two versions of the image.
@CryZe CryZe force-pushed the rendering branch 10 times, most recently from 74b6559 to 31db167 Compare February 11, 2019 20:18
In order to run the rendering tests on all the platforms a few changes
needed to be made:

1. The floating point accuracy of i586 platforms is inadequate for
rendering the layouts with enough precision to end up with the same
checksums as on the other platforms. The tests are therefore disabled on
platforms that don't support MMX. However Rust can't currently check for
MMX, so we check for SSE in the meantime.

2. Big Endian Platforms can't properly decode zlib streams correctly
such as present in PNG images. The platforms are in the allowed to fail
list for now until the PR I submitted is merged and published.

3. Turns out we can actually support more targets on Windows, such as
the i568 target. Support for aarch64 is almost there as well, so we are
tracking that now.
@CryZe CryZe merged commit d3cd805 into LiveSplit:master Feb 13, 2019
@CryZe CryZe added this to the v0.11 milestone Mar 17, 2019
@CryZe CryZe added the feature A new user visible feature for livesplit-core. label Apr 15, 2019
@CryZe CryZe deleted the rendering branch April 24, 2019 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An improvement for livesplit-core. feature A new user visible feature for livesplit-core.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant