microsoft / microsoft/DirectX-Graphics-Samples

IDXGIOutput::FindClosestMatchingMode fails when passing in certain ID3D12Devices as argument.

Open
#824 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C++
Stars
6.8k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

Hello,

We recently discovered that the call to FindClosestMatchingMode on the IDXGIOutput instance always fail with a E_INVALID_CALL return code when certain ID3D12Devices are passed in as the third argument IUnknown *pConcernedDevice.

Enabling the D3D12 Debug Layer does not provide any additional information about the issue apart from an internally thrown com_ptr exception.

I've tested converting to the newer IDXGIOutput1::FindClosestMatchingMode1 function, but it throws the same error.

We suspect this might be due to our usage of the D3D12 Agility SDK, and that this function was never updated to properly support it.
We're currently using D3D12 Agility version 1.606.4.

For now, we can get away without passing any device, since we do all our format checking before even reaching this point.
But it is such a small thing that can easily go unnoticed. (We've had this issue for at least a year)

ID3D12Device* ourDevice; // Assume this is a valid device
IUnknown* d3D12Device = ourDevice;

DXGI_MODE_DESC validatedMode = {};
HRESULT result = output->FindClosestMatchingMode(someModeDesc, &validatedMode, d3D12Device);

I can provide more details and testing if needed as we have a solid repro case for this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported IDXGIOutput::FindClosestMatchingMode repro and compare it with IDXGIOutput1::FindClosestMatchingMode1 using the D3D12 Agility SDK version 1.606.4. Test calls with the ID3D12Device and with no device, and use the existing solid repro case to determine whether the failure is reproducible and what change would resolve it.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.