avutil/hwcontext_d3d11va: added resource and heap flags to DeviceContext

This commit is contained in:
Dmitrii Ovchinnikov
2025-10-07 16:12:42 +02:00
parent fe0813d6e2
commit 714152dd9a
4 changed files with 33 additions and 1 deletions
+3
View File
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28
API changes, most recent first:
2026-01-xx - xxxxxxxxxx - lavu 60.24.100 - hwcontext_d3d11va.h
Add BindFlags and MiscFlags to AVD3D11VADeviceContext
2026-01-04 - xxxxxxxxxx - lavu 60.23.100 - cpu.h
Add AV_CPU_FLAG_ARM_CRC.
+15
View File
@@ -290,6 +290,9 @@ static int d3d11va_frames_init(AVHWFramesContext *ctx)
return AVERROR(EINVAL);
}
hwctx->BindFlags |= device_hwctx->BindFlags;
hwctx->MiscFlags |= device_hwctx->MiscFlags;
ctx->initial_pool_size = FFMIN(ctx->initial_pool_size, MAX_ARRAY_SIZE);
texDesc = (D3D11_TEXTURE2D_DESC){
@@ -710,6 +713,18 @@ static int d3d11va_device_create(AVHWDeviceContext *ctx, const char *device,
}
#endif
if (av_dict_get(opts, "SHADER", NULL, 0))
device_hwctx->BindFlags |= D3D11_BIND_SHADER_RESOURCE;
if (av_dict_get(opts, "UAV", NULL, 0))
device_hwctx->BindFlags |= D3D11_BIND_UNORDERED_ACCESS;
if (av_dict_get(opts, "RTV", NULL, 0))
device_hwctx->BindFlags |= D3D11_BIND_RENDER_TARGET;
if (av_dict_get(opts, "SHARED", NULL, 0))
device_hwctx->MiscFlags |= D3D11_RESOURCE_MISC_SHARED;
return 0;
}
+14
View File
@@ -94,6 +94,20 @@ typedef struct AVD3D11VADeviceContext {
void (*lock)(void *lock_ctx);
void (*unlock)(void *lock_ctx);
void *lock_ctx;
/**
* D3D11_TEXTURE2D_DESC.BindFlags to be applied to D3D11 resources allocated
* for frames using this device context.
*
* It applies globally to all AVD3D11VAFramesContext allocated from this device context.
*/
UINT BindFlags;
/**
* D3D11_TEXTURE2D_DESC.MiscFlags to be applied to D3D11 resources allocated
* for frames using this device context.
*
* It applies globally to all AVD3D11VAFramesContext allocated from this device context.
*/
UINT MiscFlags;
} AVD3D11VADeviceContext;
/**
+1 -1
View File
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 60
#define LIBAVUTIL_VERSION_MINOR 23
#define LIBAVUTIL_VERSION_MINOR 24
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \