nv-filters: Reallocate state when resetting AIGS filters

This properly allocates the temporal state variable used in AI
greenscreen effect, when the latter is reset.

Signed-off-by: pkv <pkv@obsproject.com>
This commit is contained in:
pkv
2025-02-25 22:48:11 +01:00
committed by Ryan Foster
parent 2682ccc33c
commit b5d0054cfa

View File

@@ -407,7 +407,9 @@ static void nvvfx_filter_reset(void *data, calldata_t *calldata)
vfxErr = NvVFX_Load(filter->handle);
if (NVCV_SUCCESS != vfxErr)
error("Error loading NVIDIA Video FX %i", vfxErr);
vfxErr = NvVFX_ResetState(filter->handle, filter->stateObjectHandle);
// reallocate state object
vfxErr = NvVFX_AllocateState(filter->handle, &filter->stateObjectHandle);
vfxErr = NvVFX_SetStateObjectHandleArray(filter->handle, NVVFX_STATE, &filter->stateObjectHandle);
}
if (filter->filter_id != S_FX_AIGS) {
vfxErr = NvVFX_SetF32(filter->handle_blur, NVVFX_STRENGTH, filter->strength);