[//gpu][mac] Support multiple concurrent read access in Graphite
We have discovered that the lack of this support is a source of significant overhead for Graphite vs. Ganesh on at least one perf benchmark, as this is supported in Ganesh [2]. This function was added here [2]. It's not obvious to me what the requirements are for it being able to be supported in a given representation. This CL enables it for SkiaGraphiteDawnImageRepresentation for Mac. Local testing shows that it works unproblematically, including on YouTube and WebGPU's demo pages. [1] https://source.chromium.org/chromium/chromium/src/+/main:gpu/command_buffer/service/shared_image/iosurface_image_backing.mm;l=373-375;drc=b58207f5aecc39db7d3da766e7d171e5d2c3598e;bpv=1;bpt=1 [2] https://chromium-review.googlesource.com/c/chromium/src/+/1963098 Change-Id: Ie6c182baf69897dd3f8358883cd83489ff3b573b Bug: 1523517 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5250233 Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> Commit-Queue: Colin Blundell <blundell@chromium.org> Cr-Commit-Position: refs/heads/main@{#1260328}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
a36bba3290
commit
271bb588d4
@@ -753,6 +753,7 @@ class IOSurfaceImageBacking::DawnRepresentation final
|
|||||||
|
|
||||||
wgpu::Texture BeginAccess(wgpu::TextureUsage usage) final;
|
wgpu::Texture BeginAccess(wgpu::TextureUsage usage) final;
|
||||||
void EndAccess() final;
|
void EndAccess() final;
|
||||||
|
bool SupportsMultipleConcurrentReadAccess() final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr wgpu::TextureUsage kReadOnlyUsage =
|
static constexpr wgpu::TextureUsage kReadOnlyUsage =
|
||||||
@@ -897,6 +898,11 @@ void IOSurfaceImageBacking::DawnRepresentation::EndAccess() {
|
|||||||
}
|
}
|
||||||
#endif // BUILDFLAG(USE_DAWN)
|
#endif // BUILDFLAG(USE_DAWN)
|
||||||
|
|
||||||
|
bool IOSurfaceImageBacking::DawnRepresentation::
|
||||||
|
SupportsMultipleConcurrentReadAccess() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// IOSurfaceImageBacking
|
// IOSurfaceImageBacking
|
||||||
|
|
||||||
|
@@ -835,6 +835,10 @@ wgpu::Texture DawnImageRepresentation::BeginAccess(
|
|||||||
return this->BeginAccess(usage);
|
return this->BeginAccess(usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DawnImageRepresentation::SupportsMultipleConcurrentReadAccess() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// SharedImageRepresentationFactoryRef
|
// SharedImageRepresentationFactoryRef
|
||||||
|
|
||||||
|
@@ -779,6 +779,8 @@ class GPU_GLES2_EXPORT DawnImageRepresentation
|
|||||||
AllowUnclearedAccess allow_uncleared,
|
AllowUnclearedAccess allow_uncleared,
|
||||||
const gfx::Rect& update_rect);
|
const gfx::Rect& update_rect);
|
||||||
|
|
||||||
|
virtual bool SupportsMultipleConcurrentReadAccess();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class WrappedDawnCompoundImageRepresentation;
|
friend class WrappedDawnCompoundImageRepresentation;
|
||||||
|
|
||||||
|
@@ -226,4 +226,9 @@ void SkiaGraphiteDawnImageRepresentation::EndReadAccess() {
|
|||||||
mode_ = RepresentationAccessMode::kNone;
|
mode_ = RepresentationAccessMode::kNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SkiaGraphiteDawnImageRepresentation::
|
||||||
|
SupportsMultipleConcurrentReadAccess() {
|
||||||
|
return dawn_representation_->SupportsMultipleConcurrentReadAccess();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace gpu
|
} // namespace gpu
|
||||||
|
@@ -36,6 +36,7 @@ class GPU_GLES2_EXPORT SkiaGraphiteDawnImageRepresentation
|
|||||||
|
|
||||||
std::vector<skgpu::graphite::BackendTexture> BeginReadAccess() override;
|
std::vector<skgpu::graphite::BackendTexture> BeginReadAccess() override;
|
||||||
void EndReadAccess() override;
|
void EndReadAccess() override;
|
||||||
|
bool SupportsMultipleConcurrentReadAccess() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SkiaGraphiteDawnImageRepresentation(
|
SkiaGraphiteDawnImageRepresentation(
|
||||||
|
Reference in New Issue
Block a user