vulkan

Vulkan: Why does the 1080 Ti have a maxMemoryAllocationCount of 4294967296 on arch but only 4096 on Windows?

北城以北 提交于 2019-12-13 11:06:14
问题 I am currently building a game engine in C++ which uses vulkan for rendering. While implementing a terrain renderer I reached a hardware limit, the maxMemoryAllocationCount which limits the amount of allocated memory blocks. I checked https://vulkan.gpuinfo.org/ to see how high that value on different GPUs is. When looking at the "GeForce GTX 1080 Ti", the value is 4096 for windows but 4294967296 for arch/manjaro. Why is there a difference between those OSes, when this really should be a

Meaning of memoryTypes in Vulkan

社会主义新天地 提交于 2019-12-13 08:14:10
问题 I have used the Vulkan function vkGetPhysicalDeviceMemoryProperties to obtain the memory properties of a specific physical device, i.e. GPU. I have printed out the returned values from this function (1st column from the left is their enumerated values. Based on this output, I can see there are 2 memory heaps and 11 memoryTypes. Memory: -memoryTypeCount: 11 -memoryTypes[VK_MAX_MEMORY_TYPES]: -0, propertyFlags: 0, heapIndex: 1 -1, propertyFlags: 0, heapIndex: 1 -2, propertyFlags: 0, heapIndex:

Does SPIR-V bytecode provide obfuscation?

耗尽温柔 提交于 2019-12-12 20:27:51
问题 It is straightforward for a reverse engineer to attach a graphics debugger to an OpenGL application to extract the shader source code. It is my understanding that Vulkan, on the other hand, uses SPIR-V bytecode, rather than passing plaintext shaders to the graphics API. Does SPIR-V bytecode obfuscate the shader source, or is it fairly easy to decompile? 回答1: There is an entire specification explaining, in explicit detail, the behavior of each and every SPIR-V opcode. That's kinda the opposite

Why validation layer doesn't say me I forgot to destroy a device or a surface?

偶尔善良 提交于 2019-12-12 18:15:19
问题 I added VK_LAYER_LUNARG_standard_validation validation layers to my instance. Next I created a debug callback and other vulkan objects. For the test case the only object I'm clearing is the instance (because validation layers should report on instance destruction). And from all of the objects I have the layer reports only about VkDebugReportCallbackEXT : validation layer: Debug Report callbacks not removed before DestroyInstance Why it doesn't say me about VkSurfaceKHR and VkDevice (they are

When can I free resources and structures passed to a vulkan vkCreateXXX function?

只谈情不闲聊 提交于 2019-12-12 17:23:06
问题 I'm starting to learn Vulkan, and want to know if VkCreate[...] functions copy the resources pointed in structs into his own buffers. To clarify my question, in this code I load a SPIR shader into my own mkShader struct and then I create the shadermodule with vkCreateShaderModule . static VkShaderModule mkVulkanCreateShaderModule(MkVulkanContext *vc, const char *filename) { VkShaderModule shaderModule; struct mkShader *shader = mkVulkanLoadShaderBinary(filename); VkShaderModuleCreateInfo

Generating mipmaps in Vulkan

隐身守侯 提交于 2019-12-12 13:22:31
问题 I'm trying to generate mipmaps runtime (implement glGenerateMipmap() functionality) using vkCmdBlitImage but don't understand the process. Here's my code so far: VkImageCreateInfo imageCreateInfo = {}; imageCreateInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; imageCreateInfo.pNext = nullptr; imageCreateInfo.imageType = VK_IMAGE_TYPE_2D; imageCreateInfo.format = format; imageCreateInfo.mipLevels = mipLevels; imageCreateInfo.arrayLayers = 1; imageCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT;

vkCreateInstance causing a segmentation fault

不羁岁月 提交于 2019-12-12 04:26:11
问题 I'm just starting to learn Vulkan. I've got the book "Vulkan Programming Guide" by Graham Sellers, and an RX 480 with the AMDGPU pro drivers in my system. I'm running Arch Linux, and I've been able to run some Vulkan demos on my system. I have a minimal code block which causes a segmentation fault. Oddly, on my way to generating this block in order to pose this question, I do have it running with vkCreateInstance() being called from a constructor, and first noticed a segmentation fault when I

Vulkan create instance VK_OUT_OF_HOST_MEMORY

天涯浪子 提交于 2019-12-12 02:21:52
问题 I'm trying to create a VkInstance to get started with Vulkan and I've already run into an undocumented error. This is all the code that I have so far: VkApplicationInfo applicationInfo = {}; applicationInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; applicationInfo.pNext = NULL; applicationInfo.pApplicationName = "<game>"; applicationInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0); applicationInfo.pEngineName = "<engine>"; applicationInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);

Vulkan Buffer WorkGroupID not returning actual value when large number of elements

老子叫甜甜 提交于 2019-12-12 00:59:39
问题 Creating a buffer with pow(2, 24) and a local_size_x = 64 for the layout input qualifier will return WorkGroupID = 262143 which is all fine due to pow(2,24) / 64 - 1 , it is zero indexed. However if we increase the global dimension / no elements / size of the problem to pow(2, 25) lets say WorkGroupID will return values without a reason, they do not match the math. Here are some limits that the device got that I think matter: maxStorageBufferRange: uint32_t = 4294967295

ASTC for normal maps

心不动则不痛 提交于 2019-12-11 15:45:17
问题 I am trying to compress my normal map textures, so I am using ASTC 4x4. It works completely good for other textures (aka diffuse), but quality lost for normal maps were too big. Is there a way to improve ASTCs quality directly for Normal Maps ? I have tried to use -normal-psnr flag, but it makes my texture greyed (instead of normal blue) ASTC normal map: PNG normal map: 回答1: Compressing normal maps using a normal mode in the reference encoder stores normal maps as X+Y maps. X is stored in the