diff --git a/gfx/common/d3d10_common.h b/gfx/common/d3d10_common.h index 3431244fd3..1784c33a8c 100644 --- a/gfx/common/d3d10_common.h +++ b/gfx/common/d3d10_common.h @@ -1208,6 +1208,7 @@ typedef struct D3D10_VIEWPORT viewport; pass_semantics_t semantics; uint32_t frame_count; + int32_t frame_direction; } pass[GFX_MAX_SHADERS]; struct video_shader* shader_preset; diff --git a/gfx/common/d3d11_common.h b/gfx/common/d3d11_common.h index a88336dfc7..ac6332d227 100644 --- a/gfx/common/d3d11_common.h +++ b/gfx/common/d3d11_common.h @@ -2584,6 +2584,7 @@ typedef struct D3D11_VIEWPORT viewport; pass_semantics_t semantics; uint32_t frame_count; + int32_t frame_direction; } pass[GFX_MAX_SHADERS]; struct video_shader* shader_preset; diff --git a/gfx/common/d3d12_common.h b/gfx/common/d3d12_common.h index 5d4e221a3d..d9381dd5a9 100644 --- a/gfx/common/d3d12_common.h +++ b/gfx/common/d3d12_common.h @@ -1444,6 +1444,7 @@ typedef struct D3D12_RECT scissorRect; pass_semantics_t semantics; uint32_t frame_count; + int32_t frame_direction; D3D12_GPU_DESCRIPTOR_HANDLE textures; D3D12_GPU_DESCRIPTOR_HANDLE samplers; } pass[GFX_MAX_SHADERS]; diff --git a/gfx/drivers/d3d10.c b/gfx/drivers/d3d10.c index 79d65a47bb..60fc65d625 100644 --- a/gfx/drivers/d3d10.c +++ b/gfx/drivers/d3d10.c @@ -27,6 +27,7 @@ #include "../../verbosity.h" #include "../../configuration.h" #include "../../retroarch.h" +#include "../../managers/state_manager.h" #include "../video_driver.h" #include "../font_driver.h" @@ -390,10 +391,11 @@ static bool d3d10_gfx_set_shader(void* data, &d3d10->luts[0].size_data, sizeof(*d3d10->luts)}, }, { - &d3d10->mvp, /* MVP */ - &d3d10->pass[i].rt.size_data, /* OutputSize */ - &d3d10->frame.output_size, /* FinalViewportSize */ - &d3d10->pass[i].frame_count, /* FrameCount */ + &d3d10->mvp, /* MVP */ + &d3d10->pass[i].rt.size_data, /* OutputSize */ + &d3d10->frame.output_size, /* FinalViewportSize */ + &d3d10->pass[i].frame_count, /* FrameCount */ + &d3d10->pass[i].frame_direction, /* FrameDirection */ } }; /* clang-format on */ @@ -1283,6 +1285,8 @@ static bool d3d10_gfx_frame( else d3d10->pass[i].frame_count = frame_count; + d3d10->pass[i].frame_direction = state_manager_frame_is_reversed() ? -1 : 1; + for (j = 0; j < SLANG_CBUFFER_MAX; j++) { D3D10Buffer buffer = d3d10->pass[i].buffers[j]; diff --git a/gfx/drivers/d3d11.c b/gfx/drivers/d3d11.c index 14f98dd1bb..125b9b42f8 100644 --- a/gfx/drivers/d3d11.c +++ b/gfx/drivers/d3d11.c @@ -43,6 +43,7 @@ #include "../../menu/menu_driver.h" #include "../video_shader_parse.h" #include "../drivers_shader/slang_preprocess.h" +#include "../../managers/state_manager.h" #include "../common/d3d_common.h" #include "../common/d3d11_common.h" @@ -408,10 +409,11 @@ static bool d3d11_gfx_set_shader(void* data, enum rarch_shader_type type, const &d3d11->luts[0].size_data, sizeof(*d3d11->luts)}, }, { - &d3d11->mvp, /* MVP */ - &d3d11->pass[i].rt.size_data, /* OutputSize */ - &d3d11->frame.output_size, /* FinalViewportSize */ - &d3d11->pass[i].frame_count, /* FrameCount */ + &d3d11->mvp, /* MVP */ + &d3d11->pass[i].rt.size_data, /* OutputSize */ + &d3d11->frame.output_size, /* FinalViewportSize */ + &d3d11->pass[i].frame_count, /* FrameCount */ + &d3d11->pass[i].frame_direction, /* FrameDirection */ } }; /* clang-format on */ @@ -1356,6 +1358,8 @@ static bool d3d11_gfx_frame( else d3d11->pass[i].frame_count = frame_count; + d3d11->pass[i].frame_direction = state_manager_frame_is_reversed() ? -1 : 1; + for (j = 0; j < SLANG_CBUFFER_MAX; j++) { D3D11Buffer buffer = d3d11->pass[i].buffers[j]; diff --git a/gfx/drivers/d3d12.c b/gfx/drivers/d3d12.c index dad01e62fa..d99755dab2 100644 --- a/gfx/drivers/d3d12.c +++ b/gfx/drivers/d3d12.c @@ -32,6 +32,7 @@ #include "../../verbosity.h" #include "../../configuration.h" #include "../../retroarch.h" +#include "../../managers/state_manager.h" #ifdef HAVE_MENU #include "../../menu/menu_driver.h" @@ -398,10 +399,11 @@ static bool d3d12_gfx_set_shader(void* data, enum rarch_shader_type type, const &d3d12->luts[0].size_data, sizeof(*d3d12->luts)}, }, { - &d3d12->mvp, /* MVP */ - &d3d12->pass[i].rt.size_data, /* OutputSize */ - &d3d12->frame.output_size, /* FinalViewportSize */ - &d3d12->pass[i].frame_count, /* FrameCount */ + &d3d12->mvp, /* MVP */ + &d3d12->pass[i].rt.size_data, /* OutputSize */ + &d3d12->frame.output_size, /* FinalViewportSize */ + &d3d12->pass[i].frame_count, /* FrameCount */ + &d3d12->pass[i].frame_direction, /* FrameDirection */ } }; /* clang-format on */ @@ -1294,6 +1296,8 @@ static bool d3d12_gfx_frame( else d3d12->pass[i].frame_count = frame_count; + d3d12->pass[i].frame_direction = state_manager_frame_is_reversed() ? -1 : 1; + for (j = 0; j < SLANG_CBUFFER_MAX; j++) { cbuffer_sem_t* buffer_sem = &d3d12->pass[i].semantics.cbuffers[j];