Debian Codegraph @

Sources/nCine/Graphics/RHI/D3D11/D3D11RhiCapabilities.h

raw
1 #pragma once
2
3 #include "../RhiCapabilitiesBase.h"
4 #include "D3D11Device.h"
5 #include "D3D11RenderTarget.h"
6 #include "D3D11Texture.h"
7
8 namespace nCine::RHI::D3D11
9 {
10 /**
11 @brief Runtime capabilities of the Direct3D 11 backend
12
13 Direct3D has no queryable API context of the OpenGL kind, so the limits come from the device the window
14 backend has already created (see @ref RhiCapabilitiesBase::SetDeviceCapabilities()).
15 */
16 class D3D11RhiCapabilities : public RhiCapabilitiesBase
17 {
18 public:
19 D3D11RhiCapabilities()
20 {
21 // Real Direct3D 11 limits: the texture dimension comes from the obtained feature level (16384 on 11_0,
22 // 8192 on the 10.x fallbacks); a constant buffer holds 4096 16-byte constants = 64 KB
23 // (D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT). The backend copies every bound uniform range into a pooled
24 // cbuffer per draw (offsets never reach the API), so the offset alignment is only the engine-side
25 // suballocation granularity: 16 bytes, one std140 vec4. MAX_COLOR_ATTACHMENTS is
26 // D3D11RenderTarget::MaxColorAttachments, which is D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT (8).
27 SetDeviceCapabilities("Direct3D 11", D3D11Device::GetMaxTextureDimension(), std::int32_t(D3D11Texture::MaxTextureUnits),
28 64 * 1024, 16, std::int32_t(D3D11RenderTarget::MaxColorAttachments));
29
30 LogCapabilities();
31 }
32 };
33 }