MCPcopy Create free account
hub / github.com/crownengine/crown / update

Method update

3rdparty/bgfx/src/renderer_vk.cpp:5289–5313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5287 }
5288
5289 void BufferVK::update(VkCommandBuffer _commandBuffer, uint32_t _offset, uint32_t _size, void* _data, bool _discard)
5290 {
5291 BGFX_PROFILER_SCOPE("BufferVK::update", kColorFrame);
5292 BX_UNUSED(_discard);
5293
5294 StagingBufferVK stagingBuffer = s_renderVK->allocFromScratchStagingBuffer(_size, 8, _data);
5295
5296 VkBufferCopy region;
5297 region.srcOffset = stagingBuffer.m_offset;
5298 region.dstOffset = _offset;
5299 region.size = _size;
5300 vkCmdCopyBuffer(_commandBuffer, stagingBuffer.m_buffer, m_buffer, 1, &region);
5301
5302 setMemoryBarrier(
5303 _commandBuffer
5304 , VK_PIPELINE_STAGE_TRANSFER_BIT
5305 , VK_PIPELINE_STAGE_TRANSFER_BIT
5306 );
5307
5308 if (!stagingBuffer.m_isFromScratch)
5309 {
5310 s_renderVK->release(stagingBuffer.m_buffer);
5311 s_renderVK->recycleMemory(stagingBuffer.m_deviceMem);
5312 }
5313 }
5314
5315 void BufferVK::destroy()
5316 {

Callers 6

updateTextureMethod · 0.45
blitRenderMethod · 0.45
updateResolutionMethod · 0.45
submitMethod · 0.45

Calls 15

setMemoryBarrierFunction · 0.85
getBitsPerPixelFunction · 0.85
isCompressedFunction · 0.85
allocFunction · 0.85
imageDecodeToBgra8Function · 0.85
createFrameBufferFunction · 0.85
EnumEnum · 0.70
freeFunction · 0.70
maxFunction · 0.50
releaseMethod · 0.45
recycleMemoryMethod · 0.45

Tested by

no test coverage detected