Skip to content

Commit

Permalink
Disable r.InstanceCulling.OcclusionCull by default to fix crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 17, 2023
1 parent e972951 commit 11b0f10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/mods/VR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,14 @@ void VR::update_hmd_state(bool from_view_extensions, uint32_t frame_count) {
sdk::set_cvar_int(L"Renderer", L"r.HZBOcclusion", 0);
}
}

if (m_disable_instance_culling->value()) {
const auto r_instance_culling_value = sdk::get_cvar_int(L"Renderer", L"r.InstanceCulling.OcclusionCull");

if (r_instance_culling_value && *r_instance_culling_value != 0) {
sdk::set_cvar_int(L"Renderer", L"r.InstanceCulling.OcclusionCull", 0);
}
}
}

if (frame_count != 0 && is_using_afr() && frame_count % 2 == 0) {
Expand Down Expand Up @@ -1951,6 +1959,7 @@ void VR::on_draw_ui() {

ImGui::BeginGroup();
m_disable_hzbocclusion->draw("Disable HZBOcclusion");
m_disable_instance_culling->draw("Disable Instance Culling");
m_disable_hdr_compositing->draw("Disable HDR Composition");
m_disable_blur_widgets->draw("Disable Blur Widgets");
m_uncap_framerate->draw("Uncap Framerate");
Expand Down
2 changes: 2 additions & 0 deletions src/mods/VR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ class VR : public Mod {
const ModToggle::Ptr m_disable_blur_widgets{ ModToggle::create(generate_name("DisableBlurWidgets"), true) };
const ModToggle::Ptr m_disable_hdr_compositing{ ModToggle::create(generate_name("DisableHDRCompositing"), true) };
const ModToggle::Ptr m_disable_hzbocclusion{ ModToggle::create(generate_name("DisableHZBOcclusion"), true) };
const ModToggle::Ptr m_disable_instance_culling{ ModToggle::create(generate_name("DisableInstanceCulling"), true) };
const ModToggle::Ptr m_desktop_fix{ ModToggle::create(generate_name("DesktopRecordingFix_V2"), true) };
const ModToggle::Ptr m_enable_gui{ ModToggle::create(generate_name("EnableGUI"), true) };
const ModToggle::Ptr m_enable_depth{ ModToggle::create(generate_name("EnableDepth"), false) };
Expand Down Expand Up @@ -729,6 +730,7 @@ class VR : public Mod {
*m_uncap_framerate,
*m_disable_hdr_compositing,
*m_disable_hzbocclusion,
*m_disable_instance_culling,
*m_desktop_fix,
*m_enable_gui,
*m_enable_depth,
Expand Down

0 comments on commit 11b0f10

Please sign in to comment.