CommonLibSSE NG
Loading...
Searching...
No Matches
BSShader.h
Go to the documentation of this file.
1#pragma once
2
5#include "RE/N/NiRefObject.h"
6
7namespace RE
8{
9 class BSRenderPass;
10 class BSShaderMaterial;
11
12 struct ID3D11Buffer;
13 struct ID3D11PixelShader;
14 struct ID3D11VertexShader;
15
16 namespace BSGraphics
17 {
19 {
20 public:
21 // members
22 ID3D11Buffer* buffer; // 00
23 void* data; // 08
24 };
25 static_assert(sizeof(ConstantGroup) == 0x10);
26
28 {
29 public:
30 // members
31 std::uint32_t id; // 00
32 ID3D11PixelShader* shader; // 08
34 std::int8_t constantTable[64]; // 58
35 };
36 static_assert(sizeof(PixelShader) == 0x80);
37
39 {
40 public:
41 // members
42 std::uint32_t id; // 00
43 ID3D11VertexShader* shader; // 08
44 std::uint32_t byteCodeSize; // 10
46 std::uint64_t shaderDesc; // 48
47 std::int8_t constantTable[20]; // 50
48 std::uint32_t pad64; // 64
49 std::uint8_t rawBytecode[0]; // 68
50 };
51 static_assert(sizeof(VertexShader) == 0x68);
52 }
53
54 namespace BSShaderTechniqueIDMap
55 {
56 template <class T>
58 {
59 [[nodiscard]] std::uint32_t operator()(const T a_shader) const noexcept
60 {
61 assert(a_shader != nullptr);
62 return a_shader->id;
63 }
64 };
65
66 template <class T>
68 {
69 [[nodiscard]] bool operator()(const T a_lhs, const T a_rhs) const noexcept
70 {
71 assert(a_lhs != nullptr);
72 assert(a_rhs != nullptr);
73 return a_lhs->id == a_rhs->id;
74 }
75 };
76
77 template <class T>
79 }
80
81 class BSShader :
82 public NiRefObject, // 00
83 public NiBoneMatrixSetterI, // 10
84 public BSReloadShaderI // 18
85 {
86 public:
87 inline static constexpr auto RTTI = RTTI_BSShader;
88 inline static constexpr auto VTABLE = VTABLE_BSShader;
89
90 ~BSShader() override; // 00
91
92 // add
93 virtual bool SetupTechnique(std::uint32_t a_technique) = 0; // 02
94 virtual void RestoreTechnique(std::uint32_t a_technique) = 0; // 03
95 virtual void SetupMaterial(const BSShaderMaterial* a_material); // 04
96 virtual void RestoreMaterial(const BSShaderMaterial* a_material); // 05
97 virtual void SetupGeometry(BSRenderPass* a_currentPass, std::uint32_t a_flags) = 0; // 06
98 virtual void RestoreGeometry(BSRenderPass* a_currentPass, std::uint32_t a_renderFlags) = 0; // 07
99 virtual void GetTechniqueName(std::uint32_t a_techniqueID, char* a_buffer, std::uint32_t a_bufferSize); // 08
100 virtual void ReloadShaders(bool a_clear); // 09
101
102 // members
103 std::int32_t shaderType; // 20
106 const char* fxpFilename; // 88
107 };
108 static_assert(sizeof(BSShader) == 0x90);
109}
Definition BSShader.h:19
ID3D11Buffer * buffer
Definition BSShader.h:22
void * data
Definition BSShader.h:23
Definition BSShader.h:28
ID3D11PixelShader * shader
Definition BSShader.h:32
ConstantGroup constantBuffers[3]
Definition BSShader.h:33
std::uint32_t id
Definition BSShader.h:31
std::int8_t constantTable[64]
Definition BSShader.h:34
Definition BSShader.h:39
std::uint64_t shaderDesc
Definition BSShader.h:46
std::uint32_t id
Definition BSShader.h:42
std::int8_t constantTable[20]
Definition BSShader.h:47
std::uint8_t rawBytecode[0]
Definition BSShader.h:49
std::uint32_t pad64
Definition BSShader.h:48
std::uint32_t byteCodeSize
Definition BSShader.h:44
ConstantGroup constantBuffers[3]
Definition BSShader.h:45
ID3D11VertexShader * shader
Definition BSShader.h:43
Definition BSReloadShaderI.h:8
Definition BSRenderPass.h:11
Definition BSShader.h:85
virtual void SetupGeometry(BSRenderPass *a_currentPass, std::uint32_t a_flags)=0
static constexpr auto RTTI
Definition BSShader.h:87
BSShaderTechniqueIDMap::MapType< BSGraphics::PixelShader * > pixelShaders
Definition BSShader.h:105
std::int32_t shaderType
Definition BSShader.h:103
virtual bool SetupTechnique(std::uint32_t a_technique)=0
BSShaderTechniqueIDMap::MapType< BSGraphics::VertexShader * > vertexShaders
Definition BSShader.h:104
virtual void GetTechniqueName(std::uint32_t a_techniqueID, char *a_buffer, std::uint32_t a_bufferSize)
virtual void ReloadShaders(bool a_clear)
virtual void RestoreGeometry(BSRenderPass *a_currentPass, std::uint32_t a_renderFlags)=0
~BSShader() override
const char * fxpFilename
Definition BSShader.h:106
virtual void RestoreMaterial(const BSShaderMaterial *a_material)
static constexpr auto VTABLE
Definition BSShader.h:88
virtual void SetupMaterial(const BSShaderMaterial *a_material)
virtual void RestoreTechnique(std::uint32_t a_technique)=0
Definition BSShaderMaterial.h:9
Definition BSTHashMap.h:21
Definition NiBoneMatrixSetterI.h:6
Definition NiRefObject.h:8
Definition AbsorbEffect.h:6
constexpr std::array< REL::VariantID, 3 > VTABLE_BSShader
Definition Offsets_VTABLE.h:7303
constexpr REL::VariantID RTTI_BSShader(691881, 399925, 0x1f7d930)
bool operator()(const T a_lhs, const T a_rhs) const noexcept
Definition BSShader.h:69
std::uint32_t operator()(const T a_shader) const noexcept
Definition BSShader.h:59