vulkan

Layout transition between multiple subpasses in Vulkan

隐身守侯 提交于 2019-12-07 08:26:59
问题 I am trying to do two simple subpasses, where the second one has a dependency on the first one. //subpass 1 VkAttachmentReference colorReferences = { 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL }; VkSubpassDescription subpass1 = {}; subpass1.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; subpass1.pColorAttachments = &colorReferences; subpass1.colorAttachmentCount = 1; //subpass 2 VkAttachmentReference inputRefernce = { 0, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL }; VkSubpassDescription

Use Vulkan VkImage as a CUDA cuArray

*爱你&永不变心* 提交于 2019-12-06 12:21:57
What is the correct way of using a Vulkan VkImage as a CUDA cuArray? I've been trying to follow some examples, however I get a CUDA_ERROR_INVALID_VALUE on a call to cuExternalMemoryGetMappedMipmappedArray() To provide the information in an ordered way. I'm using CUDA 10.1 Base code comes from https://github.com/SaschaWillems/Vulkan , in particular I'm using the 01 - Vulkan Gears demo, enriched with the saveScreenshot method 09 - Capturing screenshots Instead of saving the snapshot image to a file, I'll be sending the snapshot image into CUDA as a CUarray. I've enabled the following instance

Linearize depth

元气小坏坏 提交于 2019-12-06 07:59:56
In OpenGL you can linearize a depth value like so: float linearize_depth(float d,float zNear,float zFar) { float z_n = 2.0 * d - 1.0; return 2.0 * zNear * zFar / (zFar + zNear - z_n * (zFar - zNear)); } (Source: https://stackoverflow.com/a/6657284/10011415 ) However, Vulkan handles depth values somewhat differently ( https://matthewwellings.com/blog/the-new-vulkan-coordinate-system/ ). I don't quite understand the math behind it, what changes would I have to make to the function to linearize a depth value with Vulkan? The important difference between OpenGL and Vulkan here is that the

Calling vkEnumerateDeviceExtensionProperties “twice” - is it required?

▼魔方 西西 提交于 2019-12-06 05:41:20
From the man page for vkEnumerateDeviceExtensionProperties , vkEnumerateDeviceExtensionProperties retrieves properties for extensions on a physical device whose handle is given in physicalDevice. To determine the extensions implemented by a layer set pLayerName to point to the layer’s name and any returned extensions are implemented by that layer. Setting pLayerName to NULL will return the available non-layer extensions. pPropertyCount must be set to the size of the VkExtensionProperties array pointed to by pProperties. The pProperties should point to an array of VkExtensionProperties to be

Does Forcing "High" DPM Performance Help Out Your AMDGPU Performance?

三世轮回 提交于 2019-12-06 03:37:00
Does Forcing "High" DPM Performance Help Out Your AMDGPU Performance? Written by Michael Larabel in Radeon on 7 June 2018 at 06:04 AM EDT. 14 Comments A premium patron recently asked about testing the open-source Radeon driver performance when testing the forced "high" dynamic power management state rather than the default "auto" mode. Here are some benchmarks. This is about forcing /sys/class/drm/card0/device/power_dpm_force_performance_level to high rather than auto, to ensure the GPU is bound to its highest performance state rather than dynamically changing performance states based upon

Is it possible to do offscreen rendering without Surface in Vulkan?

此生再无相见时 提交于 2019-12-06 03:05:45
问题 Similar to surfaceless context in OpenGL can we do it in Vulkan. 回答1: Sure it's even designed to do so from the start. Instead of getting your images from a swapchain, create them and allocate and bind memory for it yourself. Getting the result back will then require a copy into a host-visible readback buffer after the render. 来源: https://stackoverflow.com/questions/38885309/is-it-possible-to-do-offscreen-rendering-without-surface-in-vulkan

Layout transition between multiple subpasses in Vulkan

[亡魂溺海] 提交于 2019-12-05 14:22:50
I am trying to do two simple subpasses, where the second one has a dependency on the first one. //subpass 1 VkAttachmentReference colorReferences = { 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL }; VkSubpassDescription subpass1 = {}; subpass1.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; subpass1.pColorAttachments = &colorReferences; subpass1.colorAttachmentCount = 1; //subpass 2 VkAttachmentReference inputRefernce = { 0, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL }; VkSubpassDescription subpass2 = {}; subpass2.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; subpass2

Is Vulkan's VkMemoryHeapFlagBits missing values?

ぐ巨炮叔叔 提交于 2019-12-05 11:01:35
At Vulkan specs 1.0.9 (pg. 180), we have the following: typedef struct VkMemoryHeap { VkDeviceSize size; VkMemoryHeapFlags flags; } VkMemoryHeap; and this description: • size is the total memory size in bytes in the heap. • flags is a bitmask of attribute flags for the heap. The bits specified in flags are: typedef enum VkMemoryHeapFlagBits { VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, } VkMemoryHeapFlagBits; But when I query VkPhysicalDeviceMemoryProperties I've got flags with zero values. My code matches the output from Vulkan SDK vkjson_info.exe tool, which output a JSON file with

confused about render pass in Vulkan API

爷,独闯天下 提交于 2019-12-04 12:45:42
问题 Recently i started learning Vulkan API,there are some topics that confuses me, my question is what is a render pass, why it is used concurrently with command buffer recording? and finally what are sub pass, sub pass dependencies and attachments? that are commonly related to render pass. 回答1: It's the only way to get something drawn (draw commands can only be inside render pass). So don't overthink it. As a begginer you only need to create one render pass with one (mandatory) subpass and that

How'd multi-GPU programming work with Vulkan?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 10:09:30
问题 Would using multi-GPUs in Vulkan be something like making many command queues then dividing command buffers between them? There are 2 problems: In OpenGL, we use GLEW to get functions. With more than 1 GPU, each GPU has its own driver. How'd we use Vulkan? Would part of the frame be generated with a GPU & the others with other GPUs like use Intel GPU to render UI & AMD or Nvidia GPU to render game screen in labtops for example? Or would a frame be generated in a GPU & the next frame in an