Calling of some directx12 functions always throw "invalid argument" exception.

Displame 21 Reputation points
2021-09-16T06:20:54.903+00:00

I ran the code accompanied with Introduction to 3D Game Programming with DirectX 12 on my computer, but it always throw exception like this:
132651-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2021-09-16-135406.png

The Chinese there means something like "Invalid argument".

The return value of mCommandList->close() should be -2147024809 in decimal, it's a HRESULT value. I've encountered similar problem in my own code many times, and I recorded the return value.
But the code runs well months earlier without any modification. I wonder if some upgrade of my win10 may be the cause.
Thanks for your suggestion.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,974 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,483 questions
Windows 10 Compatibility
Windows 10 Compatibility
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Compatibility: The extent to which hardware or software adheres to an accepted standard.
460 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,466 Reputation points
    2021-09-16T11:31:47.313+00:00

    Hello Displame,

    You might need to use newer texture resources.

    For example:
    D3D_FEATURE_LEVEL_11_1 and D3D11_CREATE_DEVICE_BGRA_SUPPORT

    Hope this helps,
    Best regards,

    0 comments No comments