win-capture: Remove D3D12 fix toggle
The new D3D12 path seems stable enough. Remove the old path.
This commit is contained in:
parent
7bdd384fd5
commit
924d9a7d9c
@ -34,6 +34,4 @@ GameCapture.HookRate.Slow="Slow"
|
||||
GameCapture.HookRate.Normal="Normal (recommended)"
|
||||
GameCapture.HookRate.Fast="Fast"
|
||||
GameCapture.HookRate.Fastest="Fastest"
|
||||
GameCapture.D3D12UseSwapQueue="Attempt to fix synchronization for Direct3D 12"
|
||||
GameCapture.D3D12UseSwapQueue.Long="Fix is best effort, and not perfect. Disable if game becomes unstable."
|
||||
Mode="Mode"
|
||||
|
@ -37,7 +37,6 @@
|
||||
#define SETTING_LIMIT_FRAMERATE "limit_framerate"
|
||||
#define SETTING_CAPTURE_OVERLAYS "capture_overlays"
|
||||
#define SETTING_ANTI_CHEAT_HOOK "anti_cheat_hook"
|
||||
#define SETTING_D3D12_USE_SWAP_QUEUE "d3d12_use_swap_queue"
|
||||
#define SETTING_HOOK_RATE "hook_rate"
|
||||
|
||||
/* deprecated */
|
||||
@ -69,8 +68,6 @@
|
||||
#define TEXT_HOOK_RATE_NORMAL obs_module_text("GameCapture.HookRate.Normal")
|
||||
#define TEXT_HOOK_RATE_FAST obs_module_text("GameCapture.HookRate.Fast")
|
||||
#define TEXT_HOOK_RATE_FASTEST obs_module_text("GameCapture.HookRate.Fastest")
|
||||
#define TEXT_D3D12_SWAP_QUEUE obs_module_text("GameCapture.D3D12UseSwapQueue")
|
||||
#define TEXT_D3D12_SWAP_QUEUE_LONG obs_module_text("GameCapture.D3D12UseSwapQueue.Long")
|
||||
|
||||
#define TEXT_MODE_ANY TEXT_ANY_FULLSCREEN
|
||||
#define TEXT_MODE_WINDOW obs_module_text("GameCapture.CaptureWindow")
|
||||
@ -109,7 +106,6 @@ struct game_capture_config {
|
||||
bool limit_framerate;
|
||||
bool capture_overlays;
|
||||
bool anticheat_hook;
|
||||
bool d3d12_use_swap_queue;
|
||||
enum hook_rate hook_rate;
|
||||
};
|
||||
|
||||
@ -422,8 +418,6 @@ static inline void get_config(struct game_capture_config *cfg,
|
||||
obs_data_get_bool(settings, SETTING_CAPTURE_OVERLAYS);
|
||||
cfg->anticheat_hook =
|
||||
obs_data_get_bool(settings, SETTING_ANTI_CHEAT_HOOK);
|
||||
cfg->d3d12_use_swap_queue =
|
||||
obs_data_get_bool(settings, SETTING_D3D12_USE_SWAP_QUEUE);
|
||||
cfg->hook_rate =
|
||||
(enum hook_rate)obs_data_get_int(settings, SETTING_HOOK_RATE);
|
||||
}
|
||||
@ -457,9 +451,6 @@ static inline bool capture_needs_reset(struct game_capture_config *cfg1,
|
||||
|
||||
} else if (cfg1->capture_overlays != cfg2->capture_overlays) {
|
||||
return true;
|
||||
|
||||
} else if (cfg1->d3d12_use_swap_queue != cfg2->d3d12_use_swap_queue) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -754,8 +745,6 @@ static inline bool init_hook_info(struct game_capture *gc)
|
||||
gc->global_hook_info->force_shmem = gc->config.force_shmem;
|
||||
gc->global_hook_info->UNUSED_use_scale = false;
|
||||
gc->global_hook_info->allow_srgb_alias = true;
|
||||
gc->global_hook_info->d3d12_use_swap_queue =
|
||||
gc->config.d3d12_use_swap_queue;
|
||||
reset_frame_interval(gc);
|
||||
|
||||
obs_enter_graphics();
|
||||
@ -1877,7 +1866,6 @@ static void game_capture_defaults(obs_data_t *settings)
|
||||
obs_data_set_default_bool(settings, SETTING_LIMIT_FRAMERATE, false);
|
||||
obs_data_set_default_bool(settings, SETTING_CAPTURE_OVERLAYS, false);
|
||||
obs_data_set_default_bool(settings, SETTING_ANTI_CHEAT_HOOK, true);
|
||||
obs_data_set_default_bool(settings, SETTING_D3D12_USE_SWAP_QUEUE, true);
|
||||
obs_data_set_default_int(settings, SETTING_HOOK_RATE,
|
||||
(int)HOOK_RATE_NORMAL);
|
||||
}
|
||||
@ -2062,10 +2050,6 @@ static obs_properties_t *game_capture_properties(void *data)
|
||||
obs_properties_add_bool(ppts, SETTING_CAPTURE_OVERLAYS,
|
||||
TEXT_CAPTURE_OVERLAYS);
|
||||
|
||||
p = obs_properties_add_bool(ppts, SETTING_D3D12_USE_SWAP_QUEUE,
|
||||
TEXT_D3D12_SWAP_QUEUE);
|
||||
obs_property_set_long_description(p, TEXT_D3D12_SWAP_QUEUE_LONG);
|
||||
|
||||
p = obs_properties_add_list(ppts, SETTING_HOOK_RATE, TEXT_HOOK_RATE,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
|
||||
obs_property_list_add_int(p, TEXT_HOOK_RATE_SLOW, HOOK_RATE_SLOW);
|
||||
|
@ -109,7 +109,6 @@ struct hook_info {
|
||||
bool flip;
|
||||
|
||||
/* additional options */
|
||||
bool d3d12_use_swap_queue;
|
||||
uint64_t frame_interval;
|
||||
bool UNUSED_use_scale;
|
||||
bool force_shmem;
|
||||
|
@ -12,7 +12,7 @@
|
||||
* THIS IS YOUR ONLY WARNING. */
|
||||
|
||||
#define HOOK_VER_MAJOR 1
|
||||
#define HOOK_VER_MINOR 5
|
||||
#define HOOK_VER_MINOR 6
|
||||
#define HOOK_VER_PATCH 0
|
||||
|
||||
#define STRINGIFY(s) #s
|
||||
|
@ -180,33 +180,19 @@ static bool d3d12_init_11on12(ID3D12Device *device)
|
||||
|
||||
bool created = false;
|
||||
|
||||
if (global_hook_info->d3d12_use_swap_queue) {
|
||||
for (size_t i = 0; i < dxgi_possible_swap_queue_count; ++i) {
|
||||
hlog("d3d12_init_11on12: creating 11 device with swap queue: 0x%" PRIX64,
|
||||
(uint64_t)(uintptr_t)dxgi_possible_swap_queues[i]);
|
||||
IUnknown *const queue = dxgi_possible_swap_queues[i];
|
||||
const HRESULT hr = create_11_on_12(
|
||||
device, 0, nullptr, 0, &queue, 1, 0,
|
||||
&data.device11, &data.context11, nullptr);
|
||||
created = SUCCEEDED(hr);
|
||||
if (created) {
|
||||
break;
|
||||
}
|
||||
|
||||
hlog_hr("d3d12_init_11on12: failed to create 11 device",
|
||||
hr);
|
||||
}
|
||||
} else {
|
||||
hlog("d3d12_init_11on12: creating 11 device without swap queue");
|
||||
for (size_t i = 0; i < dxgi_possible_swap_queue_count; ++i) {
|
||||
hlog("d3d12_init_11on12: creating 11 device: queue=0x%" PRIX64,
|
||||
(uint64_t)(uintptr_t)dxgi_possible_swap_queues[i]);
|
||||
IUnknown *const queue = dxgi_possible_swap_queues[i];
|
||||
const HRESULT hr = create_11_on_12(device, 0, nullptr, 0,
|
||||
nullptr, 0, 0,
|
||||
&data.device11,
|
||||
&queue, 1, 0, &data.device11,
|
||||
&data.context11, nullptr);
|
||||
created = SUCCEEDED(hr);
|
||||
if (!created) {
|
||||
hlog_hr("d3d12_init_11on12: failed to create 11 device",
|
||||
hr);
|
||||
if (created) {
|
||||
break;
|
||||
}
|
||||
|
||||
hlog_hr("d3d12_init_11on12: failed to create 11 device", hr);
|
||||
}
|
||||
|
||||
if (!created) {
|
||||
|
@ -90,16 +90,14 @@ static bool setup_dxgi(IDXGISwapChain *swap)
|
||||
device->Release();
|
||||
|
||||
hlog("Found D3D12 device on swap chain: swap=0x%" PRIX64
|
||||
", device=0x%" PRIX64 ", use_queue=%d",
|
||||
(uint64_t)(uintptr_t)swap, (uint64_t)(uintptr_t)device,
|
||||
(int)global_hook_info->d3d12_use_swap_queue);
|
||||
", device=0x%" PRIX64,
|
||||
(uint64_t)(uintptr_t)swap, (uint64_t)(uintptr_t)device);
|
||||
for (size_t i = 0; i < dxgi_possible_swap_queue_count; ++i) {
|
||||
hlog("\tqueue=0x%" PRIX64,
|
||||
hlog(" queue=0x%" PRIX64,
|
||||
(uint64_t)(uintptr_t)dxgi_possible_swap_queues[i]);
|
||||
}
|
||||
|
||||
if (!global_hook_info->d3d12_use_swap_queue ||
|
||||
(dxgi_possible_swap_queue_count > 0)) {
|
||||
if (dxgi_possible_swap_queue_count > 0) {
|
||||
data.swap = swap;
|
||||
data.capture = d3d12_capture;
|
||||
data.free = d3d12_free;
|
||||
|
Loading…
x
Reference in New Issue
Block a user