Browse Source

vulkan: remove instanceVersion class member
This is not actually needed. The api version specified when creating
the vulkan instance should be the highest api version that might
be used by the application, which can be higher than the supported
instance version. VMA can make use of vulkan 1.3 features so this
can be hardcoded to VK_API_VERSION_1_3.

niki 2 years ago
parent
commit
97a7042143
2 changed files with 3 additions and 33 deletions
  1. 3 32
      src/modules/graphics/vulkan/Graphics.cpp
  2. 0 1
      src/modules/graphics/vulkan/Graphics.h

+ 3 - 32
src/modules/graphics/vulkan/Graphics.cpp

@@ -81,8 +81,6 @@ Graphics::Graphics()
 		throw love::Exception("could not find vulkan");
 
 	volkInitializeCustom((PFN_vkGetInstanceProcAddr)SDL_Vulkan_GetVkGetInstanceProcAddr());
-
-	instanceVersion = volkGetInstanceVersion();
 }
 
 Graphics::~Graphics()
@@ -599,7 +597,7 @@ void Graphics::unSetMode()
 	renderPassUsages.clear();
 	framebufferUsages.clear();
 	pipelineUsages.clear();
-
+	
 	created = false;
 	vkDeviceWaitIdle(device);
 	Volatile::unloadAll();
@@ -673,34 +671,7 @@ Graphics::RendererInfo Graphics::getRendererInfo() const
 
 	Graphics::RendererInfo info;
 
-	if (isDebugEnabled())
-	{
-		std::stringstream ss;
-		ss << "Vulkan( ";
-		ss << renderPasses.size() << " ";
-		ss << framebuffers.size() << " ";
-		ss << graphicsPipelines.size() << " ";
-		if (optionalDeviceFeatures.extendedDynamicState)
-			ss << "eds ";
-		if (optionalDeviceFeatures.memoryRequirements2)
-			ss << "mr2 ";
-		if (optionalDeviceFeatures.dedicatedAllocation)
-			ss << "da ";
-		if (optionalDeviceFeatures.bufferDeviceAddress)
-			ss << "bda ";
-		if (optionalDeviceFeatures.memoryBudget)
-			ss << "mb ";
-		if (optionalDeviceFeatures.shaderFloatControls)
-			ss << "sfc ";
-		if (optionalDeviceFeatures.spirv14)
-			ss << "spv14 ";
-		ss << ")";
-
-		info.name = ss.str();
-	}
-	else
-		info.name = "Vulkan";
-
+	info.name = "Vulkan";
 	info.device = deviceProperties.deviceName;
 	info.vendor = Vulkan::getVendorName(deviceProperties.vendorID);
 	info.version = Vulkan::getVulkanApiVersion(deviceProperties.apiVersion);
@@ -1295,7 +1266,7 @@ void Graphics::createVulkanInstance()
 	appInfo.applicationVersion = VK_MAKE_API_VERSION(0, 1, 0, 0);	// get this version from somewhere else?
 	appInfo.pEngineName = "LOVE Game Framework";
 	appInfo.engineVersion = VK_MAKE_API_VERSION(0, VERSION_MAJOR, VERSION_MINOR, VERSION_REV);
-	appInfo.apiVersion = instanceVersion;
+	appInfo.apiVersion = VK_API_VERSION_1_3;
 
 	VkInstanceCreateInfo createInfo{};
 	createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;

+ 0 - 1
src/modules/graphics/vulkan/Graphics.h

@@ -365,7 +365,6 @@ private:
 	VkSampler createSampler(const SamplerState &sampler);
 	void cleanupUnusedObjects();
 
-	uint32_t instanceVersion = VK_API_VERSION_1_0;
 	VkInstance instance = VK_NULL_HANDLE;
 	VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
 	uint32_t deviceApiVersion = VK_API_VERSION_1_0;