gfxstream: use range variable for its intended purpose

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33384>
This commit is contained in:
Eric Engestrom 2025-02-04 19:56:01 +01:00 committed by Marge Bot
parent 96c183c759
commit b2b37cb1de

View file

@ -554,9 +554,9 @@ def encode_vkFlushMappedMemoryRanges(typeInfo, api, cgen):
cgen.beginIf("!sResourceTracker->usingDirectMapping()")
cgen.beginFor("uint32_t i = 0", "i < memoryRangeCount", "++i")
cgen.stmt("auto range = pMemoryRanges[i]")
cgen.stmt("auto memory = pMemoryRanges[i].memory")
cgen.stmt("auto size = pMemoryRanges[i].size")
cgen.stmt("auto offset = pMemoryRanges[i].offset")
cgen.stmt("auto memory = range.memory")
cgen.stmt("auto size = range.size")
cgen.stmt("auto offset = range.offset")
cgen.stmt("uint64_t streamSize = 0")
cgen.stmt("if (!memory) { %s->write(&streamSize, sizeof(uint64_t)); continue; }" % streamVar)
cgen.stmt("auto hostPtr = sResourceTracker->getMappedPointer(memory)")
@ -593,9 +593,9 @@ def encode_vkInvalidateMappedMemoryRanges(typeInfo, api, cgen):
cgen.beginIf("!sResourceTracker->usingDirectMapping()")
cgen.beginFor("uint32_t i = 0", "i < memoryRangeCount", "++i")
cgen.stmt("auto range = pMemoryRanges[i]")
cgen.stmt("auto memory = pMemoryRanges[i].memory")
cgen.stmt("auto size = pMemoryRanges[i].size")
cgen.stmt("auto offset = pMemoryRanges[i].offset")
cgen.stmt("auto memory = range.memory")
cgen.stmt("auto size = range.size")
cgen.stmt("auto offset = range.offset")
cgen.stmt("uint64_t streamSize = 0")
cgen.stmt("if (!memory) { %s->read(&streamSize, sizeof(uint64_t)); continue; }" % streamVar)
cgen.stmt("auto hostPtr = sResourceTracker->getMappedPointer(memory)")