From efd484cb2dc3e3aa0eaf1855535186ccde3dc97c Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Tue, 9 Sep 2025 21:46:25 +0200 Subject: [PATCH] avutil/hwcontext_d3d11va: remove D3D11_BIND_RENDER_TARGET restriction for array textures This was added in 4f78711f9c28b11dae4e4b96be46b6b4925eb8c6, with the commit message claiming that it's a Microsoft restriction that array textures with ArraySize > 2 cannot be created with D3D11_BIND_RENDER_TARGET. I was unable to find any documentation or other references on that, and a quick test also found it to not be the case. So this patch removes that restriction. This enables frame sources, like the d3d11 capture filters, to output frames in an array texture, which is neccesary to pass those frames as input to some hardware encoders. --- libavutil/hwcontext_d3d11va.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c index 9831f530c1..83414ad0d4 100644 --- a/libavutil/hwcontext_d3d11va.c +++ b/libavutil/hwcontext_d3d11va.c @@ -318,7 +318,7 @@ static int d3d11va_frames_init(AVHWFramesContext *ctx) ctx->initial_pool_size = texDesc2.ArraySize; hwctx->BindFlags = texDesc2.BindFlags; hwctx->MiscFlags = texDesc2.MiscFlags; - } else if (!(texDesc.BindFlags & D3D11_BIND_RENDER_TARGET) && texDesc.ArraySize > 0) { + } else if (texDesc.ArraySize > 0) { hr = ID3D11Device_CreateTexture2D(device_hwctx->device, &texDesc, NULL, &hwctx->texture); if (FAILED(hr)) { av_log(ctx, AV_LOG_ERROR, "Could not create the texture (%lx)\n", (long)hr);