forked from pupbrained/vulkan-test
weh
This commit is contained in:
parent
134b43c1d4
commit
658595e0c5
3
.envrc
3
.envrc
|
@ -1,2 +1 @@
|
|||
export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
|
||||
use_flake . --impure
|
||||
use_flake
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
# This file was generated by nvfetcher, please do not modify it manually.
|
||||
{
|
||||
fetchgit,
|
||||
fetchurl,
|
||||
fetchFromGitHub,
|
||||
dockerTools,
|
||||
}: {
|
||||
fmt = {
|
||||
pname = "fmt";
|
||||
|
|
13
flake.nix
13
flake.nix
|
@ -16,7 +16,11 @@
|
|||
}:
|
||||
utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
config.allowUnsupportedSystem = true;
|
||||
};
|
||||
|
||||
stdenv =
|
||||
if pkgs.hostPlatform.isLinux
|
||||
|
@ -81,7 +85,6 @@
|
|||
projectRootFile = "flake.nix";
|
||||
programs = {
|
||||
alejandra.enable = true;
|
||||
deadnix.enable = true;
|
||||
|
||||
clang-format = {
|
||||
enable = true;
|
||||
|
@ -115,7 +118,11 @@
|
|||
VK_ICD_FILENAMES =
|
||||
if stdenv.isDarwin
|
||||
then "${darwin.moltenvk}/share/vulkan/icd.d/MoltenVK_icd.json"
|
||||
else "";
|
||||
else let
|
||||
vulkanDir = "${mesa.drivers}/share/vulkan/icd.d";
|
||||
vulkanFiles = builtins.filter (file: builtins.match ".*\\.json$" file != null) (builtins.attrNames (builtins.readDir vulkanDir));
|
||||
vulkanPaths = lib.concatStringsSep ":" (map (file: "${vulkanDir}/${file}") vulkanFiles);
|
||||
in "${linuxPackages_latest.nvidia_x11}/share/vulkan/icd.d/nvidia_icd.x86_64.json:${vulkanPaths}";
|
||||
|
||||
shellHook = ''
|
||||
export PATH="${llvmPackages_18.clang-tools.override {enableLibcxx = true;}}/bin:$PATH"
|
||||
|
|
10
src/main.cpp
10
src/main.cpp
|
@ -155,7 +155,7 @@ class VulkanApp {
|
|||
for (const auto& device : devices) {
|
||||
#ifndef NDEBUG
|
||||
vk::PhysicalDeviceProperties properties = device.getProperties();
|
||||
fmt::println("Device: {}", properties.deviceName.data());
|
||||
fmt::println("\t{}", properties.deviceName.data());
|
||||
#endif
|
||||
|
||||
if (isDeviceSuitable(device)) {
|
||||
|
@ -186,6 +186,7 @@ class VulkanApp {
|
|||
|
||||
vk::PhysicalDeviceFeatures deviceFeatures;
|
||||
|
||||
#ifdef __APPLE__
|
||||
// Add the portability subset extension
|
||||
std::vector<const char*> deviceExtensions = { "VK_KHR_portability_subset" };
|
||||
|
||||
|
@ -194,6 +195,13 @@ class VulkanApp {
|
|||
.enabledExtensionCount = static_cast<u32>(deviceExtensions.size()),
|
||||
.ppEnabledExtensionNames = deviceExtensions.data(),
|
||||
.pEnabledFeatures = &deviceFeatures };
|
||||
#else
|
||||
vk::DeviceCreateInfo createInfo { .queueCreateInfoCount = static_cast<u32>(queueCreateInfos.size()),
|
||||
.pQueueCreateInfos = queueCreateInfos.data(),
|
||||
.enabledExtensionCount = 0,
|
||||
.ppEnabledExtensionNames = nullptr,
|
||||
.pEnabledFeatures = &deviceFeatures };
|
||||
#endif
|
||||
|
||||
mDevice = mPhysicalDevice.createDeviceUnique(createInfo);
|
||||
|
||||
|
|
Loading…
Reference in a new issue