Skip to content

Commit

Permalink
D3D12: Add initial Extreme Compatibility Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 19, 2023
1 parent 1cb952b commit 0d10dcf
Show file tree
Hide file tree
Showing 4 changed files with 268 additions and 101 deletions.
5 changes: 3 additions & 2 deletions src/mods/VR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1823,15 +1823,15 @@ void VR::on_post_present() {
}

uint32_t VR::get_hmd_width() const {
if (m_2d_screen_mode->value()) {
if (m_2d_screen_mode->value() || m_extreme_compat_mode->value()) {
return g_framework->get_rt_size().x;
}

return get_runtime()->get_width();
}

uint32_t VR::get_hmd_height() const {
if (m_2d_screen_mode->value()) {
if (m_2d_screen_mode->value() || m_extreme_compat_mode->value()) {
return g_framework->get_rt_size().y;
}

Expand Down Expand Up @@ -2061,6 +2061,7 @@ void VR::on_draw_ui() {
ImGui::SetNextItemOpen(true, ImGuiCond_::ImGuiCond_Once);
if (ImGui::TreeNode("Compatibility Options")) {
m_compatibility_skip_pip->draw("Skip PostInitProperties");
m_extreme_compat_mode->draw("Extreme Compatibility Mode");
ImGui::TreePop();
}

Expand Down
12 changes: 10 additions & 2 deletions src/mods/VR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,13 @@ class VR : public Mod {

bool is_using_afr() const {
return m_rendering_method->value() == RenderingMethod::ALTERNATING ||
m_rendering_method->value() == RenderingMethod::SYNCHRONIZED;
m_rendering_method->value() == RenderingMethod::SYNCHRONIZED ||
m_extreme_compat_mode->value() == true;
}

bool is_using_synchronized_afr() const {
return m_rendering_method->value() == RenderingMethod::SYNCHRONIZED;
return m_rendering_method->value() == RenderingMethod::SYNCHRONIZED ||
(m_extreme_compat_mode->value() && m_rendering_method->value() == RenderingMethod::NATIVE_STEREO);
}

SyncedSequentialMethod get_synced_sequential_method() const {
Expand Down Expand Up @@ -459,6 +461,10 @@ class VR : public Mod {
return m_compatibility_skip_pip->value();
}

bool is_extreme_compatibility_mode_enabled() const {
return m_extreme_compat_mode->value();
}

private:
Vector4f get_position_unsafe(uint32_t index) const;
Vector4f get_velocity_unsafe(uint32_t index) const;
Expand Down Expand Up @@ -658,6 +664,7 @@ class VR : public Mod {

const ModCombo::Ptr m_rendering_method{ ModCombo::create(generate_name("RenderingMethod"), s_rendering_method_names) };
const ModCombo::Ptr m_synced_afr_method{ ModCombo::create(generate_name("SyncedSequentialMethod"), s_synced_afr_method_names, 1) };
const ModToggle::Ptr m_extreme_compat_mode{ ModToggle::create(generate_name("ExtremeCompatibilityMode"), false) };
const ModToggle::Ptr m_uncap_framerate{ ModToggle::create(generate_name("UncapFramerate"), true) };
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) };
Expand Down Expand Up @@ -727,6 +734,7 @@ class VR : public Mod {
ValueList m_options{
*m_rendering_method,
*m_synced_afr_method,
*m_extreme_compat_mode,
*m_uncap_framerate,
*m_disable_hdr_compositing,
*m_disable_hzbocclusion,
Expand Down
Loading

0 comments on commit 0d10dcf

Please sign in to comment.