Skip to content

Commit

Permalink
chore: try to avoid unneeded rebuilds
Browse files Browse the repository at this point in the history
  • Loading branch information
doodlum committed Dec 19, 2024
1 parent 25a3f9d commit 37d2c00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
6 changes: 5 additions & 1 deletion src/Raytracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,13 @@ void Raytracing::BSTriShape_UpdateWorldData(RE::BSTriShape* This, RE::NiUpdateDa
{
std::lock_guard lck{ mutex };

RE::NiPoint3 pointA = This->world * RE::NiPoint3{ 1.0f, 1.0f, 1.0f };

Hooks::BSTriShape_UpdateWorldData::func(This, a_data);

if (std::memcmp(&This->world, &This->previousWorld, sizeof(This->world)) != 0) {
RE::NiPoint3 pointB = This->world * RE::NiPoint3{ 1.0f, 1.0f, 1.0f };

if (pointA.GetDistance(pointB) > 0.1f) {
auto it = instances.find(This);
if (it != instances.end()) {
auto& instanceData = (*it).second;
Expand Down
17 changes: 5 additions & 12 deletions src/Raytracing.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "Buffer.h"
#include "State.h"
#include <FidelityFX/host/backends/dx12/d3dx12.h>
#include <RE/A/AnimationObjects.h>

interface DECLSPEC_UUID("9f251514-9d4d-4902-9d60-18988ab7d4b5") DECLSPEC_NOVTABLE

Expand Down Expand Up @@ -145,12 +144,6 @@ class Raytracing
eastl::hash_map<ID3D11Buffer*, BufferData> vertexBuffers;
eastl::hash_map<ID3D11Buffer*, BufferData> indexBuffers;

struct LODMode
{
std::uint8_t index: 7;
bool singleLevel: 1;
};

bool visibleState = true;

struct InstanceData
Expand Down Expand Up @@ -276,11 +269,11 @@ class Raytracing
{
//stl::write_vfunc<0x6, BSLightingShader_SetupGeometry>(RE::VTABLE_BSLightingShader[0]);

//if (REL::Module::IsAE()) {
// stl::write_vfunc<0x31, BSTriShape_UpdateWorldData>(RE::VTABLE_BSTriShape[0]);
//} else {
// stl::write_vfunc<0x30, BSTriShape_UpdateWorldData>(RE::VTABLE_BSTriShape[0]);
//}
if (REL::Module::IsAE()) {
stl::write_vfunc<0x31, BSTriShape_UpdateWorldData>(RE::VTABLE_BSTriShape[0]);
} else {
stl::write_vfunc<0x30, BSTriShape_UpdateWorldData>(RE::VTABLE_BSTriShape[0]);
}

//stl::write_vfunc<0x16, NiCullingProcess_Process1>(RE::VTABLE_NiCullingProcess[0]);
// stl::write_vfunc<0x16, BSCullingProcess_Process1>(RE::VTABLE_BSCullingProcess[0]);
Expand Down

0 comments on commit 37d2c00

Please sign in to comment.