Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(capture/windows): fix capture when using the basic render driver #3531

Merged
merged 2 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions cmake/prep/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/platform/windows/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/platform/windows/display_vram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 0 additions & 6 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading