Device增加AcquireNextImage
This commit is contained in:
parent
c96eea7bbb
commit
2547bc36a7
@ -57,8 +57,15 @@ namespace
|
||||
}
|
||||
}//namespace
|
||||
|
||||
Device::Device(DeviceAttribute *da)
|
||||
{
|
||||
attr=da;
|
||||
current_framebuffer=0;
|
||||
image_acquired_semaphore=this->CreateSem();
|
||||
}
|
||||
Device::~Device()
|
||||
{
|
||||
delete image_acquired_semaphore;
|
||||
delete attr;
|
||||
}
|
||||
|
||||
@ -213,4 +220,9 @@ Semaphore *Device::CreateSem()
|
||||
|
||||
return(new Semaphore(attr->device,sem));
|
||||
}
|
||||
|
||||
bool Device::AcquireNextImage()
|
||||
{
|
||||
return(vkAcquireNextImageKHR(attr->device,attr->swap_chain,UINT64_MAX,*image_acquired_semaphore,VK_NULL_HANDLE,¤t_framebuffer)==VK_SUCCESS);
|
||||
}
|
||||
VK_NAMESPACE_END
|
||||
|
@ -19,14 +19,14 @@ class Device
|
||||
{
|
||||
DeviceAttribute *attr;
|
||||
|
||||
Semaphore *image_acquired_semaphore;
|
||||
uint32_t current_framebuffer;
|
||||
|
||||
private:
|
||||
|
||||
friend Device *CreateRenderDevice(VkInstance,const PhysicalDevice *,Window *);
|
||||
|
||||
Device(DeviceAttribute *da)
|
||||
{
|
||||
attr=da;
|
||||
}
|
||||
Device(DeviceAttribute *da);
|
||||
|
||||
public:
|
||||
|
||||
@ -66,6 +66,8 @@ public:
|
||||
Fence *CreateFence();
|
||||
|
||||
Semaphore *CreateSem();
|
||||
|
||||
bool AcquireNextImage();
|
||||
};//class Device
|
||||
VK_NAMESPACE_END
|
||||
#endif//HGL_GRAPH_RENDER_SURFACE_INCLUDE
|
||||
|
@ -21,6 +21,8 @@ private:
|
||||
public:
|
||||
|
||||
~Semaphore();
|
||||
|
||||
operator VkSemaphore(){return sem;}
|
||||
};//class Semaphore
|
||||
VK_NAMESPACE_END
|
||||
#endif//HGL_GRAPH_VULKAN_SEMAPHORE_INCLUDE
|
||||
|
Loading…
x
Reference in New Issue
Block a user