Auto merge of #27348 - kunalmohan:gpu-copy, r=kvark

Implement GPUCommandEncoder.copy commands

<!-- Please describe your changes on the following line: -->
r?@kvark

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2020-07-21 15:13:08 -04:00 committed by GitHub
commit ac37078af8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 289 additions and 99 deletions

View file

@ -15,24 +15,33 @@ interface GPUCommandEncoder {
GPUSize64 destinationOffset,
GPUSize64 size);
// void copyBufferToTexture(
// GPUBufferCopyView source,
// GPUTextureCopyView destination,
// GPUExtent3D copySize);
void copyBufferToTexture(
GPUBufferCopyView source,
GPUTextureCopyView destination,
GPUExtent3D copySize);
// void copyTextureToBuffer(
// GPUTextureCopyView source,
// GPUBufferCopyView destination,
// GPUExtent3D copySize);
void copyTextureToBuffer(
GPUTextureCopyView source,
GPUBufferCopyView destination,
GPUExtent3D copySize);
// void copyTextureToTexture(
// GPUTextureCopyView source,
// GPUTextureCopyView destination,
// GPUExtent3D copySize);
void copyTextureToTexture(
GPUTextureCopyView source,
GPUTextureCopyView destination,
GPUExtent3D copySize);
// void pushDebugGroup(DOMString groupLabel);
// void popDebugGroup();
// void insertDebugMarker(DOMString markerLabel);
//void pushDebugGroup(USVString groupLabel);
//void popDebugGroup();
//void insertDebugMarker(USVString markerLabel);
//void writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex);
//void resolveQuerySet(
// GPUQuerySet querySet,
// GPUSize32 firstQuery,
// GPUSize32 queryCount,
// GPUBuffer destination,
// GPUSize64 destinationOffset);
GPUCommandBuffer finish(optional GPUCommandBufferDescriptor descriptor = {});
};
@ -88,3 +97,26 @@ dictionary GPUColorDict {
required double a;
};
typedef (sequence<double> or GPUColorDict) GPUColor;
dictionary GPUTextureDataLayout {
GPUSize64 offset = 0;
required GPUSize32 bytesPerRow;
GPUSize32 rowsPerImage = 0;
};
dictionary GPUBufferCopyView : GPUTextureDataLayout {
required GPUBuffer buffer;
};
dictionary GPUTextureCopyView {
required GPUTexture texture;
GPUIntegerCoordinate mipLevel = 0;
GPUOrigin3D origin = {};
};
dictionary GPUOrigin3DDict {
GPUIntegerCoordinate x = 0;
GPUIntegerCoordinate y = 0;
GPUIntegerCoordinate z = 0;
};
typedef (sequence<GPUIntegerCoordinate> or GPUOrigin3DDict) GPUOrigin3D;

View file

@ -92,22 +92,3 @@ dictionary GPUExtent3DDict {
};
typedef [EnforceRange] unsigned long GPUIntegerCoordinate;
typedef (sequence<GPUIntegerCoordinate> or GPUExtent3DDict) GPUExtent3D;
dictionary GPUTextureCopyView {
required GPUTexture texture;
GPUIntegerCoordinate mipLevel = 0;
GPUOrigin3D origin = {};
};
dictionary GPUTextureDataLayout {
GPUSize64 offset = 0;
required GPUSize32 bytesPerRow;
GPUSize32 rowsPerImage = 0;
};
dictionary GPUOrigin3DDict {
GPUIntegerCoordinate x = 0;
GPUIntegerCoordinate y = 0;
GPUIntegerCoordinate z = 0;
};
typedef (sequence<GPUIntegerCoordinate> or GPUOrigin3DDict) GPUOrigin3D;