Skip to content

Commit

Permalink
Relax nvrhi push constant limits to permit platform-specific runtime …
Browse files Browse the repository at this point in the history
…checks
  • Loading branch information
RobertBeckebans committed Feb 26, 2024
1 parent b1758e6 commit 15bf887
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/nvrhi/nvrhi.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ namespace nvrhi
static constexpr uint32_t c_MaxBindingsPerLayout = 128;
static constexpr uint32_t c_MaxVolatileConstantBuffersPerLayout = 6;
static constexpr uint32_t c_MaxVolatileConstantBuffers = 32;
static constexpr uint32_t c_MaxPushConstantSize = 128; // D3D12: root signature is 256 bytes max., Vulkan: 128 bytes of push constants guaranteed
#if defined(__APPLE__)
static constexpr uint32_t c_MaxPushConstantSize = 4096; // Vulkan: MoltenVK/Metal provides 4096 bytes of push constants
#else
static constexpr uint32_t c_MaxPushConstantSize = 256; // D3D12: root signature is 256 bytes max., Vulkan: 128 bytes of push constants guaranteed, but varies with platform and GPU vendor - let application check/enforce limit at runtime
#endif
static constexpr uint32_t c_ConstantBufferOffsetSizeAlignment = 256; // Partially bound constant buffers must have offsets aligned to this and sizes multiple of this

//////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 15bf887

Please sign in to comment.