diff --git a/Graphics/GraphicsEngine/interface/Constants.h b/Graphics/GraphicsEngine/interface/Constants.h index ce3bc5564d..0b5712bb99 100644 --- a/Graphics/GraphicsEngine/interface/Constants.h +++ b/Graphics/GraphicsEngine/interface/Constants.h @@ -62,6 +62,9 @@ DILIGENT_BEGIN_NAMESPACE(Diligent) /// Bit shift for the the shading X-axis rate. #define DILIGENT_SHADING_RATE_X_SHIFT 2 +/// Ineline constants data storage (max size is typically 128-256 bytes, use 256 for safety) +#define DILIGENT_MAX_INLINE_CONSTANTS_SIZE 256 + static DILIGENT_CONSTEXPR Uint32 MAX_BUFFER_SLOTS = DILIGENT_MAX_BUFFER_SLOTS; static DILIGENT_CONSTEXPR Uint32 MAX_RENDER_TARGETS = DILIGENT_MAX_RENDER_TARGETS; static DILIGENT_CONSTEXPR Uint32 MAX_VIEWPORTS = DILIGENT_MAX_VIEWPORTS; diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/CommandBuffer.hpp b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/CommandBuffer.hpp index 6732457fa9..ed738a3036 100644 --- a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/CommandBuffer.hpp +++ b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/CommandBuffer.hpp @@ -504,6 +504,18 @@ class CommandBuffer vkCmdBindDescriptorSets(m_VkCmdBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets); } + __forceinline void PushConstants(VkPipelineLayout layout, + VkShaderStageFlags stageFlags, + uint32_t offset, + uint32_t size, + const void* pValues) + { + VERIFY_EXPR(m_VkCmdBuffer != VK_NULL_HANDLE); + VERIFY_EXPR(pValues != nullptr); + VERIFY_EXPR(size > 0); + vkCmdPushConstants(m_VkCmdBuffer, layout, stageFlags, offset, size, pValues); + } + __forceinline void CopyBuffer(VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount,