NiiightmareXD / windows-capture

Fastest Windows Screen Capture Library For Rust And Python 🔥
MIT License
198 stars 27 forks source link

[BUG 🪲] D3D feature level should not be restricted to D3D_FEATURE_LEVEL_11_1 #73

Closed mycrl closed 1 month ago

mycrl commented 1 month ago

Hey! I found another problem. I've been using this crate a lot recently, so I found some problems.

You may remember that I just submitted a PR two days ago to get d3d textures directly from the frame. This problem is relatively simple, so I'll make it short.

https://github.com/NiiightmareXD/windows-capture/blob/main/src/d3d11.rs#L86

The problem lies in this judgment. One of my test devices is very old, so it does not support the D3D_FEATURE_LEVEL_11_1 level, only D3D_FEATURE_LEVEL_11_0, so I removed this judgment, at least for me It works well.

So, have you considered lowering this limit by one level? Because I'm not sure if there are other restrictions in this project, and whether a too low level will affect other places.

If you think this idea is feasible, I will create a new submission.

My current suggestions are:

if feature_level.0 < D3D_FEATURE_LEVEL_11_0.0 {
    return Err(Error::FeatureLevelNotSatisfied);
}

I'm not sure if lower levels will work, I don't have older devices and OS versions.

NiiightmareXD commented 1 month ago

Hey, I will check all APIs calls we make and check their requirements, if none of them needed more than D11_0 we can do that.

NiiightmareXD commented 1 month ago

Yea, it's fine.