Skip to content

Commit 922a765

Browse files
committed
fix(rendering): guard D3D11 shared handle path with is_using_zero_copy check
1 parent a6647da commit 922a765

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

crates/rendering/src/layers/display.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -273,20 +273,22 @@ impl DisplayLayer {
273273
{
274274
let mut d3d11_succeeded = false;
275275

276-
if let (Some(y_handle), Some(uv_handle)) = (
277-
screen_frame.d3d11_y_handle(),
278-
screen_frame.d3d11_uv_handle(),
279-
) && self
280-
.yuv_converter
281-
.convert_nv12_from_d3d11_shared_handles(
282-
device,
283-
queue,
284-
y_handle,
285-
uv_handle,
286-
actual_width,
287-
actual_height,
276+
if self.yuv_converter.is_using_zero_copy()
277+
&& let (Some(y_handle), Some(uv_handle)) = (
278+
screen_frame.d3d11_y_handle(),
279+
screen_frame.d3d11_uv_handle(),
288280
)
289-
.is_ok()
281+
&& self
282+
.yuv_converter
283+
.convert_nv12_from_d3d11_shared_handles(
284+
device,
285+
queue,
286+
y_handle,
287+
uv_handle,
288+
actual_width,
289+
actual_height,
290+
)
291+
.is_ok()
290292
&& self.yuv_converter.output_texture().is_some()
291293
{
292294
self.pending_copy = Some(PendingTextureCopy {
@@ -547,6 +549,7 @@ impl DisplayLayer {
547549
let d3d11_zero_copy_succeeded = {
548550
let mut succeeded = false;
549551
if !self.prefer_cpu_conversion
552+
&& self.yuv_converter.is_using_zero_copy()
550553
&& let (Some(y_handle), Some(uv_handle)) = (
551554
screen_frame.d3d11_y_handle(),
552555
screen_frame.d3d11_uv_handle(),

0 commit comments

Comments
 (0)