| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "../RhiCapabilitiesBase.h" |
| 4 |
#include "SwRenderTarget.h" |
| 5 |
#include "SwTexture.h" |
| 6 |
|
| 7 |
namespace nCine::RHI::Software |
| 8 |
{ |
| 9 |
/** |
| 10 |
@brief Runtime capabilities of the software rasterizer backend |
| 11 |
|
| 12 |
The CPU rasterizer has no device to query, so it publishes the engine-side limits its own draw |
| 13 |
dispatch works with (see @ref RhiCapabilitiesBase::SetDeviceCapabilities()). |
| 14 |
*/ |
| 15 |
class SwRhiCapabilities : public RhiCapabilitiesBase |
| 16 |
{ |
| 17 |
public: |
| 18 |
SwRhiCapabilities() |
| 19 |
{ |
| 20 |
// The CPU rasterizer samples heap-allocated texel stores addressed with 32-bit coordinates, so it has no |
| 21 |
// hard dimension cap of its own; 16384 is published for parity with the hardware backends (it only feeds |
| 22 |
// the texture-load assert). Uniforms are plain host memory read by the transpiled effects (no device |
| 23 |
// alignment), so 16 bytes / 64 KB are the engine-side packing granularity and the engine's normalized |
| 24 |
// block cap. MAX_COLOR_ATTACHMENTS mirrors SwRenderTarget::MaxColorAttachments. |
| 25 |
SetDeviceCapabilities("Software Rasterizer", 16384, std::int32_t(SwTexture::MaxTextureUnits), |
| 26 |
64 * 1024, 16, std::int32_t(SwRenderTarget::MaxColorAttachments)); |
| 27 |
|
| 28 |
LogCapabilities(); |
| 29 |
} |
| 30 |
}; |
| 31 |
} |