2,541 questions
-1
votes
0
answers
24
views
Compiler can't find vulkan.h?
I am on Windows 11. I downloaded and installed the Vulkan SDK on my Windows machines. When I try to compile, I keep seeing:
vulkan/vulkan.h: No such file or directory
I have installed: C:\VulkanSDK\1....
Advice
0
votes
2
replies
30
views
Is optimization done at graphics pipeline creation time between stages?
The reason I'm asking this question is because I have cases in a vertex shader where I have:
layout (location = 0) out float3 outEyeSpacePosition;
layout (location = 1) out float2 out_tex_coords;
And ...
0
votes
1
answer
26
views
Are Vulkan validation layers injected even if they're not enabled on the Vulkan instance?
I discovered something rather surprising to me regarding the Vulkan validation layer that's used for error reporting and debugging. Usually in a debug build I will set the ...
0
votes
1
answer
35
views
Do I need to do one barrier in each queue even if I'm using VK_SHARE_MODE_CONCURRENT?
Let's say we have one queue for transfer (A), and another queue for graphics (B).
Let's say we have a resource, for example a vertex buffer, and we initialize it by transfering data to it using queue ...
Advice
0
votes
6
replies
187
views
The feasibility of creating a small-scope 3D multiplayer game using C and Vulkan
I come seeking advice.
I'm attempting to make a game with C and Vulkan (no engine). It will be low scope. It has a low-mid poly aesthetic, fairly involved mechanics, and will be multiplayer, ...
2
votes
0
answers
107
views
vkCreateDevice fails when linking address sanitizer with Clang
If in my CMake I add:
add_link_options(
-fsanitize=address)
When I do:
vkCreateDevice
In my C++ code, it fails, and I get the errors:
[APPLICATION][INFO] Vulkan ...
0
votes
0
answers
52
views
Problems with fencing sporadic command buffer submission in Vulkan
I am invoking a compute shader, writing to it, then reading it to then write to disk.
According to renderdoc the image is properly generated. Additionally, when compiled in debug mode I get the right ...
0
votes
1
answer
50
views
How to know when a specific submitted for presentation has been dropped or successfully presented on display?
Imagine an app submitting images in FIFO presentation mode. If I use VkSwapchainPresentFenceInfoKHR, the fence is signaled almost immediately, and it is not related to the image being at the front of ...
-1
votes
1
answer
158
views
Weird behavior when using an image as both a color and input attachment
I am trying to implement color blending in the fragment shader because I want to use the alpha channel as a sort of dynamic stencil buffer for future draw calls.
I have attached the swapchain image ...
3
votes
2
answers
91
views
What does a min filter do on the same mip level?
In a graphics API like Vulkan, you have VkFilter, which can be NEAREST or LINEAR. Leaving aside the mipmap filtering, which is another thing altogether, I'm trying to understand what the point of the ...
1
vote
1
answer
99
views
Non-uniform access by indexing vs non-uniform access from a switch case or if-else statement
This question is supposed to be in the most general sense possible, this is because I'm using the Slang shading language to apply potentially to multiple graphics APIs.
In OpenGL and Vulkan the ...
2
votes
1
answer
58
views
Are storage buffers bounds-checked by default?
I found a comment on Reddit saying:
SSBO accesses are bound checked at runtime by the shader to prevent
segmentation faults (which is why the descriptor of a SSBO is a
pointer and size). I think this ...
0
votes
0
answers
90
views
i686 compiler with GNU and SDL3 failing to claim window
I am using an i686 system, with the compiler mingw G++. I can run code that creates a GPU device and attaches it to a window fine on that machine. However, when I attempt to run it on my i686 windows ...
0
votes
1
answer
98
views
`vkGetMemoryWin32HandleKHR` tries to dereference a null address
I'm trying to create a shared texture between Vulkan and OpenGL, and as I understand the process, it's split in two parts: exporting the memory during allocation and then getting a Windows HANDLE to ...
-3
votes
1
answer
161
views
(WIN32) Switching from Vulkan to D3D11 renderer fails to release window
EDIT: ANSWERED (but question closed)
TL;DR Per the Vulkan specification, it is undefined behaviour to pass a win32 window handle between graphics APIs after the creation of a swapchain.
A window ...
1
vote
1
answer
47
views
Does GLSL spec permit cases when PS-input mismatched with VS-output?
On my NVIDIA GPU these 2 shaders work fine:
// VS
#version 450
layout(location = 0) in vec4 inPosition;
layout(location = 0) out struct {
vec2 dummy;
uvec4 variableInStruct;
} testStruct;
void ...
-6
votes
1
answer
104
views
Host to GPU in terms of endianness discrepancy [closed]
I have been told that when it comes to GPU APIs like Vulkan and DirectX and the host is for example little-endian and the GPU is big-endian that you can read for example a 32-bit integer and the ...
0
votes
0
answers
65
views
Is there a macro in CLion for defining full function definitions outside of the software?
In CLion, Intellisense is broken when using Vulkan (and similar APIs) loader libraries. This seems to be because every function is defined around their pointer (i.e. for a vulkan function vkXyz, it is ...
1
vote
0
answers
121
views
Why does this Slang code compile to a SPIR-V that skips 3 floats every 4 floats in matrices?
I am trying to learn the Slang shading language for use in a Vulkan framework and I was writing a very basic white only shader.
module white;
struct VertexIn {
float3 position : Position;
};
...
0
votes
1
answer
77
views
Can I set VkCmdDispatchIndirect's workgroup size to 0 to achieve a no-op?
Assuming I have a compute pipeline that I can dispatch with vkCmdDispatchIndirect, and a VkBuffer object that stores the dispatch parameters, can I safely and reliably set all the workgroup dimensions ...
3
votes
0
answers
120
views
SPIR-V extension suddenly needed to use discard, why?
While loading spir-v shaders in my application I suddenly started getting the following validation error:
[ERROR: Validation]
vkCreateShaderModule(): SPIR-V Capability DemoteToHelperInvocation was ...
1
vote
1
answer
45
views
How to avoid transitioning between two image layouts for an image frequently
I have the case that I want to sample from an image as a texture and write to it at the same time. The actual use case is that the image contains information pertaining to a city for a city builder. ...
0
votes
1
answer
78
views
Can I use a timeline semaphore wait to complete a queue transfer?
I'm trying to copy data from a staged buffer into a image, and then submit a queue transfer to a graphics queue.
I know the whole point of a dedicated transfer queue is for async transfers, but for ...
0
votes
0
answers
51
views
Mapping Phone Quaternion Data to Vulkan Coordinates and having Consistent Rotation Behavior
I'm working on a Vulkan project that takes my phone Quaternion data through a UDP connection, and then is used to transform the coordinates of a sword. However, the model doesn't accurately represent ...
0
votes
0
answers
83
views
vkCreateDevice Hook with MinHook in Vulkan-DLL not working/never called
I am currently trying to downscale the internal render resolution from a game called "BeamNG Drive" using dll injection. In beamng I run the game in vulkan mode, I enter the game and inject ...
0
votes
1
answer
78
views
Is it possible to do instanced rendering with different textures without non-uniform indexing?
For a long time I thought gl_InstanceID was dynamically uniform, but it isn't. And so if you instance render a bunch of instances and you don't have support for non-uniform sampled image indexing, ...
3
votes
1
answer
134
views
Is there a way to get the index of a draw call?
I know there's gl_VertexIndex and gl_VertexID, but let's just say I have an index buffer that looks like:
[3, 0, 4, 1, 2, 3]
The first vertex processed in the vertex shader with an indexed draw ...
0
votes
1
answer
121
views
Fence still in use after wait
The following Vulkan code gives an validation error in an unpredictable manner in my code
VkFence fence = inFlightFences[currentFrame];
vkWaitForFences(device, 1, &fence, VK_TRUE, UINT64_MAX);
...
0
votes
1
answer
183
views
How to properly use VK_KHR_external_memory for sharing memory between two processes using Vulkan API
I am trying to share memory between two Vulkan processes (using the same NVidia gpu device) using the VK_KHR_external memory extension on Linux (Ubuntu 22). I create a buffer/device memory (and ...
0
votes
1
answer
135
views
In vkAcquireNextImageKHR what's the difference between the timeout argument and the fence to signal?
The vkAcquireNextImageKHR has arguments:
timeout specifies how long the function waits, in nanoseconds, if no
image is available.
fence is VK_NULL_HANDLE or a fence to signal.
If I provide a fence ...
0
votes
0
answers
109
views
Is vkQueuePresentKHR supposed to block?
When I call vkQueuePresentKHR the function blocks my thread, and how long it blocks depends entirely on how big my swap chain is. So if I have a small window it may block for 5ms, and if I increase ...
2
votes
1
answer
79
views
How to dispatch compute shader on a region of an image?
For example, store the output of the compute shader on a 640x640 region within a 1920x1080 image at offset 128x128 from top-left corner.
It could be done by allocating a 640x640 image, writing on it ...
0
votes
0
answers
66
views
Vulkan Render Pass: why is VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT needed in srcStageMask?
The Render Pass dependency from the well-known Vulkan tutorial from Sascha Willems
looks like this:
.srcSubpass = VK_SUBPASS_EXTERNAL;
.dstSubpass = 0;
.srcStageMask =
...
1
vote
1
answer
121
views
Vulkan complains about invalid VkFramebuffer handle
I'm currently working on my Vulkan renderer and I'm trying to implement ImGUI. I use 2 separate render passes. One for the "main" rendering of my scene and one for DearImGUI. But here comes ...
0
votes
1
answer
120
views
Vulkan device shader buffer and data alignment
I thought that one of the "benefits" of using device shader buffers in Vulkan was that alignment constraints (like those in std140 and std430) wouldn't apply. So I tried creating a buffer ...
0
votes
2
answers
171
views
Can you read unaligned data into an aligned type? [closed]
Let's just say you a have 32-bit integer, that integer needs to be aligned in memory on a four-byte boundary. Let's just say there's a byte buffer, and you want to store the bytes of that 32-bit ...
0
votes
0
answers
77
views
Access violation when calling vkCmdBeginRendering
I am working on a deferred renderer. I tried to set up the lighting pass (not an accurate term in the context of dynamic rendering but you get the idea) with dynamic rendering:
...
1
vote
2
answers
61
views
QVulkanInstance: Failure to Retain User Set Layers
As per the code found at: Qt Triangle Example
Adding a bit of debug logic:
#include <QDateTime>
#include <QDebug>
#include <QGuiApplication>
#include <QLoggingCategory>
#...
-2
votes
1
answer
84
views
Why must my image be aligned to the texel block when copying from a buffer to an image?
I upload a mip chain of BC1_RGB_UNORM_BLOCK to a staging buffer in host memory. Then I do buffer to image copy. And I get the error:
Vulkan validation layer callback: vkCmdCopyBufferToImage():
...
-2
votes
1
answer
255
views
Window resizing does not cause VK_ERROR_OUT_OF_DATE_KHR
I use my own Win32 implementation together with Vulkan. I have the following test function that resizes my window.
void Window::Test()
{
RECT rect = { 0, 0, 1200, 1200 };
DWORD style = ...
0
votes
3
answers
98
views
How is Vulkan able to get the different types of host memory?
When you allocate memory with Vulkan you do it on a particular type of heap and memory type that the Vulkan API has listed. Some of these memory types have the flags like for example:
HOST_COHERENT
...
-1
votes
1
answer
69
views
Evaluating Mesh Shading: CPU Costs vs. GPU Gains (Vulkan API)
I recently switched a Vulkan renderer from the traditional vertex pipeline to mesh shading. On large meshes, I've experienced a significant performance drop — particularly in processing time. For ...
0
votes
0
answers
125
views
Segmentation fault when waiting for queue in Vulkan
I have some code that was working on a prior driver that now segfaults when compiling.
In particular, it segfaults here:
unsafe {
let graphics_queue = self.hardware_interface....
1
vote
1
answer
48
views
What is the difference between the limits maxDescriptorSetTotalStorageBuffersDynamic and maxDescriptorSetStorageBuffersDynamic?
From the specification for VkPhysicalDeviceLimits,
maxDescriptorSetStorageBuffersDynamic is the maximum number of dynamic storage buffers that can be included in a pipeline layout. Descriptors with a ...
3
votes
1
answer
169
views
SMAA weight blend texture is unclear
I try to use SMAA on vulkan, but the output image is not complete anti-aliasing.
like this:
I see edgesTex is perfect, but blendTex is not so clear comparing with weight image which is from smaaDemo
...
3
votes
1
answer
89
views
Deleting vkDevice after VK_ERROR_DEVICE_LOST
How do you delete VkDevice if it was lost (VK_ERROR_DEVICE_LOST)? I use vkDeviceWaitIdle to wait until device finishes all the work to safely delete it. But if device is lost, vkDeviceWaitIdle does ...
0
votes
1
answer
169
views
GLFW window not appearing using vs code (im in arch linux using plasma wayland)
I can see an icon in my dock (icons-only task manager) but i can't see it i can hover it and yes it's the Vulkan window.
#include <vulkan/vulkan.h>
#include <GLFW/glfw3.h>
#define ...
1
vote
1
answer
182
views
Do I reuse pipeline layout for shader objects in Vulkan?
I noticed that in the new Vulkan spec, Render Pass objects are obsoleted in favor of the newer Render Pass instance. And there's a newer mechanism to compile and use shaders: Shader objects - which ...
0
votes
0
answers
135
views
Scalar layout with Vulkan compute
I use an array of a struct in a GLSL compute shader with scalar layout like this:
#version 450
struct Gaussian {
vec3 position;
vec4 rotation;
vec3 scale;
vec3 color;
float alpha;
...
0
votes
0
answers
108
views
Window title & borders are missing on Qt 6.8.1, Ubuntu 22.04 with Waylan and VulkanRenderer
I have a Qt 6.8.1 cross-platform project. It works fine on Windows and Ubuntu 22.04, both with X11 and Wayland. By default, it uses the OpenGL renderer. But I need Vulkan renderer and therefore add ...