Skip to content

ID3D12Device* leakΒ #168

@anyiscsak

Description

@anyiscsak

When a ffxQuery is called with a ID3D12Device*, the GetExternalProviders is going to leak the resource.

ffxQueryDescGetVersions versionsDesc{
  .header{
    .type = FFX_API_QUERY_DESC_TYPE_GET_VERSIONS,
  },
  .createDescType = FFX_API_CREATE_CONTEXT_DESC_TYPE_UPSCALE,
  .device = device,
  .outputCount = &versionCount,
};

ffxQuery(nullptr, &versionsDesc.header);

The GetExternalProviders creates an IAmdExtFfxApi* object which holds a reference to the device
HRESULT hr = AmdExtD3DCreateInterface(device, IID_PPV_ARGS(&apiExtension));
but this IAmdExtFfxApi* is a function visible global pointer which never will be released.
I understand that the intention behind this function visible global pointer was to cache the IAmdExtFfxApi* but now at teardown of engine and hardware abstraction layer the engine's ID3D12Device* can not be released due to the increased refence count by static IAmdExtFfxApi* apiExtension.
during ffxDestroyContext this cache should be released as well.

While this problem exists, we are going to use a workaround in our projects
GaijinEntertainment@64fa37e

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions