summarylogtreecommitdiffstats
path: root/0001-Revert-rendervulkan-Get-a-general-graphics-compute-q.patch
blob: 4c04c658a9167bd2a23d35f76363337de4126aab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
From 29992eab6935cc6da0ecfbef8c97dda32c7413ec Mon Sep 17 00:00:00 2001
From: sharkautarch <128002472+sharkautarch@users.noreply.github.com>
Date: Fri, 27 Oct 2023 17:51:27 -0400
Subject: [PATCH 1/4] Revert "rendervulkan: Get a general graphics+compute
 queue as well as a async compute queue"

This reverts commit bd722f786f5a74f8282d903bd5eb3d331c4cd920.
---
 src/rendervulkan.cpp | 61 +++++++++-----------------------------------
 src/rendervulkan.hpp |  6 -----
 2 files changed, 12 insertions(+), 55 deletions(-)

diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp
index 3e179c4..139bf15 100644
--- a/src/rendervulkan.cpp
+++ b/src/rendervulkan.cpp
@@ -337,7 +337,6 @@ bool CVulkanDevice::selectPhysDev(VkSurfaceKHR surface)
 				}
 
 				m_queueFamily = computeOnlyIndex == ~0u ? generalIndex : computeOnlyIndex;
-				m_generalQueueFamily = generalIndex;
 				m_physDev = cphysDev;
 			}
 		}
@@ -351,7 +350,7 @@ bool CVulkanDevice::selectPhysDev(VkSurfaceKHR surface)
 
 	VkPhysicalDeviceProperties props;
 	vk.GetPhysicalDeviceProperties( m_physDev, &props );
-	vk_log.infof( "selecting physical device '%s': queue family %x (general queue family %x)", props.deviceName, m_queueFamily, m_generalQueueFamily );
+	vk_log.infof( "selecting physical device '%s': queue family %x", props.deviceName, m_queueFamily );
 
 	return true;
 }
@@ -461,22 +460,12 @@ bool CVulkanDevice::createDevice()
 		.globalPriority = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT
 	};
 
-	VkDeviceQueueCreateInfo queueCreateInfos[2] = 
-	{
-		{
-			.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
-			.pNext = g_bNiceCap ? &queueCreateInfoEXT : nullptr,
-			.queueFamilyIndex = m_queueFamily,
-			.queueCount = 1,
-			.pQueuePriorities = &queuePriorities
-		},
-		{
-			.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
-			.pNext = g_bNiceCap ? &queueCreateInfoEXT : nullptr,
-			.queueFamilyIndex = m_generalQueueFamily,
-			.queueCount = 1,
-			.pQueuePriorities = &queuePriorities
-		},
+	VkDeviceQueueCreateInfo queueCreateInfo = {
+		.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
+		.pNext = g_bNiceCap ? &queueCreateInfoEXT : nullptr,
+		.queueFamilyIndex = m_queueFamily,
+		.queueCount = 1,
+		.pQueuePriorities = &queuePriorities
 	};
 
 	std::vector< const char * > enabledExtensions;
@@ -552,8 +541,8 @@ bool CVulkanDevice::createDevice()
 	VkDeviceCreateInfo deviceCreateInfo = {
 		.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
 		.pNext = &features2,
-		.queueCreateInfoCount = std::size(queueCreateInfos),
-		.pQueueCreateInfos = queueCreateInfos,
+		.queueCreateInfoCount = 1,
+		.pQueueCreateInfos = &queueCreateInfo,
 		.enabledExtensionCount = (uint32_t)enabledExtensions.size(),
 		.ppEnabledExtensionNames = enabledExtensions.data(),
 	};
@@ -582,17 +571,9 @@ bool CVulkanDevice::createDevice()
 	VkResult res = vk.CreateDevice(physDev(), &deviceCreateInfo, nullptr, &m_device);
 	if ( res == VK_ERROR_NOT_PERMITTED_KHR && g_bNiceCap )
 	{
-		fprintf(stderr, "vkCreateDevice failed with a high-priority queue (general + compute). Falling back to regular priority (general).\n");
-		queueCreateInfos[1].pNext = nullptr;
+		fprintf(stderr, "vkCreateDevice failed with a high-priority queue. Falling back to regular priority.\n");
+		queueCreateInfo.pNext = nullptr;
 		res = vk.CreateDevice(physDev(), &deviceCreateInfo, nullptr, &m_device);
-
-
-		if ( res == VK_ERROR_NOT_PERMITTED_KHR && g_bNiceCap )
-		{
-			fprintf(stderr, "vkCreateDevice failed with a high-priority queue (compute). Falling back to regular priority (all).\n");
-			queueCreateInfos[0].pNext = nullptr;
-			res = vk.CreateDevice(physDev(), &deviceCreateInfo, nullptr, &m_device);
-		}
 	}
 
 	if ( res != VK_SUCCESS )
@@ -606,7 +587,6 @@ bool CVulkanDevice::createDevice()
 	#undef VK_FUNC
 
 	vk.GetDeviceQueue(device(), m_queueFamily, 0, &m_queue);
-	vk.GetDeviceQueue(device(), m_generalQueueFamily, 0, &m_generalQueue);
 
 	return true;
 }
@@ -781,24 +761,7 @@ bool CVulkanDevice::createPools()
 		return false;
 	}
 
-	VkCommandPoolCreateInfo generalCommandPoolCreateInfo = {
-		.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
-		.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
-		.queueFamilyIndex = m_generalQueueFamily,
-	};
-
-	res = vk.CreateCommandPool(device(), &generalCommandPoolCreateInfo, nullptr, &m_generalCommandPool);
-	if ( res != VK_SUCCESS )
-	{
-		vk_errorf( res, "vkCreateCommandPool failed" );
-		return false;
-	}
-
-	VkDescriptorPoolSize poolSizes[3] {
-		{
-			VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
-			uint32_t(m_descriptorSets.size()),
-		},
+	VkDescriptorPoolSize poolSizes[2] {
 		{
 			VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
 			uint32_t(m_descriptorSets.size()) * 2,
diff --git a/src/rendervulkan.hpp b/src/rendervulkan.hpp
index c60b796..e9a7aa7 100644
--- a/src/rendervulkan.hpp
+++ b/src/rendervulkan.hpp
@@ -723,11 +723,8 @@ public:
 	inline VkPhysicalDevice physDev() {return m_physDev; }
 	inline VkInstance instance() { return m_instance; }
 	inline VkQueue queue() {return m_queue;}
-	inline VkQueue generalQueue() {return m_generalQueue;}
 	inline VkCommandPool commandPool() {return m_commandPool;}
-	inline VkCommandPool generalCommandPool() {return m_generalCommandPool;}
 	inline uint32_t queueFamily() {return m_queueFamily;}
-	inline uint32_t generalQueueFamily() {return m_generalQueueFamily;}
 	inline VkBuffer uploadBuffer() {return m_uploadBuffer;}
 	inline VkPipelineLayout pipelineLayout() {return m_pipelineLayout;}
 	inline int drmRenderFd() {return m_drmRendererFd;}
@@ -778,17 +775,14 @@ protected:
 	VkPhysicalDevice m_physDev = nullptr;
 	VkInstance m_instance = nullptr;
 	VkQueue m_queue = nullptr;
-	VkQueue m_generalQueue = nullptr;
 	VkSamplerYcbcrConversion m_ycbcrConversion = VK_NULL_HANDLE;
 	VkSampler m_ycbcrSampler = VK_NULL_HANDLE;
 	VkDescriptorSetLayout m_descriptorSetLayout = VK_NULL_HANDLE;
 	VkPipelineLayout m_pipelineLayout = VK_NULL_HANDLE;
 	VkDescriptorPool m_descriptorPool = VK_NULL_HANDLE;
 	VkCommandPool m_commandPool = VK_NULL_HANDLE;
-	VkCommandPool m_generalCommandPool = VK_NULL_HANDLE;
 
 	uint32_t m_queueFamily = -1;
-	uint32_t m_generalQueueFamily = -1;
 
 	int m_drmRendererFd = -1;
 	dev_t m_drmPrimaryDevId = 0;
-- 
2.43.0