Support internal pipelines for Dawn Like copyTextureCHROMIUM in Chromium, CopyImageBitmapToTexture can use internal pipeline to do the GPU uploading. But Dawn doesn't support internal pipeline now. This patch adds the first internal pipeline for Dawn and add the API CopyTextureForBrowser to use internal pipeline to do gpu uploading. The patch integrates very simple wgsl vertex/fragment shaders to do simple direct blit to verify the whole system works. BUG=dawn:465 Change-Id: I8b566af38a10eea00f7426c39e752958ef057abd Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30960 Commit-Queue: Shaobo Yan <shaobo.yan@intel.com> Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn_native/CommandValidation.h b/src/dawn_native/CommandValidation.h index faf6f12..0eb04f5 100644 --- a/src/dawn_native/CommandValidation.h +++ b/src/dawn_native/CommandValidation.h
@@ -78,6 +78,14 @@ bool IsRangeOverlapped(uint32_t startA, uint32_t startB, uint32_t length); + MaybeError ValidateTextureToTextureCopyRestrictions(const TextureCopyView& src, + const TextureCopyView& dst, + const Extent3D& copySize); + + MaybeError ValidateCanUseAs(const TextureBase* texture, wgpu::TextureUsage usage); + + MaybeError ValidateCanUseAs(const BufferBase* buffer, wgpu::BufferUsage usage); + } // namespace dawn_native #endif // DAWNNATIVE_COMMANDVALIDATION_H_