2014-01-20 07:58:58 -08:00
|
|
|
project(libobs-d3d11)
|
|
|
|
|
|
|
|
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
|
|
|
|
|
|
|
|
add_definitions(-DLIBOBS_EXPORTS)
|
|
|
|
|
2019-10-07 02:23:46 -07:00
|
|
|
if(NOT DEFINED GPU_PRIORITY_VAL OR "${GPU_PRIORITY_VAL}" STREQUAL "" OR
|
|
|
|
"${GPU_PRIORITY_VAL}" STREQUAL "0")
|
|
|
|
set(USE_GPU_PRIORITY FALSE)
|
|
|
|
set(GPU_PRIORITY_VAL "0")
|
|
|
|
else()
|
|
|
|
set(USE_GPU_PRIORITY TRUE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/d3d11-config.h.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/d3d11-config.h")
|
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2014-01-20 07:58:58 -08:00
|
|
|
set(libobs-d3d11_SOURCES
|
|
|
|
d3d11-indexbuffer.cpp
|
|
|
|
d3d11-samplerstate.cpp
|
|
|
|
d3d11-shader.cpp
|
|
|
|
d3d11-shaderprocessor.cpp
|
|
|
|
d3d11-stagesurf.cpp
|
|
|
|
d3d11-subsystem.cpp
|
|
|
|
d3d11-texture2d.cpp
|
2019-12-15 11:36:24 -08:00
|
|
|
d3d11-texture3d.cpp
|
2014-01-20 07:58:58 -08:00
|
|
|
d3d11-vertexbuffer.cpp
|
2014-12-29 00:29:55 -08:00
|
|
|
d3d11-duplicator.cpp
|
libobs-d3d11: Rebuild device and assets if device removed/reset
Due to an NVIDIA driver bug with the Windows 10 Anniversary Update,
there are an increasingly large number of reports of "Device Removed"
errors and TDRs. When this happens, OBS stops outputting all data
because all graphics functions are failing, and it appears to just
"freeze up" for users.
To temporarily alleviate this issue while waiting for it to be fixed,
the D3D subsystem can be rebuilt when that happens, all assets can be
reloaded to ensure that it can continue functioning (with a minor hiccup
in playback).
To allow rebuilding the entire D3D subsystem, all objects that contain
D3D references must be part of a linked list (with a few exceptions) so
we can quickly traverse them all whenever needed, and all data for those
resources (static resources primarily, such as shaders, textures, index
buffers, vertex buffers) must be stored in RAM so they can be recreated
whenever needed.
Then if D3D reports a "device removed" or "device reset" error, all D3D
references must first be fully released with no stray references; the
linked list must be fully traversed until all references are released.
Then, the linked list must once again be traversed again, and all those
D3D objects must be recreated with the same data and descriptors (which
are now saved in each object). Finally, all states need to be reset.
After that's complete, the device is able to continue functioning almost
as it was before, although the output to recording/stream may get a few
green frames due to texture data being reset.
This will temporarily alleviate the "Device Removed" issue while waiting
for a fix from NVIDIA.
2016-11-03 07:41:23 -07:00
|
|
|
d3d11-rebuild.cpp
|
2014-01-20 07:58:58 -08:00
|
|
|
d3d11-zstencilbuffer.cpp)
|
|
|
|
|
|
|
|
set(libobs-d3d11_HEADERS
|
2019-10-07 02:23:46 -07:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/d3d11-config.h
|
2020-02-25 23:38:18 -08:00
|
|
|
intel-nv12-support.hpp
|
2014-01-20 07:58:58 -08:00
|
|
|
d3d11-shaderprocessor.hpp
|
|
|
|
d3d11-subsystem.hpp)
|
2014-07-18 22:23:44 -07:00
|
|
|
|
2014-01-20 07:58:58 -08:00
|
|
|
add_library(libobs-d3d11 MODULE
|
|
|
|
${libobs-d3d11_SOURCES}
|
|
|
|
${libobs-d3d11_HEADERS})
|
|
|
|
set_target_properties(libobs-d3d11
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME libobs-d3d11
|
|
|
|
PREFIX "")
|
|
|
|
target_link_libraries(libobs-d3d11
|
|
|
|
libobs
|
2019-04-02 23:22:19 -07:00
|
|
|
d3d9
|
2014-07-17 15:08:00 -07:00
|
|
|
d3d11
|
2014-10-03 14:29:47 -07:00
|
|
|
dxgi)
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
install_obs_core(libobs-d3d11)
|