23 "ERROR: vkShaderBuffer - element size and count combo is less than the minimum alignment requirement for current hardware! Pad the element size and or count a bit" );
28 "ERROR: vkShaderBuffer - element size is less than the minimum alignment requirement for current hardware! Pad the element size a bit" );
33 const string bufferName = _name.empty() ?
Util::StringFormat(
"DVD_GENERAL_SHADER_BUFFER_{}",
getGUID() ) : (_name +
"_SHADER_BUFFER");
44 if ( !_bufferImpl->waitForLockedRange( range ) )
50 const VkAccessFlags2 dstAccessMask = VK_ACCESS_SHADER_READ_BIT | (isCommandBuffer ? VK_ACCESS_INDIRECT_COMMAND_READ_BIT : VK_ACCESS_NONE);
51 const VkPipelineStageFlags2 dstStageMask =
VK_API::ALL_SHADER_STAGES | VK_PIPELINE_STAGE_TRANSFER_BIT | (isCommandBuffer ? VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT : VK_PIPELINE_STAGE_NONE);
54 return _bufferImpl->writeBytes(range, dstAccessMask, dstStageMask, data);
59 if ( !_bufferImpl->waitForLockedRange( range ) )
64 range._length = std::min( std::min( range._length, outData.second ), _alignedBufferSize - range._startOffset );
67 _bufferImpl->readBytes(range, outData);
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
FORCE_INLINE I64 getGUID() const noexcept
U16 queueLength() const noexcept
static constexpr VkPipelineStageFlagBits2 ALL_SHADER_STAGES
void readBytesInternal(BufferRange range, std::pair< bufferPtr, size_t > outData) noexcept override
LockableBuffer * getBufferImpl() override final
vkBufferImpl_uptr _bufferImpl
vkShaderBuffer(GFXDevice &context, const ShaderBufferDescriptor &descriptor)
BufferLock writeBytesInternal(BufferRange range, const bufferPtr data) noexcept override
Str StringFormat(const char *fmt, Args &&...args)
FORCE_INLINE size_t GetAlignmentCorrected(const size_t value, const size_t alignment) noexcept
Handle console commands that start with a forward slash.
std::lock_guard< mutex > LockGuard
constexpr size_t realign_offset(const size_t offset, const size_t align) noexcept
size_t _elementSize
Buffer primitive size in bytes.
std::pair< bufferPtr, size_t > _initialData