Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 11045617aa83f22895897e45d021b524d3a6acb9 authored by COCCO Giovanni on 28 February 2025, 12:08:40 UTC, committed by COCCO Giovanni on 28 February 2025, 12:08:40 UTC
Improve compilation instructions
1 parent 3b61880
  • Files
  • Changes
  • 0ee58b7
  • /
  • src
  • /
  • main.cpp
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:11045617aa83f22895897e45d021b524d3a6acb9
directory badge Iframe embedding
swh:1:dir:6b737dfe39941d8c638d66c432c91f0d7d344a60
content badge Iframe embedding
swh:1:cnt:3387c56421af05ae98512a82b0fb9c932738ad11
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
main.cpp
#include <QApplication>
#include <QLoggingCategory>
#include <QFile>
#include <QScreen>
#include "src/UI/vulkanwindow.h"
#include "src/UI/mainapp.h"
#include <cstdlib>
#include <ctime>

Q_LOGGING_CATEGORY(lcVk, "qt.vulkan")

int main(int argc, char *argv[]) {
    srand(static_cast <unsigned> (time(0)));

    QApplication app(argc, argv);
    QLoggingCategory::setFilterRules(QStringLiteral("qt.vulkan=true"));

    MainApp mainApp;
    mainApp.resize(1024, 576);
    mainApp.show();

    QVulkanInstance inst;
    inst.setApiVersion(QVersionNumber(1, 1));
#ifdef QT_DEBUG
    inst.setLayers({ "VK_LAYER_KHRONOS_validation" });
#endif
    if (!inst.create())
        qFatal("Failed to create Vulkan instance: %d", inst.errorCode());

    VulkanWindow vulkanWindow(&mainApp);
    vulkanWindow.setDeviceExtensions({ "VK_EXT_descriptor_indexing" });
    vulkanWindow.setVulkanInstance(&inst);

    VkPhysicalDeviceDescriptorIndexingFeatures indexFeatures = {};
    VkPhysicalDeviceHostQueryResetFeatures resetFeatures = {};
    indexFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES;
    resetFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES;
    vulkanWindow.setEnabledFeaturesModifier([&](VkPhysicalDeviceFeatures2& features) {
        features.pNext = &indexFeatures;
        indexFeatures.pNext = &resetFeatures;
        vulkanWindow.vulkanInstance()->functions()->
            vkGetPhysicalDeviceFeatures2(vulkanWindow.physicalDevice(), &features);
    });

    const float prio[] = {0};
    vulkanWindow.setQueueCreateInfoModifier([&](
        const VkQueueFamilyProperties *properties, uint32_t count, QList<VkDeviceQueueCreateInfo> &info) {
        for (size_t i = 0; i < count; ++i) {
            if (properties[i].queueFlags & VK_QUEUE_COMPUTE_BIT) {
                bool alreadyPresent = false;
                for (auto &createInfo: info) {
                    if (createInfo.queueFamilyIndex == i) {
                        alreadyPresent = true;
                    }
                }
                if (!alreadyPresent) {
                    VkDeviceQueueCreateInfo addQueueInfo {};
                    addQueueInfo.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
                    addQueueInfo.queueFamilyIndex = i;
                    addQueueInfo.queueCount = 1;
                    addQueueInfo.pQueuePriorities = prio;
                    info.append(addQueueInfo);
                }
                vulkanWindow.setComputeQueueFamilyIndex(i);
                break;
            }
        }
    });

    mainApp.init(&vulkanWindow);
    return app.exec();
}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top