Skip to content

Commit 578f8f4

Browse files
authored
Add DILIGENT_MAX_INLINE_CONSTANTS_SIZE constant (#748)
1 parent c0d3ccb commit 578f8f4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Graphics/GraphicsEngine/interface/Constants.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ DILIGENT_BEGIN_NAMESPACE(Diligent)
6262
/// Bit shift for the the shading X-axis rate.
6363
#define DILIGENT_SHADING_RATE_X_SHIFT 2
6464

65+
/// Ineline constants data storage (max size is typically 128-256 bytes, use 256 for safety)
66+
#define DILIGENT_MAX_INLINE_CONSTANTS_SIZE 256
67+
6568
static DILIGENT_CONSTEXPR Uint32 MAX_BUFFER_SLOTS = DILIGENT_MAX_BUFFER_SLOTS;
6669
static DILIGENT_CONSTEXPR Uint32 MAX_RENDER_TARGETS = DILIGENT_MAX_RENDER_TARGETS;
6770
static DILIGENT_CONSTEXPR Uint32 MAX_VIEWPORTS = DILIGENT_MAX_VIEWPORTS;

Graphics/GraphicsEngineVulkan/include/VulkanUtilities/CommandBuffer.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,18 @@ class CommandBuffer
504504
vkCmdBindDescriptorSets(m_VkCmdBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
505505
}
506506

507+
__forceinline void PushConstants(VkPipelineLayout layout,
508+
VkShaderStageFlags stageFlags,
509+
uint32_t offset,
510+
uint32_t size,
511+
const void* pValues)
512+
{
513+
VERIFY_EXPR(m_VkCmdBuffer != VK_NULL_HANDLE);
514+
VERIFY_EXPR(pValues != nullptr);
515+
VERIFY_EXPR(size > 0);
516+
vkCmdPushConstants(m_VkCmdBuffer, layout, stageFlags, offset, size, pValues);
517+
}
518+
507519
__forceinline void CopyBuffer(VkBuffer srcBuffer,
508520
VkBuffer dstBuffer,
509521
uint32_t regionCount,

0 commit comments

Comments
 (0)