Prepare texture for cross context usage when using the Metal backend.
This implementation will only work when the two contexts are created using the same device and command queue. This restriction is now applied in Flutter. With the patch and context setup, async texture uploads on the IO thread are functional. Change-Id: I887d24b2612cde933e088f74f33912a3a8762159 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275758 Commit-Queue: Chinmay Garde <chinmaygarde@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com> Auto-Submit: Chinmay Garde <chinmaygarde@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
1b0124fec6
commit
cf573d844d
@ -100,9 +100,7 @@ public:
|
||||
void insertSemaphore(GrSemaphore* semaphore) override;
|
||||
void waitSemaphore(GrSemaphore* semaphore) override;
|
||||
void checkFinishProcs() override;
|
||||
std::unique_ptr<GrSemaphore> prepareTextureForCrossContextUsage(GrTexture*) override {
|
||||
return nullptr;
|
||||
}
|
||||
std::unique_ptr<GrSemaphore> prepareTextureForCrossContextUsage(GrTexture*) override;
|
||||
|
||||
// When the Metal backend actually uses indirect command buffers, this function will actually do
|
||||
// what it says. For now, every command is encoded directly into the primary command buffer, so
|
||||
|
@ -226,6 +226,11 @@ void GrMtlGpu::checkFinishProcs() {
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<GrSemaphore> GrMtlGpu::prepareTextureForCrossContextUsage(GrTexture*) {
|
||||
submitCommandBuffer(SyncQueue::kSkip_SyncQueue);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
sk_sp<GrGpuBuffer> GrMtlGpu::onCreateBuffer(size_t size, GrGpuBufferType type,
|
||||
GrAccessPattern accessPattern, const void* data) {
|
||||
return GrMtlBuffer::Make(this, size, type, accessPattern, data);
|
||||
|
Loading…
Reference in New Issue
Block a user