diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-06-21 23:55:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-21 23:55:23 +0200 |
commit | 72b69cea4bf9d01e520fb984a382de3e85af4e36 (patch) | |
tree | ff8a7246f49a300a1bbcd0447ace505744ec48db /src/video_core/pica_state.h | |
parent | Merge pull request #2789 from yuriks/misc-kernel (diff) | |
parent | gl_state: reset 1d textures (diff) | |
download | yuzu-72b69cea4bf9d01e520fb984a382de3e85af4e36.tar yuzu-72b69cea4bf9d01e520fb984a382de3e85af4e36.tar.gz yuzu-72b69cea4bf9d01e520fb984a382de3e85af4e36.tar.bz2 yuzu-72b69cea4bf9d01e520fb984a382de3e85af4e36.tar.lz yuzu-72b69cea4bf9d01e520fb984a382de3e85af4e36.tar.xz yuzu-72b69cea4bf9d01e520fb984a382de3e85af4e36.tar.zst yuzu-72b69cea4bf9d01e520fb984a382de3e85af4e36.zip |
Diffstat (limited to 'src/video_core/pica_state.h')
-rw-r--r-- | src/video_core/pica_state.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/video_core/pica_state.h b/src/video_core/pica_state.h index f46db09fb..3b00df0b3 100644 --- a/src/video_core/pica_state.h +++ b/src/video_core/pica_state.h @@ -87,12 +87,18 @@ struct State { // LUT value, encoded as 12-bit fixed point, with 12 fraction bits BitField<0, 12, u32> value; // 0.0.12 fixed point - // Used by HW for efficient interpolation, Citra does not use these - BitField<12, 12, s32> difference; // 1.0.11 fixed point + // Used for efficient interpolation. + BitField<12, 11, u32> difference; // 0.0.11 fixed point + BitField<23, 1, u32> neg_difference; - float ToFloat() { + float ToFloat() const { return static_cast<float>(value) / 4095.f; } + + float DiffToFloat() const { + float diff = static_cast<float>(difference) / 2047.f; + return neg_difference ? -diff : diff; + } }; std::array<std::array<LutEntry, 256>, 24> luts; |