2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2017-02-12 14:08:52 +00:00
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QVulkanInstance>
|
|
|
|
#include <QLoggingCategory>
|
|
|
|
#include "hellovulkantexture.h"
|
|
|
|
|
|
|
|
Q_LOGGING_CATEGORY(lcVk, "qt.vulkan")
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
|
|
|
|
QLoggingCategory::setFilterRules(QStringLiteral("qt.vulkan=true"));
|
|
|
|
|
|
|
|
QVulkanInstance inst;
|
2021-05-21 16:56:22 +00:00
|
|
|
inst.setLayers({ "VK_LAYER_KHRONOS_validation" });
|
2017-02-12 14:08:52 +00:00
|
|
|
|
|
|
|
if (!inst.create())
|
|
|
|
qFatal("Failed to create Vulkan instance: %d", inst.errorCode());
|
|
|
|
|
|
|
|
VulkanWindow w;
|
|
|
|
w.setVulkanInstance(&inst);
|
|
|
|
if (QCoreApplication::arguments().contains(QStringLiteral("--srgb")))
|
2020-06-22 08:12:38 +00:00
|
|
|
w.setPreferredColorFormats(QList<VkFormat>() << VK_FORMAT_B8G8R8A8_SRGB);
|
2017-02-12 14:08:52 +00:00
|
|
|
|
|
|
|
w.resize(1024, 768);
|
|
|
|
w.show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|