CommonLibVR
State.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSTArray.h"
4 #include "RE/N/NiSmartPointer.h"
5 #include "RE/N/NiSourceTexture.h"
6 
7 namespace RE
8 {
9  namespace BSGraphics
10  {
11  class State
12  {
13  public:
14  [[nodiscard]] static State* GetSingleton()
15  {
16  REL::Relocation<State*> singleton{ RELOCATION_ID(524998, 411479) };
17  return singleton.get();
18  }
19 
20  // members
25  std::uint32_t unk020; // 020
26  std::uint32_t screenWidth; // 024
27  std::uint32_t screenHeight; // 028
28  std::uint32_t frameBufferViewport[2]; // 02C
29  std::uint32_t unk034; // 034
30  std::uint32_t unk038; // 038
31  std::uint32_t unk03C; // 03C
32  std::uint32_t unk040; // 040
33  float unk044; // 044
34  float unk048; // 048
35  std::uint32_t frameCount; // 04C
36  bool insideFrame; // 050
37  bool letterbox; // 051
38  bool unk052; // 052
40  bool useEarlyZ; // 054
41  bool unk055; // 055
42 #ifdef SKYRIM_SUPPORT_AE
43  bool unk56; // 056
44  bool doubleDynamicResolutionAdjustmentFrequency; // 057
45  bool unk58; // 058
46 #endif
47  std::uint32_t unk058; // 058
48  std::uint32_t unk05C; // 05C
59  std::uint32_t unk0C0; // 0C0
60  float haltonSequence[2][8]; // 0C4
66  volatile std::int32_t dynamicResolutionLock; // 118
70 #ifndef SKYRIMVR
71  std::uint8_t unk11E; // 11E
72  std::uint8_t pad11F; // 11F
73 #else
74  std::uint16_t padVR11E; // 11E
75  std::int32_t unkVR120; // 120
76  std::uint32_t padVR124; // 124
77 #endif
78  };
79  static_assert(offsetof(State, screenWidth) == 0x24);
80  static_assert(offsetof(State, frameBufferViewport) == 0x2C);
81  static_assert(offsetof(State, letterbox) == 0x51);
82 #ifndef SKYRIMVR
83 # ifdef SKYRIM_SUPPORT_AE
84  static_assert(sizeof(State) == 0x120);
85 # else
86  static_assert(sizeof(State) == 0x128);
87 # endif
88 #endif
89  }
90 }
#define RELOCATION_ID(SE, AE)
Definition: PCH.h:702
Definition: Relocation.h:210
Definition: State.h:12
NiPointer< NiSourceTexture > defaultReflectionCubeMap
Definition: State.h:53
std::uint8_t unk11E
Definition: State.h:71
std::uint32_t frameBufferViewport[2]
Definition: State.h:28
NiPointer< NiSourceTexture > defaultTextureWhite
Definition: State.h:50
NiPointer< NiSourceTexture > defaultTextureNormalMap
Definition: State.h:56
float dynamicResolutionPreviousHeightRatio
Definition: State.h:64
bool unk052
Definition: State.h:38
NiPointer< NiSourceTexture > defaultFaceDetailMap
Definition: State.h:54
bool insideFrame
Definition: State.h:36
std::uint32_t unk038
Definition: State.h:30
std::uint32_t screenWidth
Definition: State.h:26
bool canChangeDynamicResolution
Definition: State.h:69
float unk048
Definition: State.h:34
float dynamicResolutionWidthRatio
Definition: State.h:61
std::uint32_t dynamicResolutionIncreaseFrameWaited
Definition: State.h:65
std::uint32_t unk020
Definition: State.h:25
std::uint32_t unk03C
Definition: State.h:31
float haltonSequence[2][8]
Definition: State.h:60
NiPointer< NiSourceTexture > defaultTextureDitherNoiseMap
Definition: State.h:57
bool canDecreaseDynamicResolution
Definition: State.h:68
float unk044
Definition: State.h:33
NiPointer< NiSourceTexture > defaultTextureGrey
Definition: State.h:51
volatile std::int32_t dynamicResolutionLock
Definition: State.h:66
NiPointer< NiSourceTexture > defaultTextureProjNormalMap
Definition: State.h:23
NiPointer< NiSourceTexture > defaultHeightMap
Definition: State.h:52
NiPointer< NiSourceTexture > defaultTexEffectMap
Definition: State.h:55
NiPointer< NiSourceTexture > defaultTextureProjDiffuseMap
Definition: State.h:22
static State * GetSingleton()
Definition: State.h:14
NiPointer< NiSourceTexture > defaultTextureBlack
Definition: State.h:49
BSTArray< void * > cameraDataCache
Definition: State.h:58
float dynamicResolutionHeightRatio
Definition: State.h:62
std::uint32_t unk0C0
Definition: State.h:59
std::uint32_t frameCount
Definition: State.h:35
NiPointer< NiSourceTexture > defaultTextureProjNoiseMap
Definition: State.h:21
std::uint8_t pad11F
Definition: State.h:72
float dynamicResolutionPreviousWidthRatio
Definition: State.h:63
bool compiledShaderThisFrame
Definition: State.h:39
bool canIncreaseDynamicResolution
Definition: State.h:67
std::uint32_t unk058
Definition: State.h:47
std::uint32_t unk040
Definition: State.h:32
std::uint32_t unk034
Definition: State.h:29
std::uint32_t unk05C
Definition: State.h:48
bool useEarlyZ
Definition: State.h:40
std::uint32_t screenHeight
Definition: State.h:27
bool unk055
Definition: State.h:41
bool letterbox
Definition: State.h:37
NiPointer< NiSourceTexture > defaultTextureProjNormalDetailMap
Definition: State.h:24
Definition: NiSmartPointer.h:9
Definition: AbsorbEffect.h:6