Final bits of vulkan buffer memory optimizations.
This moves transfer upload buffers to the new better specific memory usage and removes the CPU buffer used on android for writing to gpu buffers. The later will hopefully have some perf wins. Bug: skia:11207 Change-Id: I581e179b155bdadcae5d3f881b5a479338e01240 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369479 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
d6a5f449d8
commit
9408a6170b
@ -107,8 +107,7 @@ sk_sp<GrVkBuffer> GrVkBuffer::Make(GrVkGpu* gpu,
|
||||
break;
|
||||
case GrGpuBufferType::kXferCpuToGpu:
|
||||
bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
|
||||
// TODO: After done with all the renaming will move this to kTransfersFromCpuToGpu
|
||||
allocUsage = BufferUsage::kCpuWritesGpuReads;
|
||||
allocUsage = BufferUsage::kTransfersFromCpuToGpu;
|
||||
break;
|
||||
case GrGpuBufferType::kXferGpuToCpu:
|
||||
bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT;
|
||||
|
@ -408,15 +408,6 @@ void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface*
|
||||
fPreferFullscreenClears = true;
|
||||
}
|
||||
|
||||
// TODO: Once we are confident we've removed all the reads of vertex and index buffers remove
|
||||
// using this.
|
||||
if (kQualcomm_VkVendor == properties.vendorID || kARM_VkVendor == properties.vendorID) {
|
||||
// On Qualcomm and ARM mapping a gpu buffer and doing both reads and writes to it is slow.
|
||||
// Thus for index and vertex buffers we will force to use a cpu side buffer and then copy
|
||||
// the whole buffer up to the gpu.
|
||||
fBufferMapThreshold = SK_MaxS32;
|
||||
}
|
||||
|
||||
if (properties.vendorID == kNvidia_VkVendor || properties.vendorID == kAMD_VkVendor) {
|
||||
// On discrete GPUs it can be faster to read gpu only memory compared to memory that is also
|
||||
// mappable on the host.
|
||||
|
Loading…
Reference in New Issue
Block a user