本文整理汇总了C++中VkResourceRecord::MarkResourceFrameReferenced方法的典型用法代码示例。如果您正苦于以下问题:C++ VkResourceRecord::MarkResourceFrameReferenced方法的具体用法?C++ VkResourceRecord::MarkResourceFrameReferenced怎么用?C++ VkResourceRecord::MarkResourceFrameReferenced使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VkResourceRecord
的用法示例。
在下文中一共展示了VkResourceRecord::MarkResourceFrameReferenced方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vkCmdResetEvent
void WrappedVulkan::vkCmdResetEvent(
VkCommandBuffer cmdBuffer,
VkEvent event,
VkPipelineStageFlags stageMask)
{
SCOPED_DBG_SINK();
ObjDisp(cmdBuffer)->CmdResetEvent(Unwrap(cmdBuffer), Unwrap(event), stageMask);
if(m_State >= WRITING)
{
VkResourceRecord *record = GetRecord(cmdBuffer);
CACHE_THREAD_SERIALISER();
SCOPED_SERIALISE_CONTEXT(CMD_RESET_EVENT);
Serialise_vkCmdResetEvent(localSerialiser, cmdBuffer, event, stageMask);
record->AddChunk(scope.Get());
record->MarkResourceFrameReferenced(GetResID(event), eFrameRef_Read);
}
}
示例2: vkCmdWaitEvents
void WrappedVulkan::vkCmdWaitEvents(
VkCommandBuffer cmdBuffer,
uint32_t eventCount,
const VkEvent* pEvents,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
uint32_t memoryBarrierCount,
const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers)
{
{
byte *memory = GetTempMemory( sizeof(VkEvent)*eventCount +
sizeof(VkBufferMemoryBarrier)*bufferMemoryBarrierCount +
sizeof(VkImageMemoryBarrier)*imageMemoryBarrierCount);
VkEvent *ev = (VkEvent *)memory;
VkImageMemoryBarrier *im = (VkImageMemoryBarrier *)(ev + eventCount);
VkBufferMemoryBarrier *buf = (VkBufferMemoryBarrier *)(im + imageMemoryBarrierCount);
for(uint32_t i=0; i < eventCount; i++)
ev[i] = Unwrap(pEvents[i]);
for(uint32_t i=0; i < bufferMemoryBarrierCount; i++)
{
buf[i] = pBufferMemoryBarriers[i];
buf[i].buffer = Unwrap(buf[i].buffer);
}
for(uint32_t i=0; i < imageMemoryBarrierCount; i++)
{
im[i] = pImageMemoryBarriers[i];
im[i].image = Unwrap(im[i].image);
}
ObjDisp(cmdBuffer)->CmdWaitEvents(Unwrap(cmdBuffer), eventCount, ev, srcStageMask, dstStageMask,
memoryBarrierCount, pMemoryBarriers,
bufferMemoryBarrierCount, buf,
imageMemoryBarrierCount, im);
}
if(m_State >= WRITING)
{
VkResourceRecord *record = GetRecord(cmdBuffer);
CACHE_THREAD_SERIALISER();
SCOPED_SERIALISE_CONTEXT(CMD_WAIT_EVENTS);
Serialise_vkCmdWaitEvents(localSerialiser, cmdBuffer, eventCount, pEvents, srcStageMask, dstStageMask,
memoryBarrierCount, pMemoryBarriers,
bufferMemoryBarrierCount, pBufferMemoryBarriers,
imageMemoryBarrierCount, pImageMemoryBarriers);
if(imageMemoryBarrierCount > 0)
{
SCOPED_LOCK(m_ImageLayoutsLock);
GetResourceManager()->RecordBarriers(GetRecord(cmdBuffer)->cmdInfo->imgbarriers, m_ImageLayouts, imageMemoryBarrierCount, pImageMemoryBarriers);
}
record->AddChunk(scope.Get());
for(uint32_t i=0; i < eventCount; i++)
record->MarkResourceFrameReferenced(GetResID(pEvents[i]), eFrameRef_Read);
}
}