Skip to content

Commit

Permalink
vulkan hacking
Browse files Browse the repository at this point in the history
  • Loading branch information
rectalogic committed Apr 18, 2024
1 parent efd246b commit 6965dd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/MediaFX/render_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ RenderWindow::RenderWindow()
m_vulkanInstance.setExtensions(QQuickGraphicsConfiguration::preferredInstanceExtensions());
m_vulkanInstance.setApiVersion(QVersionNumber(1, 0));
m_vulkanInstance.create();
}
#endif
}

RenderWindow::~RenderWindow() = default;

void RenderWindow::classBegin()
{
#ifdef MEDIAFX_ENABLE_VULKAN
if (rendererInterface()->graphicsApi() == QSGRendererInterface::Vulkan) {
if (!m_vulkanInstance.isValid()) {
qCritical() << "Invalid Vulkan instance";
return;
Expand All @@ -62,6 +52,8 @@ void RenderWindow::classBegin()
m_isValid = true;
}

RenderWindow::~RenderWindow() = default;

void RenderWindow::componentComplete()
{
// QQuickWindow does not resize contentItem
Expand Down
4 changes: 2 additions & 2 deletions src/MediaFX/render_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public slots:
void render();

protected:
void classBegin() override;
void classBegin() override { }
void componentComplete() override;

private:
Expand All @@ -51,9 +51,9 @@ public slots:
RenderSession* renderSession();

RenderSession* m_renderSession = nullptr;
std::unique_ptr<RenderControl> m_renderControl;
#ifdef MEDIAFX_ENABLE_VULKAN
QVulkanInstance m_vulkanInstance;
#endif
std::unique_ptr<RenderControl> m_renderControl;
bool m_isValid = false;
};

0 comments on commit 6965dd2

Please sign in to comment.