Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove explicit write in doVkCmdFillBuffer. #2189

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove explicit write in doVkCmdFillBuffer.
Treat this like any other GPU write.
This saves us a significant amount of performance since
we were tracking the writes byte-by-byte.
AWoloszyn committed Sep 10, 2018
commit 369a16c27b971781930a28be30765bf92ae665e6
14 changes: 1 addition & 13 deletions gapis/api/vulkan/api/copy_clear_commands.api
Original file line number Diff line number Diff line change
@@ -604,19 +604,7 @@ sub void dovkCmdFillBuffer(ref!vkCmdFillBufferArgs args) {
bufPieces := getBufferBoundMemoryPiecesInRange(buf, args.DstOffset, args.Size)
for _ , _ , p in bufPieces {
if as!VkDeviceSize(len(p.DeviceMemory.Data)) >= (p.MemoryOffset + p.Size) {
for i in (0 .. p.Size) {
offset := as!VkDeviceSize(p.ResourceOffset + i)
p.DeviceMemory.Data[p.MemoryOffset + i] = switch (offset - ((offset / 4) * 4)) {
case as!VkDeviceSize(0):
as!u8(args.Data & 0xFF)
case as!VkDeviceSize(1):
as!u8((args.Data >> 8) & 0xFF)
case as!VkDeviceSize(2):
as!u8((args.Data >> 16) & 0xFF)
case as!VkDeviceSize(3):
as!u8((args.Data >> 24) & 0xFF)
}
}
write(p.DeviceMemory.Data[p.MemoryOffset: p.MemoryOffset + p.Size])
}
}
}