Skip to content

Commit

Permalink
build: bump commonlibng to 3.7.0 (#236)
Browse files Browse the repository at this point in the history
* build: bump commonlibng to 3.7.0

Due to an upstream breaking change, any access to winapi namespace is
now under the REX::D3D namespace. This means that accessing various D3D
objects will need a cast.

* style: 🎨 apply clang-format changes

* refactor: move renderer objects to State

closes Refactor to consolidate variables from `RE::BSGraphics::Renderer` #237
  • Loading branch information
alandtse authored Mar 31, 2024
1 parent d87ae9c commit 79b7abd
Show file tree
Hide file tree
Showing 27 changed files with 110 additions and 116 deletions.
2 changes: 1 addition & 1 deletion extern/CommonLibSSE-NG
Submodule CommonLibSSE-NG updated 180 files
1 change: 0 additions & 1 deletion include/PCH.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ namespace stl
}

namespace logger = SKSE::log;
namespace WinAPI = SKSE::WinAPI;

namespace util
{
Expand Down
19 changes: 10 additions & 9 deletions src/Bindings.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include "Bindings.h"
#include "State.h"
#include "Util.h"

void Bindings::DepthStencilStateSetDepthMode(RE::BSGraphics::DepthStencilDepthMode a_mode)
{
auto state = RE::BSGraphics::RendererShadowState::GetSingleton();
auto& state = State::GetSingleton()->shadowState;
GET_INSTANCE_MEMBER(depthStencilDepthMode, state)
GET_INSTANCE_MEMBER(depthStencilDepthModePrevious, state)
GET_INSTANCE_MEMBER(stateUpdateFlags, state)
Expand All @@ -19,7 +20,7 @@ void Bindings::DepthStencilStateSetDepthMode(RE::BSGraphics::DepthStencilDepthMo

void Bindings::AlphaBlendStateSetMode(uint32_t a_mode)
{
auto state = RE::BSGraphics::RendererShadowState::GetSingleton();
auto& state = State::GetSingleton()->shadowState;
GET_INSTANCE_MEMBER(alphaBlendMode, state)
GET_INSTANCE_MEMBER(stateUpdateFlags, state)

Expand All @@ -31,7 +32,7 @@ void Bindings::AlphaBlendStateSetMode(uint32_t a_mode)

void Bindings::AlphaBlendStateSetAlphaToCoverage(uint32_t a_value)
{
auto state = RE::BSGraphics::RendererShadowState::GetSingleton();
auto& state = State::GetSingleton()->shadowState;
GET_INSTANCE_MEMBER(alphaBlendAlphaToCoverage, state)
GET_INSTANCE_MEMBER(stateUpdateFlags, state)

Expand All @@ -43,7 +44,7 @@ void Bindings::AlphaBlendStateSetAlphaToCoverage(uint32_t a_value)

void Bindings::AlphaBlendStateSetWriteMode(uint32_t a_value)
{
auto state = RE::BSGraphics::RendererShadowState::GetSingleton();
auto& state = State::GetSingleton()->shadowState;
GET_INSTANCE_MEMBER(alphaBlendWriteMode, state)
GET_INSTANCE_MEMBER(stateUpdateFlags, state)

Expand All @@ -57,7 +58,7 @@ void Bindings::SetOverwriteTerrainMode(bool a_enable)
{
if (overrideTerrain != a_enable) {
overrideTerrain = a_enable;
auto state = RE::BSGraphics::RendererShadowState::GetSingleton();
auto& state = State::GetSingleton()->shadowState;
GET_INSTANCE_MEMBER(stateUpdateFlags, state)
stateUpdateFlags.set(RE::BSGraphics::ShaderFlags::DIRTY_DEPTH_MODE);
stateUpdateFlags.set(RE::BSGraphics::ShaderFlags::DIRTY_ALPHA_BLEND);
Expand All @@ -68,7 +69,7 @@ void Bindings::SetOverwriteTerrainMaskingMode(TerrainMaskMode a_mode)
{
if (terrainMask != a_mode) {
terrainMask = a_mode;
auto state = RE::BSGraphics::RendererShadowState::GetSingleton();
auto& state = State::GetSingleton()->shadowState;
GET_INSTANCE_MEMBER(stateUpdateFlags, state)
stateUpdateFlags.set(RE::BSGraphics::ShaderFlags::DIRTY_RENDERTARGET);
}
Expand All @@ -88,8 +89,8 @@ struct BlendStates

void Bindings::SetDirtyStates(bool)
{
auto state = RE::BSGraphics::RendererShadowState::GetSingleton();
auto context = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context;
auto& state = State::GetSingleton()->shadowState;
auto& context = State::GetSingleton()->context;
GET_INSTANCE_MEMBER(depthStencilStencilMode, state)
GET_INSTANCE_MEMBER(depthStencilDepthMode, state)
GET_INSTANCE_MEMBER(alphaBlendAlphaToCoverage, state)
Expand Down Expand Up @@ -261,7 +262,7 @@ void Bindings::Reset()
//SetOverwriteTerrainMode(false);
//SetOverwriteTerrainMaskingMode(TerrainMaskMode::kNone);

//auto context = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context;
//auto& context = State::GetSingleton()->context;
//FLOAT clear[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
//context->ClearRenderTargetView(terrainBlendingMask->rtv.get(), clear);
}
40 changes: 20 additions & 20 deletions src/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ class ConstantBuffer
ConstantBuffer(D3D11_BUFFER_DESC const& a_desc)
{
desc = a_desc;
auto device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
auto device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateBuffer(&desc, nullptr, resource.ReleaseAndGetAddressOf()));
}

ID3D11Buffer* CB() const { return resource.Get(); }

void Update(void const* src_data, size_t data_size)
{
ID3D11DeviceContext* ctx = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context;
ID3D11DeviceContext* ctx = reinterpret_cast<ID3D11DeviceContext*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context);
if (desc.Usage & D3D11_USAGE_DYNAMIC) {
D3D11_MAPPED_SUBRESOURCE mapped_buffer{};
ZeroMemory(&mapped_buffer, sizeof(D3D11_MAPPED_SUBRESOURCE));
Expand Down Expand Up @@ -98,7 +98,7 @@ class StructuredBuffer
{
desc = a_desc;
count = a_count;
auto device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
auto device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateBuffer(&desc, nullptr, resource.ReleaseAndGetAddressOf()));
}

Expand All @@ -107,7 +107,7 @@ class StructuredBuffer

virtual void CreateSRV()
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc{};
srv_desc.Format = DXGI_FORMAT_UNKNOWN;
srv_desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX;
Expand All @@ -120,7 +120,7 @@ class StructuredBuffer

virtual void CreateUAV()
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
D3D11_UNORDERED_ACCESS_VIEW_DESC uav_desc{};
uav_desc.Format = DXGI_FORMAT_UNKNOWN;
uav_desc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER;
Expand All @@ -134,7 +134,7 @@ class StructuredBuffer

void Update(void const* src_data, [[maybe_unused]] size_t data_size)
{
ID3D11DeviceContext* ctx = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context;
ID3D11DeviceContext* ctx = reinterpret_cast<ID3D11DeviceContext*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context);
D3D11_MAPPED_SUBRESOURCE mapped_buffer{};
ZeroMemory(&mapped_buffer, sizeof(D3D11_MAPPED_SUBRESOURCE));
DX::ThrowIfFailed(ctx->Map(resource.Get(), 0u, D3D11_MAP_WRITE_DISCARD, 0u, &mapped_buffer));
Expand All @@ -161,18 +161,18 @@ class Buffer
Buffer(D3D11_BUFFER_DESC const& a_desc, D3D11_SUBRESOURCE_DATA* a_init = nullptr)
{
desc = a_desc;
auto device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
auto device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateBuffer(&desc, a_init, resource.put()));
}

void CreateSRV(D3D11_SHADER_RESOURCE_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateShaderResourceView(resource.get(), &a_desc, srv.put()));
}
void CreateUAV(D3D11_UNORDERED_ACCESS_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateUnorderedAccessView(resource.get(), &a_desc, uav.put()));
}

Expand All @@ -188,24 +188,24 @@ class Texture1D
Texture1D(D3D11_TEXTURE1D_DESC const& a_desc)
{
desc = a_desc;
auto device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
auto device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateTexture1D(&desc, nullptr, resource.put()));
}

void CreateSRV(D3D11_SHADER_RESOURCE_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateShaderResourceView(resource.get(), &a_desc, srv.put()));
}
void CreateUAV(D3D11_UNORDERED_ACCESS_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateUnorderedAccessView(resource.get(), &a_desc, uav.put()));
}

void CreateRTV(D3D11_RENDER_TARGET_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateRenderTargetView(resource.get(), &a_desc, rtv.put()));
}

Expand All @@ -222,7 +222,7 @@ class Texture2D
Texture2D(D3D11_TEXTURE2D_DESC const& a_desc)
{
desc = a_desc;
auto device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
auto device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateTexture2D(&desc, nullptr, resource.put()));
}

Expand All @@ -234,18 +234,18 @@ class Texture2D

void CreateSRV(D3D11_SHADER_RESOURCE_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateShaderResourceView(resource.get(), &a_desc, srv.put()));
}
void CreateUAV(D3D11_UNORDERED_ACCESS_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateUnorderedAccessView(resource.get(), &a_desc, uav.put()));
}

void CreateRTV(D3D11_RENDER_TARGET_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateRenderTargetView(resource.get(), &a_desc, rtv.put()));
}

Expand All @@ -262,18 +262,18 @@ class Texture3D
Texture3D(D3D11_TEXTURE3D_DESC const& a_desc)
{
desc = a_desc;
auto device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
auto device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateTexture3D(&desc, nullptr, resource.put()));
}

void CreateSRV(D3D11_SHADER_RESOURCE_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateShaderResourceView(resource.get(), &a_desc, srv.put()));
}
void CreateUAV(D3D11_UNORDERED_ACCESS_VIEW_DESC const& a_desc)
{
ID3D11Device* device = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder;
ID3D11Device* device = reinterpret_cast<ID3D11Device*>(RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().forwarder);
DX::ThrowIfFailed(device->CreateUnorderedAccessView(resource.get(), &a_desc, uav.put()));
}

Expand Down
18 changes: 9 additions & 9 deletions src/Features/CloudShadows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void CloudShadows::CheckResourcesSide(int side)
if (!frame_checker[side].isNewFrame())
return;

auto context = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context;
auto& context = State::GetSingleton()->context;

float black[4] = { 0, 0, 0, 0 };
context->ClearRenderTargetView(cubemapCloudOccRTVs[side], black);
Expand All @@ -85,7 +85,7 @@ void CloudShadows::ModifySky(const RE::BSShader*, const uint32_t descriptor)
if (!settings.EnableCloudShadows)
return;

auto shadowState = RE::BSGraphics::RendererShadowState::GetSingleton();
auto& shadowState = State::GetSingleton()->shadowState;
auto cubeMapRenderTarget = !REL::Module::IsVR() ? shadowState->GetRuntimeData().cubeMapRenderTarget : shadowState->GetVRRuntimeData().cubeMapRenderTarget;
if (cubeMapRenderTarget != RE::RENDER_TARGETS_CUBEMAP::kREFLECTIONS)
return;
Expand All @@ -106,8 +106,8 @@ void CloudShadows::ModifySky(const RE::BSShader*, const uint32_t descriptor)
auto tech_enum = static_cast<SkyShaderTechniques>(descriptor);
if (tech_enum == SkyShaderTechniques::Clouds || tech_enum == SkyShaderTechniques::CloudsLerp || tech_enum == SkyShaderTechniques::CloudsFade) {
auto renderer = RE::BSGraphics::Renderer::GetSingleton();
auto context = renderer->GetRuntimeData().context;
auto device = renderer->GetRuntimeData().forwarder;
auto& context = State::GetSingleton()->context;
auto& device = State::GetSingleton()->device;

{
ID3D11ShaderResourceView* srv = nullptr;
Expand Down Expand Up @@ -165,9 +165,9 @@ void CloudShadows::ModifySky(const RE::BSShader*, const uint32_t descriptor)

void CloudShadows::ModifyLighting()
{
auto context = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context;
auto& context = State::GetSingleton()->context;

auto shadowState = RE::BSGraphics::RendererShadowState::GetSingleton();
auto& shadowState = State::GetSingleton()->shadowState;
auto cubeMapRenderTarget = !REL::Module::IsVR() ? shadowState->GetRuntimeData().cubeMapRenderTarget : shadowState->GetVRRuntimeData().cubeMapRenderTarget;
if (cubeMapRenderTarget != RE::RENDER_TARGETS_CUBEMAP::kREFLECTIONS) {
static Util::FrameChecker frame_checker;
Expand All @@ -191,7 +191,7 @@ void CloudShadows::Draw(const RE::BSShader* shader, const uint32_t descriptor)
static Util::FrameChecker frame_checker;
if (frame_checker.isNewFrame()) {
// update settings buffer
auto context = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context;
auto& context = State::GetSingleton()->context;

PerPass perPassData{};

Expand Down Expand Up @@ -237,7 +237,7 @@ void CloudShadows::Save(json& o_json)
void CloudShadows::SetupResources()
{
auto renderer = RE::BSGraphics::Renderer::GetSingleton();
auto device = renderer->GetRuntimeData().forwarder;
auto& device = State::GetSingleton()->device;

{
auto reflections = renderer->GetRendererData().cubemapRenderTargets[RE::RENDER_TARGET_CUBEMAP::kREFLECTIONS];
Expand Down Expand Up @@ -290,7 +290,7 @@ void CloudShadows::RestoreDefaultSettings()
void CloudShadows::Hooks::BSBatchRenderer__RenderPassImmediately::thunk(RE::BSRenderPass* Pass, uint32_t Technique, bool AlphaTest, uint32_t RenderFlags)
{
auto feat = GetSingleton();
auto context = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context;
auto& context = State::GetSingleton()->context;

func(Pass, Technique, AlphaTest, RenderFlags);

Expand Down
2 changes: 1 addition & 1 deletion src/Features/DistantTreeLighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void DistantTreeLighting::ModifyDistantTree(const RE::BSShader*, const uint32_t

perPass->Update(perPassData);

auto context = RE::BSGraphics::Renderer::GetSingleton()->GetRuntimeData().context;
auto& context = State::GetSingleton()->context;

ID3D11Buffer* buffers[2];
context->VSGetConstantBuffers(2, 1, buffers); // buffers[0]
Expand Down
18 changes: 8 additions & 10 deletions src/Features/DynamicCubemaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ void DynamicCubemaps::DrawSettings()
ImGui::ColorEdit3("Color", (float*)&cubemapColor);
ImGui::SliderFloat("Roughness", &cubemapColor.w, 0.0f, 1.0f, "%.2f");
if (ImGui::Button("Export")) {
auto renderer = RE::BSGraphics::Renderer::GetSingleton();
auto device = renderer->GetRuntimeData().forwarder;
auto context = renderer->GetRuntimeData().context;
auto& device = State::GetSingleton()->device;
auto& context = State::GetSingleton()->context;

D3D11_TEXTURE2D_DESC texDesc{};
texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
Expand Down Expand Up @@ -222,7 +221,7 @@ void DynamicCubemaps::UpdateCubemapCapture()
{
auto renderer = RE::BSGraphics::Renderer::GetSingleton();

auto context = renderer->GetRuntimeData().context;
auto& context = State::GetSingleton()->context;

auto& depth = renderer->GetDepthStencilData().depthStencils[RE::RENDER_TARGETS_DEPTHSTENCIL::kPOST_ZPREPASS_COPY];
auto& snowSwap = renderer->GetRuntimeData().renderTargets[RE::RENDER_TARGETS::kSNOW_SWAP];
Expand All @@ -243,7 +242,7 @@ void DynamicCubemaps::UpdateCubemapCapture()
static float3 cameraPreviousPosAdjust = { 0, 0, 0 };
updateData.CameraPreviousPosAdjust = cameraPreviousPosAdjust;

auto state = RE::BSGraphics::RendererShadowState::GetSingleton();
auto& state = State::GetSingleton()->shadowState;
auto eyePosition = !REL::Module::IsVR() ?
state->GetRuntimeData().posAdjust.getEye(0) :
state->GetVRRuntimeData().posAdjust.getEye(0);
Expand Down Expand Up @@ -297,7 +296,7 @@ void DynamicCubemaps::DrawDeferred()
void DynamicCubemaps::UpdateCubemap()
{
auto renderer = RE::BSGraphics::Renderer::GetSingleton();
auto context = renderer->GetRuntimeData().context;
auto& context = State::GetSingleton()->context;

//if (!REL::Module::IsVR()) {
// auto imageSpaceManager = RE::ImageSpaceManager::GetSingleton();
Expand Down Expand Up @@ -397,14 +396,13 @@ void DynamicCubemaps::Draw(const RE::BSShader* shader, const uint32_t)
{
if (shader->shaderType.get() == RE::BSShader::Type::Lighting || shader->shaderType.get() == RE::BSShader::Type::Water) {
// During world cubemap generation we cannot use the cubemap
auto shadowState = RE::BSGraphics::RendererShadowState::GetSingleton();
auto& shadowState = State::GetSingleton()->shadowState;
auto cubeMapRenderTarget = !REL::Module::IsVR() ? shadowState->GetRuntimeData().cubeMapRenderTarget : shadowState->GetVRRuntimeData().cubeMapRenderTarget;
if (cubeMapRenderTarget != RE::RENDER_TARGETS_CUBEMAP::kREFLECTIONS && !renderedScreenCamera) {
UpdateCubemap();
renderedScreenCamera = true;

auto renderer = RE::BSGraphics::Renderer::GetSingleton();
auto context = renderer->GetRuntimeData().context;
auto& context = State::GetSingleton()->context;

if (enableCreator) {
CreatorSettingsCB data{};
Expand Down Expand Up @@ -434,7 +432,7 @@ void DynamicCubemaps::SetupResources()
GetComputeShaderSpecularIrradiance();

auto renderer = RE::BSGraphics::Renderer::GetSingleton();
auto device = renderer->GetRuntimeData().forwarder;
auto& device = State::GetSingleton()->device;

{
D3D11_SAMPLER_DESC samplerDesc = {};
Expand Down
1 change: 1 addition & 0 deletions src/Features/DynamicCubemaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "Buffer.h"
#include "Feature.h"
#include "State.h"

class MenuOpenCloseEventHandler : public RE::BSTEventSink<RE::MenuOpenCloseEvent>
{
Expand Down
Loading

0 comments on commit 79b7abd

Please sign in to comment.