From 4ee8fe166fff9b19d2d7d9560e9dcd41474fc94b Mon Sep 17 00:00:00 2001 From: Alan Tse Date: Sun, 15 Mar 2026 01:01:40 -0700 Subject: [PATCH] build: bump commonlib to 4.7.1 This will be required for shadow-limit-fix due to fixed VR re. --- extern/CommonLibSSE-NG | 2 +- src/Features/ExtendedTranslucency.cpp | 4 ++-- src/Features/GrassCollision.cpp | 2 +- src/Features/LinearLighting.cpp | 2 +- src/Features/SkySync.cpp | 4 ++-- src/Features/Skylighting.cpp | 10 +++++----- src/Features/Skylighting.h | 2 +- src/Features/TerrainHelper.cpp | 2 +- src/Features/UnifiedWater.cpp | 4 ++-- src/Features/WetnessEffects.cpp | 8 ++++---- src/Hooks.cpp | 2 +- src/ShaderCache.cpp | 4 ++-- src/TruePBR.cpp | 18 +++++++++--------- src/Utils/GameSetting.cpp | 5 +++-- 14 files changed, 35 insertions(+), 34 deletions(-) diff --git a/extern/CommonLibSSE-NG b/extern/CommonLibSSE-NG index da5dd61f11..23bf551265 160000 --- a/extern/CommonLibSSE-NG +++ b/extern/CommonLibSSE-NG @@ -1 +1 @@ -Subproject commit da5dd61f11d175cf351bfa7c54548ae1abdc6625 +Subproject commit 23bf5512657c16ca3b4e1c9379f47038da26053d diff --git a/src/Features/ExtendedTranslucency.cpp b/src/Features/ExtendedTranslucency.cpp index 58a6d5072b..7d2f92ede2 100644 --- a/src/Features/ExtendedTranslucency.cpp +++ b/src/Features/ExtendedTranslucency.cpp @@ -26,8 +26,8 @@ void ExtendedTranslucency::BSLightingShader_SetupGeometry(RE::BSRenderPass* pass // Clear the ExtraFeatureDescriptor to disable this effect on default SetFeatureDescriptor(MaterialModel::DescriptorDisabled); - auto& property0 = pass->geometry->GetGeometryRuntimeData().properties[0]; - auto& property1 = pass->geometry->GetGeometryRuntimeData().properties[1]; + auto& property0 = pass->geometry->GetGeometryRuntimeData().alphaProperty; + auto& property1 = pass->geometry->GetGeometryRuntimeData().shaderProperty; auto alphaProperty = property0 && property0->GetRTTI() == globals::rtti::NiAlphaPropertyRTTI.get() ? static_cast(property0.get()) : nullptr; auto lightProperty = property1 && property1->GetRTTI() == globals::rtti::BSLightingShaderPropertyRTTI.get() ? static_cast(property1.get()) : nullptr; diff --git a/src/Features/GrassCollision.cpp b/src/Features/GrassCollision.cpp index 1eb704446b..bdc697e13b 100644 --- a/src/Features/GrassCollision.cpp +++ b/src/Features/GrassCollision.cpp @@ -31,7 +31,7 @@ void GrassCollision::UpdateCollisions(PerFrame& perFrameData) actors.push_back(&processLists->highActorHandles); // High actors are in combat or doing something interesting for (auto array : actors) { for (auto& actorHandle : *array) { - auto actorPtr = actorHandle.getsafe(); + auto actorPtr = actorHandle.get(); if (actorPtr && actorPtr.get() && actorPtr->Is3DLoaded()) { actorList.push_back(actorPtr); } diff --git a/src/Features/LinearLighting.cpp b/src/Features/LinearLighting.cpp index 4eaee96b4b..6890e590d2 100644 --- a/src/Features/LinearLighting.cpp +++ b/src/Features/LinearLighting.cpp @@ -192,7 +192,7 @@ RE::NiColor LinearLighting::ColorToLinear(RE::NiColor inColor, float gamma) void LinearLighting::BSLightingShader_SetupGeometry(RE::BSRenderPass* a_pass) { - auto& property1 = a_pass->geometry->GetGeometryRuntimeData().properties[1]; + auto& property1 = a_pass->geometry->GetGeometryRuntimeData().shaderProperty; auto lightProperty = property1 && property1->GetRTTI() == globals::rtti::BSLightingShaderPropertyRTTI.get() ? static_cast(property1.get()) : nullptr; if (lightProperty != nullptr) { diff --git a/src/Features/SkySync.cpp b/src/Features/SkySync.cpp index efacb64273..24af218512 100644 --- a/src/Features/SkySync.cpp +++ b/src/Features/SkySync.cpp @@ -322,7 +322,7 @@ inline float SkySync::CalculateVisibility(const RE::NiPoint3& dir, const float d inline void SkySync::SetSunBaseVisibility(const RE::Sun* sun, const float visibility) { - if (const auto property = skyrim_cast(sun->sunBase->GetGeometryRuntimeData().properties[1].get())) + if (const auto property = skyrim_cast(sun->sunBase->GetGeometryRuntimeData().shaderProperty.get())) property->kBlendColor.alpha = visibility; } @@ -489,7 +489,7 @@ void SkySync::Moon_Update::thunk(RE::Moon* moon, RE::Sky* sky) if (auto& singleton = globals::features::skySync; singleton.settings.Enabled && updateMoonTexture != moon->updateMoonTexture) { // Gets the texture name of the current moon phase when it changes rather than reading direct global variables // Allows for compatability with other mods that don't directly update the in-game phase values - const auto moonShaderProperty = skyrim_cast(moon->moonMesh->GetGeometryRuntimeData().properties[1].get()); + const auto moonShaderProperty = skyrim_cast(moon->moonMesh->GetGeometryRuntimeData().shaderProperty.get()); const auto name = moonShaderProperty->GetBaseTexture()->name.c_str(); const size_t len = std::strlen(name); diff --git a/src/Features/Skylighting.cpp b/src/Features/Skylighting.cpp index 42cf15a94d..85b47af139 100644 --- a/src/Features/Skylighting.cpp +++ b/src/Features/Skylighting.cpp @@ -347,7 +347,7 @@ enum class ShaderTechnique ////////////////////////////////////////////////////////////// -RE::BSLightingShaderProperty::Data* Skylighting::BSLightingShaderProperty_GetPrecipitationOcclusionMapRenderPassesImpl::thunk( +RE::BSShaderProperty::RenderPassArray* Skylighting::BSLightingShaderProperty_GetPrecipitationOcclusionMapRenderPassesImpl::thunk( RE::BSLightingShaderProperty* property, RE::BSGeometry* geometry, [[maybe_unused]] uint32_t renderMode, @@ -361,7 +361,7 @@ RE::BSLightingShaderProperty::Data* Skylighting::BSLightingShaderProperty_GetPre using enum RE::BSShaderProperty::EShaderPropertyFlag; using enum RE::BSUtilityShader::Flags; - auto* precipitationOcclusionMapRenderPassList = &property->unk0C8; + auto* precipitationOcclusionMapRenderPassList = &property->occlusionPasses; precipitationOcclusionMapRenderPassList->Clear(); if (skylighting.inOcclusion) { @@ -420,7 +420,7 @@ RE::BSLightingShaderProperty::Data* Skylighting::BSLightingShaderProperty_GetPre technique.set(Vc); } - const auto alphaProperty = static_cast(geometry->GetGeometryRuntimeData().properties[0].get()); + const auto alphaProperty = static_cast(geometry->GetGeometryRuntimeData().alphaProperty.get()); if (alphaProperty && alphaProperty->GetAlphaTesting()) { technique.set(Texture); technique.set(AlphaTest); @@ -511,8 +511,8 @@ void Skylighting::RenderOcclusion() } if (precipObject) { precip->SetupMask(); - auto effect = precipObject->GetGeometryRuntimeData().properties[RE::BSGeometry::States::kEffect]; - auto shaderProp = netimmerse_cast(effect.get()); + auto& effect = precipObject->GetGeometryRuntimeData().shaderProperty; + auto shaderProp = effect.get(); auto particleShaderProperty = netimmerse_cast(shaderProp); auto rain = (RE::BSParticleShaderRainEmitter*)(particleShaderProperty->particleEmitter); diff --git a/src/Features/Skylighting.h b/src/Features/Skylighting.h index 10b4b10364..14de35a485 100644 --- a/src/Features/Skylighting.h +++ b/src/Features/Skylighting.h @@ -97,7 +97,7 @@ struct Skylighting : Feature // Hooks struct BSLightingShaderProperty_GetPrecipitationOcclusionMapRenderPassesImpl { - static RE::BSLightingShaderProperty::Data* thunk(RE::BSLightingShaderProperty* property, RE::BSGeometry* geometry, uint32_t renderMode, RE::BSGraphics::BSShaderAccumulator* accumulator); + static RE::BSShaderProperty::RenderPassArray* thunk(RE::BSLightingShaderProperty* property, RE::BSGeometry* geometry, uint32_t renderMode, RE::BSGraphics::BSShaderAccumulator* accumulator); static inline REL::Relocation func; }; diff --git a/src/Features/TerrainHelper.cpp b/src/Features/TerrainHelper.cpp index 9463984bb5..852017d243 100644 --- a/src/Features/TerrainHelper.cpp +++ b/src/Features/TerrainHelper.cpp @@ -42,7 +42,7 @@ bool TerrainHelper::TESObjectLAND_SetupMaterial(RE::TESObjectLAND* land) const auto& children = land->loadedData->mesh[quadI]->GetChildren(); auto geometry = children.empty() ? nullptr : static_cast(children[0].get()); if (geometry != nullptr) { - const auto shaderProp = static_cast(geometry->GetGeometryRuntimeData().properties[1].get()); + const auto shaderProp = static_cast(geometry->GetGeometryRuntimeData().shaderProperty.get()); if (shaderProp != nullptr) { hashKey = shaderProp->GetBaseMaterial()->hashKey; } diff --git a/src/Features/UnifiedWater.cpp b/src/Features/UnifiedWater.cpp index c78d92f4f5..15980fa334 100644 --- a/src/Features/UnifiedWater.cpp +++ b/src/Features/UnifiedWater.cpp @@ -412,7 +412,7 @@ void UnifiedWater::BGSTerrainBlock_Attach::thunk(RE::BGSTerrainBlock* block) for (auto& [shape, instruction] : built) { waterSystem->AddWater(shape, instruction->form.ptr, instruction->waterHeight, nullptr, true, false); - if (const auto prop = shape->GetGeometryRuntimeData().properties[1].get(); prop && prop->GetRTTI() == globals::rtti::BSWaterShaderPropertyRTTI.get()) { + if (const auto prop = shape->GetGeometryRuntimeData().shaderProperty.get(); prop && prop->GetRTTI() == globals::rtti::BSWaterShaderPropertyRTTI.get()) { const auto waterShaderProp = static_cast(prop); REX::EnumSet waterFlags = static_cast(0b10000100); waterFlags |= RE::BSWaterShaderProperty::WaterFlag::kUseCubemapReflections; @@ -464,7 +464,7 @@ void UnifiedWater::BSWaterShader_SetupGeometry::thunk(RE::BSShader* waterShader, singleton.gDisplacementMeshFlowCellOffset->x = static_cast(singleton.flowmap->GetHeight()); // ObjectUV.y singleton.gDisplacementMeshFlowCellOffset->y = 1.0f - pass->geometry->local.scale; // ObjectUV.z (counters 1 - x in SetupGeometry) - if (const auto prop = pass->geometry->GetGeometryRuntimeData().properties[1].get(); prop && prop->GetRTTI() == globals::rtti::BSWaterShaderPropertyRTTI.get()) { + if (const auto prop = pass->geometry->GetGeometryRuntimeData().shaderProperty.get(); prop && prop->GetRTTI() == globals::rtti::BSWaterShaderPropertyRTTI.get()) { const auto waterShaderProp = static_cast(prop); int32_t x, y; Util::WorldToCell(pass->geometry->world.translate, x, y); diff --git a/src/Features/WetnessEffects.cpp b/src/Features/WetnessEffects.cpp index 523b48e264..4307013b63 100644 --- a/src/Features/WetnessEffects.cpp +++ b/src/Features/WetnessEffects.cpp @@ -572,8 +572,8 @@ float WetnessEffects::GetRainIntensity(RE::NiPointer precipObjec return 0.0f; } - auto& effect = precipObject->GetGeometryRuntimeData().properties[RE::BSGeometry::States::kEffect]; - auto shaderProp = netimmerse_cast(effect.get()); + auto& effect = precipObject->GetGeometryRuntimeData().shaderProperty; + auto shaderProp = effect.get(); auto particleShaderProperty = netimmerse_cast(shaderProp); if (!particleShaderProperty || !particleShaderProperty->particleEmitter) { @@ -713,8 +713,8 @@ WetnessEffects::PerFrame WetnessEffects::GetCommonBufferData() const precipObject = precip->lastPrecip; } if (precipObject) { - auto& effect = precipObject->GetGeometryRuntimeData().properties[RE::BSGeometry::States::kEffect]; - auto shaderProp = netimmerse_cast(effect.get()); + auto& effect = precipObject->GetGeometryRuntimeData().shaderProperty; + auto shaderProp = effect.get(); auto particleShaderProperty = netimmerse_cast(shaderProp); auto rain = (RE::BSParticleShaderRainEmitter*)(particleShaderProperty->particleEmitter); data.OcclusionViewProj = rain->occlusionProjection; diff --git a/src/Hooks.cpp b/src/Hooks.cpp index 5f86ba08a9..156d754d66 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -206,7 +206,7 @@ namespace GrassExtensions state->permutationData.ExtraShaderDescriptor &= ~static_cast(State::ExtraShaderDescriptors::GrassSphereNormal); - if (auto* shaderProperty = static_cast(pass->geometry->GetGeometryRuntimeData().properties[1].get())) { + if (auto* shaderProperty = static_cast(pass->geometry->GetGeometryRuntimeData().shaderProperty.get())) { if (shaderProperty->flags.any(RE::BSShaderProperty::EShaderPropertyFlag::kEffectLighting)) { state->permutationData.ExtraShaderDescriptor |= static_cast(State::ExtraShaderDescriptors::GrassSphereNormal); } diff --git a/src/ShaderCache.cpp b/src/ShaderCache.cpp index 38bbe586ab..4fa63bc53c 100644 --- a/src/ShaderCache.cpp +++ b/src/ShaderCache.cpp @@ -1500,7 +1500,7 @@ namespace SIE std::unique_ptr newShader{ shaderPtr }; newShader->byteCodeSize = (uint32_t)shaderData.GetBufferSize(); newShader->id = descriptor; - newShader->shaderDesc = 0; + newShader->vertexDesc = 0; winrt::com_ptr reflector; const auto reflectionResult = D3DReflect(shaderData.GetBufferPointer(), shaderData.GetBufferSize(), @@ -1511,7 +1511,7 @@ namespace SIE } else { std::array bufferSizes = { 0, 0, 0 }; std::fill(newShader->constantTable.begin(), newShader->constantTable.end(), static_cast(0)); - ReflectConstantBuffers(*reflector.get(), bufferSizes, newShader->constantTable, newShader->shaderDesc, + ReflectConstantBuffers(*reflector.get(), bufferSizes, newShader->constantTable, newShader->vertexDesc, ShaderClass::Vertex, descriptor, shader); if (bufferSizes[0] != 0) { newShader->constantBuffers[0].buffer = diff --git a/src/TruePBR.cpp b/src/TruePBR.cpp index b1918a17a8..60a6dc038c 100644 --- a/src/TruePBR.cpp +++ b/src/TruePBR.cpp @@ -621,7 +621,7 @@ struct BSLightingShaderProperty_LoadBinary } else { material = RE::BSLightingShaderMaterialBase::CreateMaterial(feature); } - property->LinkMaterial(nullptr, false); + property->SetMaterial(nullptr, false); property->material = material; } @@ -1162,7 +1162,7 @@ bool TruePBR::TESObjectLAND_SetupMaterial(RE::TESObjectLAND* land) { BSLightingShaderMaterialPBRLandscape srcMaterial; - shaderProperty->LinkMaterial(&srcMaterial, true); + shaderProperty->SetMaterial(&srcMaterial, true); } auto material = static_cast(shaderProperty->material); @@ -1212,7 +1212,7 @@ bool TruePBR::TESObjectLAND_SetupMaterial(RE::TESObjectLAND* land) auto geometry = children.empty() ? nullptr : static_cast(children[0].get()); shaderProperty->SetupGeometry(geometry); if (geometry != nullptr) { - geometry->GetGeometryRuntimeData().properties[1] = RE::NiPointer(shaderProperty); + geometry->GetGeometryRuntimeData().shaderProperty = RE::NiPointer(shaderProperty); } globals::game::smState->shadowSceneNode[0]->AttachObject(geometry); @@ -1255,12 +1255,12 @@ struct BSTempEffectSimpleDecal_SetupGeometry { func(decal, geometry, textureSet, blended); auto* singleton = globals::truePBR; - auto unknownProperty = geometry->GetGeometryRuntimeData().properties[1].get(); + auto unknownProperty = geometry->GetGeometryRuntimeData().shaderProperty.get(); if (auto shaderProperty = unknownProperty->GetRTTI() == globals::rtti::BSLightingShaderPropertyRTTI.get() ? static_cast(unknownProperty) : nullptr; shaderProperty != nullptr && singleton->IsPBRTextureSet(textureSet)) { { BSLightingShaderMaterialPBR srcMaterial; - shaderProperty->LinkMaterial(&srcMaterial, true); + shaderProperty->SetMaterial(&srcMaterial, true); } auto pbrMaterial = static_cast(shaderProperty->material); @@ -1299,7 +1299,7 @@ struct BSTempEffectGeometryDecal_Initialize { BSLightingShaderMaterialPBR srcMaterial; - shaderProperty->LinkMaterial(&srcMaterial, true); + shaderProperty->SetMaterial(&srcMaterial, true); } auto pbrMaterial = static_cast(shaderProperty->material); @@ -1321,12 +1321,12 @@ struct BSTempEffectGeometryDecal_Initialize shaderProperty->SetFlags(kVertexLighting, true); } - if (auto* alphaProperty = static_cast(decal->decal->GetGeometryRuntimeData().properties[0].get())) { + if (auto* alphaProperty = static_cast(decal->decal->GetGeometryRuntimeData().alphaProperty.get())) { alphaProperty->alphaFlags = (alphaProperty->alphaFlags & ~0x1FE) | 0xED; } shaderProperty->SetupGeometry(decal->decal.get()); - decal->decal->GetGeometryRuntimeData().properties[1] = RE::NiPointer(shaderProperty); + decal->decal->GetGeometryRuntimeData().shaderProperty = RE::NiPointer(shaderProperty); } } static inline REL::Relocation func; @@ -1343,7 +1343,7 @@ struct TESBoundObject_Clone3D if (stat->data.materialObj != nullptr && stat->data.materialObj->directionalData.singlePass) { if (auto* pbrData = truePBR->GetPBRMaterialObjectData(stat->data.materialObj)) { RE::BSVisit::TraverseScenegraphGeometries(result, [pbrData](RE::BSGeometry* geometry) { - if (auto* shaderProperty = static_cast(geometry->GetGeometryRuntimeData().properties[1].get())) { + if (auto* shaderProperty = static_cast(geometry->GetGeometryRuntimeData().shaderProperty.get())) { if (shaderProperty->GetMaterialType() == RE::BSShaderMaterial::Type::kLighting && shaderProperty->flags.any(RE::BSShaderProperty::EShaderPropertyFlag::kVertexLighting)) { if (auto* material = static_cast(shaderProperty->material)) { diff --git a/src/Utils/GameSetting.cpp b/src/Utils/GameSetting.cpp index f42b1ee8d0..9b286871b6 100644 --- a/src/Utils/GameSetting.cpp +++ b/src/Utils/GameSetting.cpp @@ -240,13 +240,14 @@ namespace Util case RE::Setting::Type::kFloat: RenderImGuiElement(settingName, settingData, &setting->data.f, collectionName); break; - case RE::Setting::Type::kSignedInteger: + case RE::Setting::Type::kInteger: RenderImGuiElement(settingName, settingData, &setting->data.i, collectionName); break; case RE::Setting::Type::kUnsignedInteger: RenderImGuiElement(settingName, settingData, &setting->data.u, collectionName); break; - case RE::Setting::Type::kColor: + case RE::Setting::Type::kColorRGB: + case RE::Setting::Type::kColorRGBA: case RE::Setting::Type::kString: case RE::Setting::Type::kUnknown: default: