增加GetDeviceQueue代码,,,,会崩溃(原因未知)
This commit is contained in:
parent
d9b0739c4d
commit
9ad7a3cd70
@ -23,6 +23,7 @@ SET(VULKAN_TEST_SOURCE_FILES main.cpp
|
|||||||
VKPipeline.cpp
|
VKPipeline.cpp
|
||||||
VKSemaphore.cpp
|
VKSemaphore.cpp
|
||||||
VKFramebuffer.cpp
|
VKFramebuffer.cpp
|
||||||
|
VKFence.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(VULKAN_TEST_HEADER_FILES VK.h
|
SET(VULKAN_TEST_HEADER_FILES VK.h
|
||||||
@ -42,6 +43,7 @@ SET(VULKAN_TEST_HEADER_FILES VK.h
|
|||||||
VKSemaphore.h
|
VKSemaphore.h
|
||||||
VKPipeline.h
|
VKPipeline.h
|
||||||
VKFramebuffer.h
|
VKFramebuffer.h
|
||||||
|
VKFence.h
|
||||||
Window.h)
|
Window.h)
|
||||||
|
|
||||||
SET(SHADER_FILES shader_compile.bat
|
SET(SHADER_FILES shader_compile.bat
|
||||||
|
@ -20,6 +20,9 @@ struct DeviceAttribute
|
|||||||
uint32_t graphics_family =ERROR_FAMILY_INDEX;
|
uint32_t graphics_family =ERROR_FAMILY_INDEX;
|
||||||
uint32_t present_family =ERROR_FAMILY_INDEX;
|
uint32_t present_family =ERROR_FAMILY_INDEX;
|
||||||
|
|
||||||
|
VkQueue graphics_queue =nullptr;
|
||||||
|
VkQueue present_queue =nullptr;
|
||||||
|
|
||||||
List<VkQueueFamilyProperties> family_properties;
|
List<VkQueueFamilyProperties> family_properties;
|
||||||
List<VkBool32> supports_present;
|
List<VkBool32> supports_present;
|
||||||
|
|
||||||
|
@ -64,6 +64,16 @@ namespace
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetDeviceQueue(DeviceAttribute *attr)
|
||||||
|
{
|
||||||
|
vkGetDeviceQueue(attr->device,attr->graphics_family,0,&attr->graphics_queue);
|
||||||
|
|
||||||
|
if(attr->graphics_family==attr->present_family)
|
||||||
|
attr->present_queue=attr->graphics_queue;
|
||||||
|
else
|
||||||
|
vkGetDeviceQueue(attr->device,attr->present_family,0,&attr->present_queue);
|
||||||
|
}
|
||||||
|
|
||||||
VkCommandPool CreateCommandPool(VkDevice device,uint32_t graphics_family)
|
VkCommandPool CreateCommandPool(VkDevice device,uint32_t graphics_family)
|
||||||
{
|
{
|
||||||
VkCommandPoolCreateInfo cmd_pool_info={};
|
VkCommandPoolCreateInfo cmd_pool_info={};
|
||||||
@ -327,6 +337,8 @@ Device *CreateRenderDevice(VkInstance inst,const PhysicalDevice *physical_device
|
|||||||
if(!rdc->device)
|
if(!rdc->device)
|
||||||
return(nullptr);
|
return(nullptr);
|
||||||
|
|
||||||
|
GetDeviceQueue(rdc.attr);
|
||||||
|
|
||||||
rdc->cmd_pool=CreateCommandPool(rdc->device,rdc->graphics_family);
|
rdc->cmd_pool=CreateCommandPool(rdc->device,rdc->graphics_family);
|
||||||
|
|
||||||
if(!rdc->cmd_pool)
|
if(!rdc->cmd_pool)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user