Skip to content

Commit

Permalink
fix: build and follow sse naming standard
Browse files Browse the repository at this point in the history
  • Loading branch information
FlayaN committed Aug 19, 2024
1 parent 606987a commit b191316
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 47 deletions.
8 changes: 3 additions & 5 deletions include/RE/B/BSComputeShader.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ namespace RE
~BSComputeShader() override; // 00

// override (BSReloadShaderI)
void ReloadShaders(void* stream) override; // 00
void ReloadShaders(void* a_stream) override; // 00

// add
virtual void Dispatch(uint32_t techniqueId, uint32_t threadGroupCountX, uint32_t threadGroupCountY, uint32_t threadGroupCountZ); // 02
virtual void Dispatch(uint32_t a_techniqueId, uint32_t a_threadGroupCountX, uint32_t a_threadGroupCountY, uint32_t a_threadGroupCountZ); // 02

// members
const char* name; // 18
BSTHashMap<uint32_t, BSGraphics::ComputeShader*> shadersMap; // 20

private:
KEEP_FOR_RE()
};
static_assert(sizeof(BSComputeShader) == 0x50);
}
11 changes: 6 additions & 5 deletions include/RE/B/BSImagespaceShader.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace RE

struct ShaderMacro
{
// members
const char* name; // 00
const char* definition; // 08
};
Expand All @@ -32,11 +33,11 @@ namespace RE
bool RestoreRenderStates(ImageSpaceEffectParam* a_param) override; // 09

// add
virtual void PreRender(); // 0A - { return; }
virtual void PostRender(); // 0B - { return; }
virtual void DispatchComputeShader(uint32_t threadGroupCountX, uint32_t threadGroupCountY, uint32_t threadGroupCountZ); // 0C
virtual void GetShaderMacros(ShaderMacro* macros); // 0D
virtual void LoadShaders(); // 0E
virtual void PreRender(); // 0A - { return; }
virtual void PostRender(); // 0B - { return; }
virtual void DispatchComputeShader(uint32_t a_threadGroupCountX, uint32_t a_threadGroupCountY, uint32_t a_threadGroupCountZ); // 0C
virtual void GetShaderMacros(ShaderMacro* a_macros); // 0D
virtual void LoadShaders(); // 0E

static BSImagespaceShader* Create()
{
Expand Down
4 changes: 1 addition & 3 deletions include/RE/B/BSImagespaceShaderBlur3.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ namespace RE
~BSImagespaceShaderBlur3() override; // 00

// override (BSImagespaceShader)
void GetShaderMacros(ShaderMacro* macros) override; // 0D
private:
KEEP_FOR_RE()
void GetShaderMacros(ShaderMacro* a_macros) override; // 0D
};
static_assert(sizeof(BSImagespaceShaderBlur3) == 0x1A8);
}
4 changes: 1 addition & 3 deletions include/RE/B/BSReloadShaderI.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ namespace RE
inline static constexpr auto RTTI = RTTI_BSReloadShaderI;
inline static constexpr auto VTABLE = VTABLE_BSReloadShaderI;

virtual void ReloadShaders(void* stream) = 0; // 00
private:
KEEP_FOR_RE()
virtual void ReloadShaders(void* a_stream) = 0; // 00
};
static_assert(sizeof(BSReloadShaderI) == 0x8);
}
63 changes: 32 additions & 31 deletions include/RE/B/BSShader.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace RE
struct ID3D11Buffer;
struct ID3D11PixelShader;
struct ID3D11VertexShader;
struct ID3D11ComputeShader;

namespace BSGraphics
{
Expand All @@ -29,49 +30,49 @@ namespace RE
{
public:
// members
std::uint32_t id; // 00
REX::W32::ID3D11PixelShader* shader = nullptr; // 08
ConstantGroup constantBuffers[3]; // 10
std::array<std::int8_t, 64> constantTable; // 58
std::uint32_t id; // 00
ID3D11PixelShader* shader; // 08
ConstantGroup constantBuffers[3]; // 10
std::array<std::int8_t, 64> constantTable; // 58
};
static_assert(sizeof(PixelShader) == 0x80);

class VertexShader
{
public:
// members
std::uint32_t id; // 00
REX::W32::ID3D11VertexShader* shader = nullptr; // 08
std::uint32_t byteCodeSize; // 10
ConstantGroup constantBuffers[3]; // 18
std::uint64_t shaderDesc; // 48
std::array<std::int8_t, 20> constantTable; // 50
std::uint32_t pad64; // 64
std::uint8_t rawBytecode[0]; // 68
std::uint32_t id; // 00
ID3D11VertexShader* shader; // 08
std::uint32_t byteCodeSize; // 10
ConstantGroup constantBuffers[3]; // 18
std::uint64_t shaderDesc; // 48
std::array<std::int8_t, 20> constantTable; // 50
std::uint32_t pad64; // 64
std::uint8_t rawBytecode[0]; // 68
};
static_assert(sizeof(VertexShader) == 0x68);

class ComputeShader
{
public:
// members
uint64_t unk00; // 00
uint64_t unk08; // 08
uint64_t unk10; // 10
uint32_t unk18; // 18
uint64_t unk20; // 20
uint64_t unk28; // 28
uint64_t unk30; // 30
uint32_t unk38; // 38
uint64_t unk40; // 40
uint64_t unk48; // 38
uint64_t unk50; // 50
uint32_t unk58; // 58
REX::W32::ID3D11ComputeShader* shader; // 60
uint32_t id; // 68
uint32_t byteCodeSize; // 6C
std::array<std::int8_t, 32> constantTable; // 70
uint8_t rawBytecode[0]; // 90
uint64_t unk00; // 00
uint64_t unk08; // 08
uint64_t unk10; // 10
uint32_t unk18; // 18
uint64_t unk20; // 20
uint64_t unk28; // 28
uint64_t unk30; // 30
uint32_t unk38; // 38
uint64_t unk40; // 40
uint64_t unk48; // 38
uint64_t unk50; // 50
uint32_t unk58; // 58
ID3D11ComputeShader* shader; // 60
uint32_t id; // 68
uint32_t byteCodeSize; // 6C
std::array<std::int8_t, 32> constantTable; // 70
uint8_t rawBytecode[0]; // 90
};
static_assert(sizeof(ComputeShader) == 0x90);
}
Expand Down Expand Up @@ -124,11 +125,11 @@ namespace RE
virtual void GetTechniqueName(std::uint32_t a_techniqueID, char* a_buffer, std::uint32_t a_bufferSize); // 08
virtual void ReloadShaders(bool a_clear); // 09

RE::BSRenderPass* MakeRenderPass(BSShaderProperty* property, BSGeometry* geometry, uint32_t technique, uint8_t numLights, BSLight** lights)
RE::BSRenderPass* MakeRenderPass(BSShaderProperty* a_property, BSGeometry* a_geometry, uint32_t a_technique, uint8_t a_numLights, BSLight** a_lights)
{
using func_t = decltype(&BSShader::MakeRenderPass);
static REL::Relocation<func_t> func{ RELOCATION_ID(100717, 107497) };
return func(this, property, geometry, technique, numLights, lights);
return func(this, a_property, a_geometry, a_technique, a_numLights, a_lights);
}

// members
Expand Down

0 comments on commit b191316

Please sign in to comment.