去除swapChain.hpp依赖

test-headless
ink-soul 2024-04-16 16:59:10 +08:00
parent dfeca1b376
commit 26a66c4f0d
3 changed files with 7 additions and 7 deletions

View File

@ -391,7 +391,7 @@ VulkanExampleBase::VulkanExampleBase()
VulkanExampleBase::~VulkanExampleBase()
{
// Clean up Vulkan resources
swapChain.cleanup();
//swapChain.cleanup();
vkDestroyDescriptorPool(device, descriptorPool, nullptr);
vkDestroyRenderPass(device, renderPass, nullptr);
for (uint32_t i = 0; i < frameBuffers.size(); i++) {
@ -791,5 +791,5 @@ void VulkanExampleBase::initSwapchain()
void VulkanExampleBase::setupSwapChain()
{
swapChain.create(&width, &height, settings.vsync);
//swapChain.create(&width, &height, settings.vsync);
}

View File

@ -30,9 +30,9 @@
#include "keycodes.hpp"
#include "VulkanDevice.hpp"
#include "VulkanSwapChain.hpp"
//#include "VulkanSwapChain.hpp"
#include "imgui/imgui.h"
//#include "imgui/imgui.h"
class VulkanExampleBase
{
@ -42,7 +42,7 @@ private:
uint32_t destWidth;
uint32_t destHeight;
bool resizing = false;
void handleMouseMove(int32_t x, int32_t y);
//void handleMouseMove(int32_t x, int32_t y);
PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallback;
PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallback;
VkDebugReportCallbackEXT debugReportCallback;
@ -74,7 +74,7 @@ protected:
uint32_t currentBuffer = 0;
VkDescriptorPool descriptorPool;
VkPipelineCache pipelineCache;
VulkanSwapChain swapChain;
//VulkanSwapChain swapChain;
std::string title = "Vulkan Example";
std::string name = "vulkanExample";
//void windowResize();

View File

@ -1626,7 +1626,7 @@ PlumageRender::PlumageRender()
VkFormatProperties formatProps;
// Check if the device supports blitting from optimal images (the swapchain images are in optimal format)
vkGetPhysicalDeviceFormatProperties(physicalDevice, swapChain.colorFormat, &formatProps);
vkGetPhysicalDeviceFormatProperties(physicalDevice, colorFormat, &formatProps);
if (!(formatProps.optimalTilingFeatures & VK_FORMAT_FEATURE_BLIT_SRC_BIT)) {
std::cerr << "Device does not support blitting from optimal tiled images, using copy instead of blit!" << std::endl;
supportsBlit = false;