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: automatic selection for hybrid GPU and IDDSampleDriver users #3002

Merged
merged 18 commits into from
Sep 29, 2024
Merged
Prev Previous commit
make sonarcloud happy again
  • Loading branch information
Nonary authored and cgutman committed Sep 29, 2024
commit ec488ca2357fb817dbbaac0b80b79316c6fc615a
2 changes: 1 addition & 1 deletion src/platform/windows/display_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ namespace platf::dxgi {
std::vector<std::string> args = { std::to_string(i), display_name };
try {
if (verify_frame_capture) {
args.push_back("--verify-frame-capture");
args.emplace_back("--verify-frame-capture");
}
result = bp::system(cmd, bp::args(args), bp::std_out > bp::null, bp::std_err > bp::null);
}
Expand Down
4 changes: 2 additions & 2 deletions tools/ddprobe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ syncThreadDesktop() {
*/
bool
is_valid_frame(const D3D11_MAPPED_SUBRESOURCE &mappedResource, const D3D11_TEXTURE2D_DESC &frameDesc, float darknessThreshold = 0.1f) {
const uint8_t *pixels = static_cast<const uint8_t *>(mappedResource.pData);
const auto *pixels = static_cast<const uint8_t *>(mappedResource.pData);
const int bytesPerPixel = 4; // (8 bits per channel, excluding alpha). Factoring HDR is not needed because it doesn't cause black levels to raise enough to be a concern.
const int stride = mappedResource.RowPitch;
const int width = frameDesc.Width;
const int height = frameDesc.Height;

// Convert the darkness threshold to an integer value for comparison
const int threshold = static_cast<int>(darknessThreshold * 255);
const auto threshold = static_cast<int>(darknessThreshold * 255);

// Iterate over each pixel in the frame
for (int y = 0; y < height; ++y) {
Expand Down
Loading