Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: ID3D12GraphicsCommandList::ClearRenderTargetView pRects should be marked optional #1453

Closed
chyyran opened this issue Feb 6, 2023 · 1 comment
Assignees
Labels
usability Touch-up to improve the user experience for a language projection

Comments

@chyyran
Copy link

chyyran commented Feb 6, 2023

https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-clearrendertargetview

pRects is not indicated as optional

void ClearRenderTargetView(
  [in] D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
  [in] const FLOAT [4]             ColorRGBA,
  [in] UINT                        NumRects,
  [in] const D3D12_RECT            *pRects
);

However in the documentation

[in] pRects

Type: const D3D12_RECT*

An array of D3D12_RECT structures for the rectangles in the resource view to clear. If NULL, ClearRenderTargetView clears the entire resource view.

Because it isn't marked optional, it is impossible to pass in None in windows-rs so the NULL behaviour is not obtainable.

@mikebattista mikebattista self-assigned this Feb 6, 2023
@mikebattista mikebattista added the usability Touch-up to improve the user experience for a language projection label Feb 6, 2023
MarijnS95 added a commit to MarijnS95/win32metadata that referenced this issue Aug 27, 2024
…Optional`

In microsoft#1453 `ClearRenderTargetView()`'s `pRect` slice was requested to
be marked as optional, but its `ClearDepthStencilView()` sibling was
completely glossed over.  Mark it `Optional` as well as a `NULL` pointer
is expected to clear the entire resource view.  A non-`NULL` pointer
with a length of `0` might not clear anything at all.
@MarijnS95
Copy link
Contributor

1.5 years later: it looks like you forgot about ID3D12GraphicsCommandList::ClearDepthStencilView(), which has the same semantics.

#1971

mikebattista pushed a commit that referenced this issue Aug 27, 2024
…Optional` (#1971)

In #1453 `ClearRenderTargetView()`'s `pRect` slice was requested to
be marked as optional, but its `ClearDepthStencilView()` sibling was
completely glossed over.  Mark it `Optional` as well as a `NULL` pointer
is expected to clear the entire resource view.  A non-`NULL` pointer
with a length of `0` might not clear anything at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability Touch-up to improve the user experience for a language projection
Projects
None yet
Development

No branches or pull requests

3 participants