mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
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
This commit is contained in:
3
.github/workflows/CI.yml
vendored
3
.github/workflows/CI.yml
vendored
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <class T>
|
||||
void
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ struct EncoderTest: PlatformTestSuite, testing::WithParamInterface<video::encode
|
||||
auto &encoder = *GetParam();
|
||||
if (!video::validate_encoder(encoder, false)) {
|
||||
// Encoder failed validation,
|
||||
// if it's software - fail (unless overriden with compile definition), otherwise skip
|
||||
if (encoder.name == "software" && std::string(TESTS_SOFTWARE_ENCODER_UNAVAILABLE) == "fail") {
|
||||
// if it's software - fail, otherwise skip
|
||||
if (encoder.name == "software") {
|
||||
FAIL() << "Software encoder not available";
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user