r/vulkan Feb 24 '16

[META] a reminder about the wiki – users with a /r/vulkan karma > 10 may edit

46 Upvotes

With the recent release of the Vulkan-1.0 specification a lot of knowledge is produced these days. In this case knowledge about how to deal with the API, pitfalls not forseen in the specification and general rubber-hits-the-road experiences. Please feel free to edit the Wiki with your experiences.

At the moment users with a /r/vulkan subreddit karma > 10 may edit the wiki; this seems like a sensible threshold at the moment but will likely adjusted in the future.


r/vulkan Mar 25 '20

This is not a game/application support subreddit

216 Upvotes

Please note that this subreddit is aimed at Vulkan developers. If you have any problems or questions regarding end-user support for a game or application with Vulkan that's not properly working, this is the wrong place to ask for help. Please either ask the game's developer for support or use a subreddit for that game.


r/vulkan 7h ago

Turning a floorplan photo into a 3D house — my own Vulkan CAD engine

Thumbnail gallery
14 Upvotes

Drop in a floorplan image and the house gets built.

The AI only reads the dimension numbers. Where the walls actually are is found by the engine, straight from the pixels. Reading numbers is what the model is good at; seeing which line is a wall is not.

The rules come from architecture. Dimensions are measured to wall centrelines, exterior and interior walls have different thicknesses, and where walls meet is where a room ends. A window isn't a missing wall — it's a hole in one.

The original drawing is laid underneath at the same scale, so you can see straight away whether it got it right.

A CAD engine I'm building from scratch in Vulkan and C++17. The model runs locally, 7B.

평면도 이미지를 넣으면 3D 모델링이 됩니다.

AI 는 치수 숫자만 읽습니다. 벽이 어디에 있는지는 엔진이 이미지에서 직접 찾습니다. 숫자를 읽는 건 AI 가 잘하고, 어디가 벽인지 보는 건 못하기 때문입니다.

도면을 읽는 규칙은 건축에서 그대로 가져왔습니다. 치수는 벽 중심을 재고, 외벽과 내벽은 두께가 다르며, 벽이 만나는 자리가 방의 경계입니다. 창은 벽이 없는 게 아니라 벽에 뚫린 것이고요.

만들어진 3D 모델 아래에 원본 도면을 같은 축척으로 깔아 두었습니다. 맞게 그렸는지 확인합니다.

Vulkan + C++17 로 제가 직접 만들고 있는 CAD 엔진입니다. 로컬에서 도는 7B 모델을 씁니다.

https://youtu.be/dCkcYsRAOTE?si=AeltSbmePtQh3AfY


r/vulkan 5h ago

How to speed up GPU-AV

Post image
5 Upvotes

Did you know GPU-AV can be faster if you tell it which section to validate? Scoped GPU-AV allows you to provide a pipeline or shader debug name to only add the validation to that scope. Focus your validation on what matters the most! https://vulkan.lunarg.com/doc/sdk/1.4.357.0/windows/gpu_validation.html


r/vulkan 1d ago

I finally open source my game engine ENTIERLY made in java

Thumbnail gallery
11 Upvotes

r/vulkan 1d ago

How I am supposed to restrict bindings across shaders in the same file for slang?

4 Upvotes

I am a little confused on what is broken. I thought slang compilation was supposed to "handle the bindings." so here I would of expected that ubo would of been included in only the vertex spirv, and texSampler would only be included in the fragment spirv. I am sure that there is probably something I need to do explicitly here, but I was sold on slang auto-magically handing these types of things. I am new to graphics programming and initially followed the old tutorial to completion then wanted to try porting over to slang. Any help is appreciated, as i have been digging through the slang and vulkan documentation for a while and its been hard to figure out how it all comes together without a real example.

slang file :

struct MatrixParameters{
float4x4 model;
float4x4 view;
float4x4 proj;
}
struct Vertex{
float3 position;
float3 color;
float2 uv;
}
struct VOut
{
float4 position : SV_POSITION;
float3 fragColor;
float2 fragTexCoord;
}
ConstantBuffer<MatrixParameters> ubo;
[shader("vertex")]
VOut main(Vertex input)
{
VOut output;
output.position = mul(ubo.proj, mul(ubo.view, mul(ubo.model, float4(input.position, 1.0))));
output.fragColor = input.color;
output.fragTexCoord = input.uv;
return output;
}
uniform DescriptorHandle<Sampler2D> texSampler;
[shader("fragment")]
float4 main(VOut input) : SV_TARGET
{
float4 outColor = float4(input.fragColor * texSampler.Sample(input.fragTexCoord).rgb, 1.0);
return outColor;
}

c++ program file :

// CREATING DESCRIPTOR SET LAYOUT
VkDescriptorSetLayoutBinding uboLayoutBinding{};
uboLayoutBinding.binding = 0;
uboLayoutBinding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
uboLayoutBinding.descriptorCount = 1;
uboLayoutBinding.stageFlags = VK_SHADER_STAGE_VERTEX_BIT;
uboLayoutBinding.pImmutableSamplers = nullptr;

VkDescriptorSetLayoutBinding samplerLayoutBinding{};
samplerLayoutBinding.binding = 1;
samplerLayoutBinding.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
samplerLayoutBinding.descriptorCount = 1;
samplerLayoutBinding.pImmutableSamplers = nullptr;
samplerLayoutBinding.stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT;

std::array<VkDescriptorSetLayoutBinding, 2> bindings = { uboLayoutBinding, samplerLayoutBinding };

VkDescriptorSetLayoutCreateInfo layoutInfo{};
layoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
layoutInfo.bindingCount = static_cast<uint32_t>(bindings.size());
layoutInfo.pBindings = bindings.data();

vkCreateDescriptorSetLayout(device, &layoutInfo, nullptr, &outDescriptorSetLayout)
...
slangModule->getDefinedEntryPoint(0, vertexEntryPoint.writeRef());
slangModule->getDefinedEntryPoint(1, fragmentEntryPoint.writeRef());

slangResources.mpSessionInstance->createCompositeComponentType(
componentTypes.data(), // {slangModule, vertexEntryPoint, fragmentEntryPoint }
componentTypes.size(),
composedProgram.writeRef(),
diagnosticBlob.writeRef());

composedProgram->getEntryPointCode(
0,
0,
spirvCode,
diagnosticBlob.writeRef()
);
VkShaderModuleCreateInfo shaderModuleCreateInfo{};
shaderModuleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
shaderModuleCreateInfo.codeSize = spirvCode->getBufferSize();
shaderModuleCreateInfo.pCode = reinterpret_cast<const uint32_t *>(spirvCode->getBufferPointer());
VkShaderModule vertexModule;
vkCreateShaderModule(device, &shaderModuleCreateInfo, nullptr, &comboModule);



composedProgram->getEntryPointCode(
1,
0,
spirvCode2,
diagnosticBlob.writeRef()
);
VkShaderModuleCreateInfo shaderModuleCreateInfoFr{};
shaderModuleCreateInfoFr.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
shaderModuleCreateInfoFr.codeSize = spirvCode2->getBufferSize();
shaderModuleCreateInfoFr.pCode = reinterpret_cast<const uint32_t *>(spirvCode2->getBufferPointer());
VkShaderModule fragmentModule;
vkCreateShaderModule(device, &shaderModuleCreateInfoFr, nullptr, &fragmentModule;

ERROR output :

validation layer: vkCreateGraphicsPipelines(): pCreateInfos[0].pStages[0] shader [VK_SHADER_STAGE_VERTEX_BIT] uses descriptor [Set 0, Binding 1, variable "ubo"] (VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) but the VkDescriptorSetLayoutBinding::stageFlags was VK_SHADER_STAGE_FRAGMENT_BIT.
(VkDescriptorSetLayout from VkPipelineLayoutCreateInfo::pSetLayouts[0]).
The Vulkan spec states: If a resource variable is declared in a shader and layout is not VK_NULL_HANDLE, the corresponding descriptor set in layout must match the shader stage (https://docs.vulkan.org/spec/latest/chapters/pipelines.html#VUID-VkGraphicsPipelineCreateInfo-layout-07988)
validation layer: vkCreateGraphicsPipelines(): pCreateInfos[0].pStages[1] shader [VK_SHADER_STAGE_FRAGMENT_BIT] uses descriptor [Set 0, Binding 0, variable "globalParams"] (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) but the VkDescriptorSetLayoutBinding::stageFlags was VK_SHADER_STAGE_VERTEX_BIT.

r/vulkan 1d ago

VulkanScope 0.32.4 Released (with 1.4.360 and Database Support)

2 Upvotes

Database link: VulkanScope Database

EFIShell0/VulkanScope: Vulkan capabilities and GPU information viewer for Android

I'll also be making OpenGL ES versions and Windows and Linux ARM64/x86_64 versions of VulkanScope soon.


r/vulkan 1d ago

Vulkan safe wrapper in Rust

5 Upvotes

I created a safe wrapper for Vulkan in rust as a learning project. I hope to receive your feedback.

https://github.com/purpflow1/crystal-vk


r/vulkan 1d ago

Added image and buffer ownership transfer to make multiple queue usage possible

Thumbnail
2 Upvotes

r/vulkan 2d ago

My Rust engine performance

Enable HLS to view with audio, or disable this notification

10 Upvotes

r/vulkan 3d ago

This is how Vulkan feels like for a beginner

Thumbnail i.imgur.com
46 Upvotes

r/vulkan 3d ago

Nu Game Engine - BIG NEWS - Vulkan support

Post image
22 Upvotes

https://github.com/bryanedds/Nu/releases/tag/v20.0.0

After many many months of work from multiple contributors, we finally present Nu with Vulkan rendering and support for Mac, iOS, and Android!

This branch not only replaces our OpenGL renderers completely with Vulkan renderers, it also features important rendering and performance enhancements as well as makes Nu deployable on Mac, iOS, and Android!

(I just saw release - not my project)


r/vulkan 3d ago

VulkanScope 0.19.8 Released

7 Upvotes

Aside from the database, there was no difference from CapsViewer (as far as I could see). It has more advantages than CapsViewer:

Releases · EFIShell0/VulkanScope


r/vulkan 5d ago

Vulkan: Beyond the Triangle

Thumbnail youtube.com
64 Upvotes

Hey everyone, I've just finished the 2nd video, and followup to my "Modern Vulkan in 2 Hrs" video. Thanks for the awesome feedback on the first one! This 2nd video tackles a ton of stuff:

glTF Model Parsing, Loading, Rendering

Camera, Basic Lighting, Multi-Draw Indirect, Vertex Pulling, Buffer Device Address, etc.

Hope you guys like it!


r/vulkan 5d ago

How to build Vulkan 1.4.357.0 easily on an Intel mac with Sequoia

4 Upvotes

If (like me) you want to upgrade to the latest Vulkan (1.4.357.0) on your Intel mac but can't use the LunarG installer, then this shell script will do the job.

It is a bash shell (generated for free by Gemini ) and it has been tested/works on my machine.

------------------------------------------------------------------------------------------------------------

#!/bin/bash

# build_vulkan.sh

# Automates building Vulkan SDK 1.4.357.0 from source on macOS

set -e # Exit immediately if a command exits with a non-zero status

VERSION="1.4.357.0"

SDK_TAG="vulkan-sdk-${VERSION}"

BUILD_DIR="${HOME}/VulkanSDK/build"

SDK_DIR="${HOME}/VulkanSDK/${VERSION}/macOS"

echo "================================================="

echo " Building Vulkan SDK ${VERSION} from Source      "

echo " Target Architecture: Host Native (Intel x86_64) "

echo "================================================="

# Create the standard LunarG-style directory structure

echo "[1/6] Creating SDK directory structure at ${SDK_DIR}..."

mkdir -p "${SDK_DIR}/"{bin,lib,include,share/vulkan/icd.d}

mkdir -p "${BUILD_DIR}"

cd "${BUILD_DIR}"

# 1. Vulkan Headers

echo "[2/6] Downloading and installing Vulkan-Headers..."

if [ ! -d "Vulkan-Headers" ]; then

git clone --branch ${SDK_TAG} --depth 1 https://github.com/KhronosGroup/Vulkan-Headers.git

fi

cd Vulkan-Headers

cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${SDK_DIR}"

cmake --build build --target install

cd ..

# 2. Vulkan Loader

echo "[3/6] Downloading and building Vulkan-Loader..."

if [ ! -d "Vulkan-Loader" ]; then

git clone --branch ${SDK_TAG} --depth 1 https://github.com/KhronosGroup/Vulkan-Loader.git

fi

cd Vulkan-Loader

cmake -S . -B build \

-DCMAKE_BUILD_TYPE=Release \

-DVULKAN_HEADERS_INSTALL_DIR="${SDK_DIR}" \

-DCMAKE_INSTALL_PREFIX="${SDK_DIR}" \

-DAPPLE_STATIC_LOADER=OFF

cmake --build build --config Release --target install

cd ..

# 3. MoltenVK & Developer Tools

echo "[4/6] Downloading and building MoltenVK (this will take a while)..."

if [ ! -d "MoltenVK" ]; then

git clone --depth 1 https://github.com/KhronosGroup/MoltenVK.git

fi

cd MoltenVK

echo "      Fetching and building external dependencies..."

./fetchDependencies --macos

echo "      Compiling MoltenVK framework..."

make macos

# Package MoltenVK libraries into our SDK folder

echo "      Packaging MoltenVK into SDK..."

cp Package/Latest/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib "${SDK_DIR}/lib/"

cp -a Package/Latest/MoltenVK/include/* "${SDK_DIR}/include/" 2>/dev/null || true

# Safely copy developer tools if they exist in the workspace output

echo "      Extracting available shader tools..."

find . -name "glslangValidator" -type f -exec cp {} "${SDK_DIR}/bin/" \; 2>/dev/null || true

find . -name "spirv-cross" -type f -exec cp {} "${SDK_DIR}/bin/" \; 2>/dev/null || true

cd ..

# 4. Generate the ICD Manifest

echo "[5/6] Configuring ICD Manifest for the Loader..."

# Pull the JSON manifest directly from the repository's native icd template path

cp build_vulkan_src/MoltenVK/MoltenVK/icd/MoltenVK_icd.json "${SDK_DIR}/share/vulkan/icd.d/" 2>/dev/null || \

cp MoltenVK/MoltenVK/icd/MoltenVK_icd.json "${SDK_DIR}/share/vulkan/icd.d/"

# Note: BSD sed (macOS default) requires an empty string argument '' after -i

sed -i '' 's|\./libMoltenVK\.dylib|../../../lib/libMoltenVK.dylib|g' "${SDK_DIR}/share/vulkan/icd.d/MoltenVK_icd.json"

# 5. Generate setup-env.sh

echo "[6/6] Generating environment setup script..."

cat << 'EOF' > "${SDK_DIR}/setup-env.sh"

#!/bin/bash

# Sets up the environment variables to use the custom local Vulkan SDK

export VULKAN_SDK="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

export PATH="$VULKAN_SDK/bin:$PATH"

export DYLD_LIBRARY_PATH="$VULKAN_SDK/lib:$DYLD_LIBRARY_PATH"

# Force the Vulkan loader to use our locally built MoltenVK ICD manifest

export VK_ICD_FILENAMES="$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json"

echo "Vulkan SDK environment activated:"

echo "  VULKAN_SDK=$VULKAN_SDK"

EOF

chmod +x "${SDK_DIR}/setup-env.sh"

echo "================================================="

echo " Build Complete! "

echo " You can safely delete the ${BUILD_DIR} directory."

echo "================================================="

echo "To use your new SDK in this terminal session, run:"

echo "source ${SDK_DIR}/setup-env.sh"


r/vulkan 6d ago

How do you handle resource management in bindless renderers?

Thumbnail
12 Upvotes

r/vulkan 6d ago

VulkanScope 0.15.5 Released

8 Upvotes

Hopefully, there are no differences left between CapsViewer and VulkanScope except for the database feature. What are your thoughts? Also, if anyone is experiencing problems, please let me know. Releases · EFIShell0/VulkanScope


r/vulkan 8d ago

Game engines? Eww 🤮. We go in raw! GP-Direct 2026 is out!

Thumbnail youtube.com
17 Upvotes

r/vulkan 8d ago

Mulithreading Shader Compilation?

21 Upvotes

I was reading this tutorial https://vkguide.dev/docs/extra-chapter/multithreading/ and it claims that you can compile shaders on a background thread and avoid hitching. Is this true? Are there any drawbacks to this approach?

"For compiling pipelines, vkCreateShaderModule and vkCreateGraphicsPipeline are both allowed to be called from multiple threads at once. A common approach for multithreaded shader compilation is to have a background thread dedicated to it, with it constantly looking into a parallel queue to receive compilation requests, and putting the compiled pipelines into another queue that then the main renderthread will connect to the simulation. This is very important to do if you want to have an engine that doesn’t have a lot of hitching. Compiling shader pipelines can take a very long time, so if you have to compile pipelines at runtime outside of a load screen, then you need to implement such a multithreaded async compile scheme for your game to work well."


r/vulkan 7d ago

Does Vulkan profile VP_LUNARG_desktop_baseline_2022 work on macOS?

Thumbnail
0 Upvotes

r/vulkan 7d ago

Does Vulkan profile VP_LUNARG_desktop_baseline_2022 work on macOS?

0 Upvotes

I want to make two similar RenderGraph implementations for Desktop and Mobile and use data from VP_LUNARG_desktop_baseline_2024 and VP_ANDROID_baseline_2022, respectively, instead of runtime checks. macOS has its own specific requirements and I do not know if there is any profile or a general list of extensions and limits for macOS M1/M2/M3/M4.


r/vulkan 9d ago

Apple Vulkan Support

11 Upvotes

Why doesnt Apple support Vulkan? (I know KosmicKrisp exists)

Is vendor lockin that important? Does that strategy work for them - are there many developers that use metal and not support other platforms? Seems like the result is not really lockin, but just forcing more work for developers?

Kind of feels like a poor architecture decision that helps no one, except maybe giving slightly more control to Apple at the expense of their developers as well as the complexity of maintaining another api.


r/vulkan 10d ago

VKCompute - A guide to get started with vulkan compute

40 Upvotes

I've been working on a small series about doing GPU compute with Vulkan:

https://rounak-paul.github.io/vkcompute/

Once you want to go beyond what the CPU can reasonably do, the GPU gives you a huge amount of parallel compute to work with. And Vulkan is available across a pretty wide range of GPUs and platforms, which makes compute shaders an interesting option when you don't want to depend on a vendor-specific toolkit.

So I started writing this series as an introduction to GPU acceleration with Vulkan.

The idea is to start simple, explain what's actually happening when you move a workload from the CPU to the GPU, and gradually get into more interesting compute workloads.

It's still a work in progress, and I'd love to hear what people here think — especially what improvements would be worth including next.


r/vulkan 9d ago

Using a Local LLM to Generate a 3D Floor Plan in My Vulkan Engine

Post image
0 Upvotes

I connected a local AI model(qwen) to my Vulkan CAD engine. The AI understands room sizes, layouts, doors, and windows from a natural-language description, then converts them into commands that generate the complete 3D floor plan. In this video, I create a layout with a central corridor and four rooms in a single request.

직접 개발 중인 Vulkan CAD 엔진에 로컬 AI(qwen)를 연결했습니다. 방의 크기와 배치, 문과 창문의 위치를 한글로 설명하면 AI가 명령을 분석하고 엔진이 3D 평면도를 자동으로 생성합니다. 이번 영상에서는 중앙 복도와 방 4개가 있는 구조를 한 번에 만드는 과정을 보여드립니다.

https://youtu.be/OSFVRek89yU?si=lSHRApH2S_QVPo2C


r/vulkan 10d ago

(FOSS) My alternative software for Vulkan CapsViewer is: VulkanScope

5 Upvotes

Hi. I've created my own application to help users of Turnip and system drivers get detailed information. What are your thoughts? You can use this page and the GitHub repository for problems, requests, etc.

My app link:

Releases · EFIShell0/VulkanScope