From c369e8e5b607de97e5f8f1d91abdd6bb6817a1a1 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 12 Jan 2025 16:05:18 -0600 Subject: [PATCH] fix(capture/windows): fix capture when using the basic render driver (#3531) * fix(capture/windows): fix capture when using the basic render driver * chore(tests): remove now unnecessary TESTS_SOFTWARE_ENCODER_UNAVAILABLE option --- .github/workflows/CI.yml | 3 +-- cmake/prep/options.cmake | 4 ---- src/platform/windows/display.h | 2 +- src/platform/windows/display_vram.cpp | 2 +- tests/CMakeLists.txt | 6 ------ tests/unit/test_video.cpp | 4 ++-- 6 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ddfb79875f2..fb8d1c33dc0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -954,8 +954,7 @@ jobs: -DSUNSHINE_ASSETS_DIR=assets \ -DSUNSHINE_PUBLISHER_NAME='${{ github.repository_owner }}' \ -DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' \ - -DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support' \ - -DTESTS_SOFTWARE_ENCODER_UNAVAILABLE='skip' + -DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support' ninja -C build - name: Package Windows diff --git a/cmake/prep/options.cmake b/cmake/prep/options.cmake index ba1dc193238..6554574abfb 100644 --- a/cmake/prep/options.cmake +++ b/cmake/prep/options.cmake @@ -12,10 +12,6 @@ option(BUILD_TESTS "Build tests" ON) option(NPM_OFFLINE "Use offline npm packages. You must ensure packages are in your npm cache." OFF) option(TESTS_ENABLE_PYTHON_TESTS "Enable Python tests" ON) -# DirectX11 is not available in GitHub runners, so even software encoding fails -set(TESTS_SOFTWARE_ENCODER_UNAVAILABLE "fail" - CACHE STRING "How to handle unavailable software encoders in tests. 'fail/skip'") - option(BUILD_WERROR "Enable -Werror flag." OFF) # if this option is set, the build will exit after configuring special package configuration files diff --git a/src/platform/windows/display.h b/src/platform/windows/display.h index 3e035490394..f37dd3d7b4d 100644 --- a/src/platform/windows/display.h +++ b/src/platform/windows/display.h @@ -23,7 +23,7 @@ namespace platf::dxgi { // Add D3D11_CREATE_DEVICE_DEBUG here to enable the D3D11 debug runtime. // You should have a debugger like WinDbg attached to receive debug messages. - auto constexpr D3D11_CREATE_DEVICE_FLAGS = D3D11_CREATE_DEVICE_VIDEO_SUPPORT; + auto constexpr D3D11_CREATE_DEVICE_FLAGS = 0; template void diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index ba2b0685187..bb7ad2bd986 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -760,7 +760,7 @@ namespace platf::dxgi { adapter_p, D3D_DRIVER_TYPE_UNKNOWN, nullptr, - D3D11_CREATE_DEVICE_FLAGS, + D3D11_CREATE_DEVICE_FLAGS | D3D11_CREATE_DEVICE_VIDEO_SUPPORT, featureLevels, sizeof(featureLevels) / sizeof(D3D_FEATURE_LEVEL), D3D11_SDK_VERSION, &device, diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 26602909fd9..927c12b71be 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -35,12 +35,6 @@ endif () set(TEST_DEFINITIONS) # list will be appended as needed -# make sure TESTS_SOFTWARE_ENCODER_UNAVAILABLE is set to "fail" or "skip" -if (NOT (TESTS_SOFTWARE_ENCODER_UNAVAILABLE STREQUAL "fail" OR TESTS_SOFTWARE_ENCODER_UNAVAILABLE STREQUAL "skip")) - set(TESTS_SOFTWARE_ENCODER_UNAVAILABLE "fail") -endif () -list(APPEND TEST_DEFINITIONS TESTS_SOFTWARE_ENCODER_UNAVAILABLE="${TESTS_SOFTWARE_ENCODER_UNAVAILABLE}") # fail/skip - # this indicates we're building tests in case sunshine needs to adjust some code or add private tests list(APPEND TEST_DEFINITIONS SUNSHINE_TESTS) diff --git a/tests/unit/test_video.cpp b/tests/unit/test_video.cpp index 5442110b4e0..b122068cde5 100644 --- a/tests/unit/test_video.cpp +++ b/tests/unit/test_video.cpp @@ -12,8 +12,8 @@ struct EncoderTest: PlatformTestSuite, testing::WithParamInterface