Skip to content

Commit

Permalink
Add helper to RenderTargetState for MSAA (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored Oct 12, 2024
1 parent 65f12b3 commit a91ee98
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Inc/RenderTargetState.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,22 @@ namespace DirectX
rtvFormats[0] = rtFormat;
}

// MSAA single render target convenience constructor
RenderTargetState(
_In_ DXGI_FORMAT rtFormat,
_In_ DXGI_FORMAT dsFormat,
_In_ uint32_t sampleCount,
_In_ uint32_t quality = 0) noexcept
: sampleMask(UINT_MAX)
, numRenderTargets(1)
, rtvFormats{}
, dsvFormat(dsFormat)
, sampleDesc{ sampleCount, quality }
, nodeMask(0)
{
rtvFormats[0] = rtFormat;
}

// Convenience constructors converting from DXGI_SWAPCHAIN_DESC
#if defined(__dxgi_h__) || defined(__d3d11_x_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
RenderTargetState(
Expand Down

0 comments on commit a91ee98

Please sign in to comment.