gboisse / gfx

A minimalist and easy to use graphics API.
MIT License
502 stars 36 forks source link

Prevent spamming warning when creating shared buffers. #144

Closed maoliver-amd closed 1 month ago

maoliver-amd commented 1 month ago

Shared buffers can only be created in the common state not as a copy dest. Fixing this prevent warnings such as:

[rty\gfx\gfx.cpp:1196] D3D12 Warning: ID3D12Device::CreateCommittedResource1: Ignoring InitialState D3D12_RESOURCE_STATE_COPY_DEST. Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON.

The copy from existing buffer still seems to work without transitioning to a dest state and the directx specs say that any shared resource should always be in common state when being used in a shred context