Xbox 360 Emulator Research Project
Find a file
Triang3l cec9ca0ef2 [GPU] 8-bit PWL gamma RT as linear 16-bit UNorm on the host
With render target HLE, directly store linear values as R16G16B16A16_UNORM
without gamma conversion, as this format provides more than enough bits
(need at least 11 per component due to the maximum scale being 2^3 in the
piecewise linear gamma curve) to represent linear values without precision
loss.

This makes blending work correctly in linear space, improving quality of
transparency, lighting passes, and fixing issues such as transparent parts
of impact and footstep decals in 4D5307E6 being bright instead.

The new behavior is enabled by default, as it hugely improves the accuracy
of emulation of this format, that is pretty commonplace in Xbox 360 games,
with likely just a small GPU memory and bandwidth usage increase, compared
to the alternatives that were previously available on the HLE RB path.

It's currently implemented only on Direct3D 12, as most of the current GPU
emulation code is planned to be phased out and redone, and no methods other
than 8-bit with pre-conversion were implemented on Vulkan previously.

To implement on Vulkan later, same conversion as in the Direct3D 12
implementation will need to be done in ownership transfer and resolve
shaders. Currently it's somewhat inconvenient to decouple the conversion
functions in `SpirvShaderTranslator` from an instance of the translator due
to vector constant usage. Later, simpler SPIR-V generation functions may be
added (`spv::Builder` usage in general is overly verbose).

The previously default method (8-bit storage with pre-conversion in shaders
and incorrect blending) can be re-enabled by setting the
"gamma_render_target_as_unorm16" configuration option to `false`. This may
be useful if the game, for instance, switches between 8_8_8_8_GAMMA and
8_8_8_8 formats for the same data frequently, as switching will result in
EDRAM range ownership transfer data copying now. Also, the old path is
preserved for Vulkan devices not supporting R16G16B16A16_UNORM with
blending.

The other workaround that was available previously, replacing the PWL
encoding with host hardware sRGB with linear-space blending in render
target management and in texture fetching, was also inherently inaccurate
in many ways (especially when games have their own PWL encoding math, like
4541080F that displayed incorrect colors on the loading screen), and
required tracking of the encoding needed for ranges in the memory.

The sRGB workaround therefore was deleted in this commit, greatly
simplifying the code in the parts of render target, texture and memory
management and shader generation that were involved in it.
2026-01-18 16:22:22 +03:00
.github Bug report template changes 2022-02-06 14:24:35 +03:00
android/android_studio_project [Android] Exclude executables from app build 2022-07-17 17:11:48 +03:00
assets [App/Discord] Rework how rich presence is managed. 2019-08-03 08:16:04 -05:00
docs [UI] Windows: Disable rounded corners 2022-05-05 21:46:20 +03:00
src/xenia [GPU] 8-bit PWL gamma RT as linear 16-bit UNorm on the host 2026-01-18 16:22:22 +03:00
third_party [D3D12] Include recent D3D12 headers from the Microsoft GitHub 2026-01-14 23:05:08 +03:00
tools moved vswhere to tools directory 2022-12-28 14:17:24 -06:00
.appveyor.yml [AppVeyor] Skip all non-Windows commits [ci skip] 2022-01-30 13:22:32 +03:00
.clang-format [UI] android.app.NativeActivity > WindowedAppActivity + code style 2021-09-18 20:32:24 +03:00
.drone.star [CI, Drone] Disable HighResolutionTimer test cases 2022-11-20 16:41:55 -06:00
.gdbinit [threading linux] Implement Callback Queuing 2020-11-15 11:12:05 -06:00
.gitattributes [GPU] Shaders to common, xb buildshaders instead of buildhlsl 2021-06-05 18:53:53 +03:00
.gitignore Update .gitignore. 2018-05-22 22:24:39 -05:00
.gitmodules [D3D12] Include recent D3D12 headers from the Microsoft GitHub 2026-01-14 23:05:08 +03:00
LICENSE Adding CONTRIBUTING.md so that github shows it on issues. 2015-08-28 14:16:38 -07:00
premake5.lua [Android] Unified xenia-app with windowed apps and build prerequisites 2022-07-11 21:45:57 +03:00
README.md Reflect the closure of #1333 2022-01-28 23:01:50 +03:00
xb Add xb symlink to xenia-build to match xb.bat for win 2017-07-11 11:47:24 -06:00
xb.bat Python/xenia-build/xb fixes 2022-07-21 08:31:35 -05:00
xb.ps1 Python/xenia-build/xb fixes 2022-07-21 08:31:35 -05:00
xenia-build [Build] Replace spirv-remap with spirv-opt --canonicalize-ids 2026-01-04 16:53:52 +03:00
xeniarc clang-format detection cleanup. 2015-08-01 00:41:46 -07:00

Xenia - Xbox 360 Emulator

Xenia is an experimental emulator for the Xbox 360. For more information, see the main Xenia wiki.

Interested in supporting the core contributors? Visit Xenia Project on Patreon.

Come chat with us about emulator-related topics on Discord. For developer chat join #dev but stay on topic. Lurking is not only fine, but encouraged! Please check the FAQ page before asking questions. We've got jobs/lives/etc, so don't expect instant answers.

Discussing illegal activities will get you banned.

Status

Buildbot Status Releases
Windows Build status LatestAll
Linux Build status

Quite a few real games run. Quite a few don't. See the Game compatibility list for currently tracked games, and feel free to contribute your own updates, screenshots, and information there following the existing conventions.

Disclaimer

The goal of this project is to experiment, research, and educate on the topic of emulation of modern devices and operating systems. It is not for enabling illegal activity. All information is obtained via reverse engineering of legally purchased devices and games and information made public on the internet (you'd be surprised what's indexed on Google...).

Quickstart

See the Quickstart page.

Building

See building.md for setup and information about the xb script. When writing code, check the style guide and be sure to run clang-format!

Contributors Wanted!

Have some spare time, know advanced C++, and want to write an emulator? Contribute! There's a ton of work that needs to be done, a lot of which is wide open greenfield fun.

For general rules and guidelines please see CONTRIBUTING.md.

Fixes and optimizations are always welcome (please!), but in addition to that there are some major work areas still untouched:

See more projects good for contributors. It's a good idea to ask on Discord and check the issues page before beginning work on something.

FAQ

See the frequently asked questions page.