1// Copyright (c) 2022 NVIDIA Corporation 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[[memory-decompression]] 6= Memory Decompression 7 8[open,refpage='vkCmdDecompressMemoryNV',desc='Decompress data between memory regions',type='protos'] 9-- 10To decompress data between one or more memory regions call: 11 12include::{generated}/api/protos/vkCmdDecompressMemoryNV.adoc[] 13 14 * pname:commandBuffer is the command buffer into which the command will be 15 recorded. 16 * pname:decompressRegionCount is the number of memory regions to 17 decompress. 18 * pname:pDecompressMemoryRegions is a pointer to an array of 19 pname:decompressRegionCount slink:VkDecompressMemoryRegionNV structures 20 specifying decompression parameters. 21 22Each region specified in pname:pDecompressMemoryRegions is decompressed from 23the source to destination region based on the specified decompression 24method. 25 26.Valid Usage 27**** 28 * [[VUID-vkCmdDecompressMemoryNV-None-07684]] 29 The <<features-memoryDecompression, pname:memoryDecompression>> feature 30 must: be enabled 31**** 32 33include::{generated}/validity/protos/vkCmdDecompressMemoryNV.adoc[] 34-- 35 36[open,refpage='VkDecompressMemoryRegionNV',desc='Structure specifying decompression parameters',type='structs'] 37-- 38The sname:VkDecompressMemoryRegionNV structure is defined as: 39 40include::{generated}/api/structs/VkDecompressMemoryRegionNV.adoc[] 41 42 * pname:srcAddress is the address where compressed data is stored. 43 * pname:dstAddress is the destination address where decompressed data will 44 be written. 45 * pname:compressedSize is the size of compressed data in bytes. 46 * pname:decompressedSize is the size of decompressed data in bytes. 47 * pname:decompressionMethod is a bitmask of 48 ename:VkMemoryDecompressionMethodFlagBitsNV with a single bit set 49 specifying the method used to decompress data. 50 51.Valid Usage 52**** 53 * [[VUID-VkDecompressMemoryRegionNV-srcAddress-07685]] 54 The pname:srcAddress must: be 4 byte aligned 55 * [[VUID-VkDecompressMemoryRegionNV-srcAddress-07686]] 56 The memory in range pname:srcAddress and pname:srcAddress {plus} 57 pname:compressedSize must: be valid and bound to a sname:VkDeviceMemory 58 object 59 * [[VUID-VkDecompressMemoryRegionNV-dstAddress-07687]] 60 The pname:dstAddress must: be 4 byte aligned 61 * [[VUID-VkDecompressMemoryRegionNV-decompressionMethod-09395]] 62 If pname:decompressionMethod is 63 ename:VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV, then 64 pname:decompressedSize must: be less than or equal to 65536 bytes 65 * [[VUID-VkDecompressMemoryRegionNV-dstAddress-07688]] 66 The memory in range pname:dstAddress and pname:dstAddress {plus} 67 pname:decompressedSize must: be valid and bound to a 68 sname:VkDeviceMemory object 69 * [[VUID-VkDecompressMemoryRegionNV-decompressedSize-07689]] 70 The pname:decompressedSize must: be large enough to hold the 71 decompressed data based on the pname:decompressionMethod 72 * [[VUID-VkDecompressMemoryRegionNV-decompressionMethod-07690]] 73 The pname:decompressionMethod must: have a single bit set 74 * [[VUID-VkDecompressMemoryRegionNV-srcAddress-07691]] 75 The pname:srcAddress to pname:srcAddress {plus} pname:compressedSize 76 region must: not overlap with the pname:dstAddress and pname:dstAddress 77 {plus} pname:decompressedSize region 78**** 79 80include::{generated}/validity/structs/VkDecompressMemoryRegionNV.adoc[] 81-- 82 83[open,refpage='vkCmdDecompressMemoryIndirectCountNV',desc='Indirect decompress data between memory regions',type='protos'] 84-- 85To decompress data between one or more memory regions by specifying 86decompression parameters indirectly in a buffer, call: 87 88include::{generated}/api/protos/vkCmdDecompressMemoryIndirectCountNV.adoc[] 89 90 * pname:commandBuffer is the command buffer into which the command will be 91 recorded. 92 * pname:indirectCommandsAddress is the device address containing 93 decompression parameters laid out as an array of 94 slink:VkDecompressMemoryRegionNV structures. 95 * pname:indirectCommandsCountAddress is the device address containing the 96 decompression count. 97 * pname:stride is the byte stride between successive sets of decompression 98 parameters located starting from pname:indirectCommandsAddress. 99 100Each region specified in pname:indirectCommandsAddress is decompressed from 101the source to destination region based on the specified decompression 102method. 103 104.Valid Usage 105**** 106 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-None-07692]] 107 The <<features-memoryDecompression, pname:memoryDecompression>> feature 108 must: be enabled 109 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-indirectCommandsAddress-07693]] 110 If pname:indirectCommandsAddress comes from a non-sparse buffer then it 111 must: be bound completely and contiguously to a single 112 sname:VkDeviceMemory object 113 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-indirectCommandsAddress-07694]] 114 The slink:VkBuffer that pname:indirectCommandsAddress comes from must: 115 have been created with the ename:VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit 116 set 117 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-offset-07695]] 118 pname:offset must: be a multiple of `4` 119 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-indirectCommandsCountAddress-07696]] 120 If pname:indirectCommandsCountAddress comes from a non-sparse buffer 121 then it must: be bound completely and contiguously to a single 122 sname:VkDeviceMemory object 123 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-indirectCommandsCountAddress-07697]] 124 The slink:VkBuffer that pname:indirectCommandsCountAddress comes from 125 must: have been created with the 126 ename:VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT bit set 127 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-indirectCommandsCountAddress-07698]] 128 pname:indirectCommandsCountAddress must: be a multiple of `4` 129 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-indirectCommandsCountAddress-07699]] 130 The count stored in pname:indirectCommandsCountAddress must: be less 131 than or equal to 132 sname:VkPhysicalDeviceMemoryDecompressionPropertiesNV::pname:maxDecompressionIndirectCount 133 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-stride-07700]] 134 pname:stride must: be a multiple of `4` and must: be greater than or 135 equal to sizeof(sname:VkDecompressMemoryRegionNV) 136 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-indirectCommandsCountAddress-07701]] 137 If the count stored in pname:indirectCommandsCountAddress is equal to 138 `1`, [eq]#(pname:offset {plus} 139 sizeof(sname:VkDecompressMemoryRegionNV))# must: be less than or equal 140 to the size of the slink:VkBuffer that pname:indirectCommandsAddress 141 comes from 142 * [[VUID-vkCmdDecompressMemoryIndirectCountNV-indirectCommandsCountAddress-07702]] 143 If the count stored in pname:indirectCommandsCountAddress is greater 144 than `1`, pname:indirectCommandsAddress {plus} 145 sizeof(sname:VkDecompressMemoryRegionNV) {plus} [eq]#(pname:stride 146 {times} (count stored in pname:countBuffer - 1))# must: be less than or 147 equal to the last valid address in the slink:VkBuffer that 148 pname:indirectCommandsAddress was created from 149**** 150 151include::{generated}/validity/protos/vkCmdDecompressMemoryIndirectCountNV.adoc[] 152-- 153 154[open,refpage='VkMemoryDecompressionMethodFlagBitsNV',desc='List the supported memory decompression methods',type='enums'] 155-- 156Bits which can: be set in 157sname:VkDecompressMemoryRegionNV::pname:decompressionMethod specifying the 158decompression method to select, or returned in 159sname:VkPhysicalDeviceMemoryDecompressionPropertiesNV::pname:decompressionMethods 160specifying the available decompression methods are: 161 162include::{generated}/api/enums/VkMemoryDecompressionMethodFlagBitsNV.adoc[] 163 164 * ename:VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV specifies that 165 the GDeflate 1.0 algorithm is used to decompress data. 166-- 167 168[open,refpage='VkMemoryDecompressionMethodFlagsNV',desc='Bitmask of VkMemoryDecompressionMethodFlagBitsNV',type='flags'] 169-- 170include::{generated}/api/flags/VkMemoryDecompressionMethodFlagsNV.adoc[] 171 172tname:VkMemoryDecompressionMethodFlagsNV is a bitmask type for specifying a 173mask of one or more ename:VkMemoryDecompressionMethodFlagBitsNV: 174-- 175