summaryrefslogtreecommitdiffstats
path: root/src/video_core/pica_state.h
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-06-16 13:00:15 +0200
committerwwylele <wwylele@gmail.com>2017-06-21 22:13:06 +0200
commitab60414122184851415a27ae8bcacb4aab0504b6 (patch)
treef26b042d908ede118686e781eedfec24539ab299 /src/video_core/pica_state.h
parentMerge pull request #2776 from wwylele/geo-factor (diff)
downloadyuzu-ab60414122184851415a27ae8bcacb4aab0504b6.tar
yuzu-ab60414122184851415a27ae8bcacb4aab0504b6.tar.gz
yuzu-ab60414122184851415a27ae8bcacb4aab0504b6.tar.bz2
yuzu-ab60414122184851415a27ae8bcacb4aab0504b6.tar.lz
yuzu-ab60414122184851415a27ae8bcacb4aab0504b6.tar.xz
yuzu-ab60414122184851415a27ae8bcacb4aab0504b6.tar.zst
yuzu-ab60414122184851415a27ae8bcacb4aab0504b6.zip
Diffstat (limited to 'src/video_core/pica_state.h')
-rw-r--r--src/video_core/pica_state.h12
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;