microsoft / DirectXTK12

The DirectX Tool Kit (aka DirectXTK12) is a collection of helper classes for writing DirectX 12 code in C++
https://walbourn.github.io/directx-tool-kit-for-directx-12/
MIT License
1.48k stars 393 forks source link

SpriteBatch should support changing the heap-based sampler #72

Closed walbourn closed 4 years ago

walbourn commented 4 years ago

SpriteBatch supports using either a static sampler or a heap-based sampler.

Currently all this is set at SpriteBatch creation time, but the heap-based sampler is dynamic so you should be able to change it without creating a new SpriteBatch.

Adding a second form of Begin like:

void XM_CALLCONV Begin(
    _In_ ID3D12GraphicsCommandList* commandList,
    D3D12_GPU_DESCRIPTOR_HANDLE sampler,
    SpriteSortMode sortMode = SpriteSortMode_Deferred,
    FXMMATRIX transformMatrix = MatrixIdentity);

This would throw a C++ exception if you created the SpriteBatch with the static sampler.

walbourn commented 4 years ago

https://github.com/microsoft/DirectXTK12/pull/73

walbourn commented 4 years ago

See this PR for the test updates.