[{"data":1,"prerenderedAt":566},["ShallowReactive",2],{"sjeVKNbzLg":3},{"title":4,"description":5,"parent":6,"type":7,"xrefs":8,"body":9,"_type":565,"_id":4},"vkFlushMappedMemoryRanges","Flush mapped memory ranges","VK_VERSION_1_0","protos",[],{"type":10,"children":11,"toc":563},"root",[12,20,297,350,388,399,439,444,460,469,557],{"type":13,"tag":14,"props":15,"children":16},"element","p",{},[17],{"type":18,"value":19},"text","To flush ranges of non-coherent memory from the host caches, call:",{"type":13,"tag":21,"props":22,"children":23},"code-group",{},[24,127],{"type":13,"tag":25,"props":26,"children":32},"pre",{"className":27,"code":28,"filename":29,"language":30,"meta":31,"style":31},"language-c shiki shiki-themes github-light-default github-dark-default","VkResult vkFlushMappedMemoryRanges(\n VkDevice device,\n uint32_t memoryRangeCount,\n const VkMappedMemoryRange* pMemoryRanges);\n","C","c","",[33],{"type":13,"tag":34,"props":35,"children":36},"code",{"__ignoreMap":31},[37,59,79,98],{"type":13,"tag":38,"props":39,"children":42},"span",{"class":40,"line":41},"line",1,[43,49,54],{"type":13,"tag":38,"props":44,"children":46},{"style":45},"--shiki-default:#1F2328;--shiki-dark:#E6EDF3",[47],{"type":18,"value":48},"VkResult ",{"type":13,"tag":38,"props":50,"children":52},{"style":51},"--shiki-default:#8250DF;--shiki-dark:#D2A8FF",[53],{"type":18,"value":4},{"type":13,"tag":38,"props":55,"children":56},{"style":45},[57],{"type":18,"value":58},"(\n",{"type":13,"tag":38,"props":60,"children":62},{"class":40,"line":61},2,[63,68,74],{"type":13,"tag":38,"props":64,"children":65},{"style":45},[66],{"type":18,"value":67}," VkDevice ",{"type":13,"tag":38,"props":69,"children":71},{"style":70},"--shiki-default:#953800;--shiki-dark:#FFA657",[72],{"type":18,"value":73},"device",{"type":13,"tag":38,"props":75,"children":76},{"style":45},[77],{"type":18,"value":78},",\n",{"type":13,"tag":38,"props":80,"children":82},{"class":40,"line":81},3,[83,89,94],{"type":13,"tag":38,"props":84,"children":86},{"style":85},"--shiki-default:#CF222E;--shiki-dark:#FF7B72",[87],{"type":18,"value":88}," uint32_t",{"type":13,"tag":38,"props":90,"children":91},{"style":70},[92],{"type":18,"value":93}," memoryRangeCount",{"type":13,"tag":38,"props":95,"children":96},{"style":45},[97],{"type":18,"value":78},{"type":13,"tag":38,"props":99,"children":101},{"class":40,"line":100},4,[102,107,112,117,122],{"type":13,"tag":38,"props":103,"children":104},{"style":85},[105],{"type":18,"value":106}," const",{"type":13,"tag":38,"props":108,"children":109},{"style":45},[110],{"type":18,"value":111}," VkMappedMemoryRange",{"type":13,"tag":38,"props":113,"children":114},{"style":85},[115],{"type":18,"value":116},"*",{"type":13,"tag":38,"props":118,"children":119},{"style":70},[120],{"type":18,"value":121}," pMemoryRanges",{"type":13,"tag":38,"props":123,"children":124},{"style":45},[125],{"type":18,"value":126},");\n",{"type":13,"tag":25,"props":128,"children":133},{"className":129,"code":130,"filename":131,"language":132,"meta":31,"style":31},"language-rs shiki shiki-themes github-light-default github-dark-default","pub fn flush_mapped_memory_ranges(\n device: crate :: vk :: vk::Device,\n memory_range_count: u32,\n p_memory_ranges: *const vk::MappedMemoryRange,\n) -> vk::Result;\n","Rust","rs",[134],{"type":13,"tag":34,"props":135,"children":136},{"__ignoreMap":31},[137,159,210,231,265],{"type":13,"tag":38,"props":138,"children":139},{"class":40,"line":41},[140,145,150,155],{"type":13,"tag":38,"props":141,"children":142},{"style":85},[143],{"type":18,"value":144},"pub",{"type":13,"tag":38,"props":146,"children":147},{"style":85},[148],{"type":18,"value":149}," fn",{"type":13,"tag":38,"props":151,"children":152},{"style":51},[153],{"type":18,"value":154}," flush_mapped_memory_ranges",{"type":13,"tag":38,"props":156,"children":157},{"style":45},[158],{"type":18,"value":58},{"type":13,"tag":38,"props":160,"children":161},{"class":40,"line":61},[162,167,172,177,182,187,192,197,201,206],{"type":13,"tag":38,"props":163,"children":164},{"style":45},[165],{"type":18,"value":166}," device",{"type":13,"tag":38,"props":168,"children":169},{"style":85},[170],{"type":18,"value":171},":",{"type":13,"tag":38,"props":173,"children":174},{"style":85},[175],{"type":18,"value":176}," crate",{"type":13,"tag":38,"props":178,"children":179},{"style":85},[180],{"type":18,"value":181}," ::",{"type":13,"tag":38,"props":183,"children":184},{"style":45},[185],{"type":18,"value":186}," vk ",{"type":13,"tag":38,"props":188,"children":189},{"style":85},[190],{"type":18,"value":191},"::",{"type":13,"tag":38,"props":193,"children":194},{"style":70},[195],{"type":18,"value":196}," vk",{"type":13,"tag":38,"props":198,"children":199},{"style":85},[200],{"type":18,"value":191},{"type":13,"tag":38,"props":202,"children":203},{"style":70},[204],{"type":18,"value":205},"Device",{"type":13,"tag":38,"props":207,"children":208},{"style":45},[209],{"type":18,"value":78},{"type":13,"tag":38,"props":211,"children":212},{"class":40,"line":81},[213,218,222,227],{"type":13,"tag":38,"props":214,"children":215},{"style":45},[216],{"type":18,"value":217}," memory_range_count",{"type":13,"tag":38,"props":219,"children":220},{"style":85},[221],{"type":18,"value":171},{"type":13,"tag":38,"props":223,"children":224},{"style":70},[225],{"type":18,"value":226}," u32",{"type":13,"tag":38,"props":228,"children":229},{"style":45},[230],{"type":18,"value":78},{"type":13,"tag":38,"props":232,"children":233},{"class":40,"line":100},[234,239,243,248,252,256,261],{"type":13,"tag":38,"props":235,"children":236},{"style":45},[237],{"type":18,"value":238}," p_memory_ranges",{"type":13,"tag":38,"props":240,"children":241},{"style":85},[242],{"type":18,"value":171},{"type":13,"tag":38,"props":244,"children":245},{"style":85},[246],{"type":18,"value":247}," *const",{"type":13,"tag":38,"props":249,"children":250},{"style":70},[251],{"type":18,"value":196},{"type":13,"tag":38,"props":253,"children":254},{"style":85},[255],{"type":18,"value":191},{"type":13,"tag":38,"props":257,"children":258},{"style":70},[259],{"type":18,"value":260},"MappedMemoryRange",{"type":13,"tag":38,"props":262,"children":263},{"style":45},[264],{"type":18,"value":78},{"type":13,"tag":38,"props":266,"children":268},{"class":40,"line":267},5,[269,274,279,283,287,292],{"type":13,"tag":38,"props":270,"children":271},{"style":45},[272],{"type":18,"value":273},") ",{"type":13,"tag":38,"props":275,"children":276},{"style":85},[277],{"type":18,"value":278},"->",{"type":13,"tag":38,"props":280,"children":281},{"style":70},[282],{"type":18,"value":196},{"type":13,"tag":38,"props":284,"children":285},{"style":85},[286],{"type":18,"value":191},{"type":13,"tag":38,"props":288,"children":289},{"style":70},[290],{"type":18,"value":291},"Result",{"type":13,"tag":38,"props":293,"children":294},{"style":45},[295],{"type":18,"value":296},";\n",{"type":13,"tag":298,"props":299,"children":300},"ul",{},[301,312,331],{"type":13,"tag":302,"props":303,"children":304},"li",{},[305,310],{"type":13,"tag":34,"props":306,"children":308},{"className":307},[],[309],{"type":18,"value":73},{"type":18,"value":311}," is the logical device that owns the memory ranges.",{"type":13,"tag":302,"props":313,"children":314},{},[315,321,323,329],{"type":13,"tag":34,"props":316,"children":318},{"className":317},[],[319],{"type":18,"value":320},"memoryRangeCount",{"type":18,"value":322}," is the length of the ",{"type":13,"tag":34,"props":324,"children":326},{"className":325},[],[327],{"type":18,"value":328},"pMemoryRanges",{"type":18,"value":330}," array.",{"type":13,"tag":302,"props":332,"children":333},{},[334,339,341,348],{"type":13,"tag":34,"props":335,"children":337},{"className":336},[],[338],{"type":18,"value":328},{"type":18,"value":340}," is a pointer to an array of\n",{"type":13,"tag":342,"props":343,"children":345},"a",{"href":344},"/man/VkMappedMemoryRange",[346],{"type":18,"value":347},"VkMappedMemoryRange",{"type":18,"value":349}," structures describing the memory ranges to\nflush.",{"type":13,"tag":14,"props":351,"children":352},{},[353,358,360,365,367,372,374,380,382],{"type":13,"tag":34,"props":354,"children":356},{"className":355},[],[357],{"type":18,"value":4},{"type":18,"value":359}," guarantees that host writes to the memory\nranges described by ",{"type":13,"tag":34,"props":361,"children":363},{"className":362},[],[364],{"type":18,"value":328},{"type":18,"value":366}," are made available to the host\nmemory domain, such that they ",{"type":13,"tag":368,"props":369,"children":371},"normative",{"type":370},"can",[],{"type":18,"value":373}," be made available to the device memory\ndomain via ",{"type":13,"tag":342,"props":375,"children":377},{"href":376},"/chapters/synchronization#synchronization-dependencies-available-and-visible",[378],{"type":18,"value":379},"memory\ndomain operations",{"type":18,"value":381}," using the ",{"type":13,"tag":34,"props":383,"children":385},{"className":384},[],[386],{"type":18,"value":387},"VK_ACCESS_HOST_WRITE_BIT",{"type":13,"tag":14,"props":389,"children":390},{},[391,397],{"type":13,"tag":342,"props":392,"children":394},{"href":393},"/chapters/synchronization#synchronization-access-types",[395],{"type":18,"value":396},"access type",{"type":18,"value":398},".",{"type":13,"tag":14,"props":400,"children":401},{},[402,404,409,411,417,419,424,426,431,433,437],{"type":18,"value":403},"Within each range described by ",{"type":13,"tag":34,"props":405,"children":407},{"className":406},[],[408],{"type":18,"value":328},{"type":18,"value":410},", each set of\n",{"type":13,"tag":34,"props":412,"children":414},{"className":413},[],[415],{"type":18,"value":416},"nonCoherentAtomSize",{"type":18,"value":418}," bytes in that range is flushed if any byte in that\nset has been written by the host since it was first host mapped, or the last\ntime it was flushed.\nIf ",{"type":13,"tag":34,"props":420,"children":422},{"className":421},[],[423],{"type":18,"value":328},{"type":18,"value":425}," includes sets of ",{"type":13,"tag":34,"props":427,"children":429},{"className":428},[],[430],{"type":18,"value":416},{"type":18,"value":432}," bytes\nwhere no bytes have been written by the host, those bytes ",{"type":13,"tag":368,"props":434,"children":436},{"type":435},"must",[],{"type":18,"value":438}," not be\nflushed.",{"type":13,"tag":440,"props":441,"children":443},"anchor",{"id":442},"memory-device-unmap-does-not-flush",[],{"type":13,"tag":14,"props":445,"children":446},{},[447,449,453,455,458],{"type":18,"value":448},"Unmapping non-coherent memory does not implicitly flush the host mapped\nmemory, and host writes that have not been flushed ",{"type":13,"tag":368,"props":450,"children":452},{"type":451},"may",[],{"type":18,"value":454}," not ever be visible\nto the device.\nHowever, implementations ",{"type":13,"tag":368,"props":456,"children":457},{"type":435},[],{"type":18,"value":459}," ensure that writes that have not been flushed\ndo not become visible to any other memory.",{"type":13,"tag":461,"props":462,"children":463},"note",{},[464],{"type":13,"tag":14,"props":465,"children":466},{},[467],{"type":18,"value":468},"The above guarantee avoids a potential memory corruption in scenarios where\nhost writes to a mapped memory object have not been flushed before the\nmemory is unmapped (or freed), and the virtual address range is subsequently\nreused for a different mapping (or memory allocation).",{"type":13,"tag":470,"props":471,"children":473},"validity-group",{"name":472},"Valid Usage (Implicit)",[474,502,533],{"type":13,"tag":475,"props":476,"children":478},"validity-field",{"name":477},"VUID-vkFlushMappedMemoryRanges-device-parameter",[479],{"type":13,"tag":14,"props":480,"children":481},{},[482,487,489,492,494,500],{"type":13,"tag":34,"props":483,"children":485},{"className":484},[],[486],{"type":18,"value":73},{"type":18,"value":488}," ",{"type":13,"tag":368,"props":490,"children":491},{"type":435},[],{"type":18,"value":493}," be a valid ",{"type":13,"tag":342,"props":495,"children":497},{"href":496},"/man/VkDevice",[498],{"type":18,"value":499},"VkDevice",{"type":18,"value":501}," handle",{"type":13,"tag":475,"props":503,"children":505},{"name":504},"VUID-vkFlushMappedMemoryRanges-pMemoryRanges-parameter",[506],{"type":13,"tag":14,"props":507,"children":508},{},[509,514,515,518,520,525,527,531],{"type":13,"tag":34,"props":510,"children":512},{"className":511},[],[513],{"type":18,"value":328},{"type":18,"value":488},{"type":13,"tag":368,"props":516,"children":517},{"type":435},[],{"type":18,"value":519}," be a valid pointer to an array of ",{"type":13,"tag":34,"props":521,"children":523},{"className":522},[],[524],{"type":18,"value":320},{"type":18,"value":526}," valid ",{"type":13,"tag":342,"props":528,"children":529},{"href":344},[530],{"type":18,"value":347},{"type":18,"value":532}," structures",{"type":13,"tag":475,"props":534,"children":536},{"name":535},"VUID-vkFlushMappedMemoryRanges-memoryRangeCount-arraylength",[537],{"type":13,"tag":14,"props":538,"children":539},{},[540,545,546,549,551],{"type":13,"tag":34,"props":541,"children":543},{"className":542},[],[544],{"type":18,"value":320},{"type":18,"value":488},{"type":13,"tag":368,"props":547,"children":548},{"type":435},[],{"type":18,"value":550}," be greater than ",{"type":13,"tag":34,"props":552,"children":554},{"className":553},[],[555],{"type":18,"value":556},"0",{"type":13,"tag":558,"props":559,"children":560},"style",{},[561],{"type":18,"value":562},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":31,"searchDepth":61,"depth":61,"links":564},[],"markdown",1725732616433]