Implement GPUQueue.writeBuffer and GPUQueue.writeTexture

This commit is contained in:
Kunal Mohan 2020-07-04 13:29:23 +05:30
parent 8ef7f24541
commit fae66089fa
7 changed files with 199 additions and 12 deletions

View file

@ -20,5 +20,3 @@ dictionary GPUBufferDescriptor : GPUObjectDescriptorBase {
};
typedef unsigned long long GPUSize64;
typedef sequence<any> GPUMappedBuffer;

View file

@ -7,12 +7,25 @@
interface GPUQueue {
void submit(sequence<GPUCommandBuffer> commandBuffers);
// GPUFence createFence(optional GPUFenceDescriptor descriptor = {});
// void signal(GPUFence fence, unsigned long long signalValue);
//GPUFence createFence(optional GPUFenceDescriptor descriptor = {});
//void signal(GPUFence fence, GPUFenceValue signalValue);
// void copyImageBitmapToTexture(
// GPUImageBitmapCopyView source,
// GPUTextureCopyView destination,
// GPUExtent3D copySize);
[Throws] void writeBuffer(
GPUBuffer buffer,
GPUSize64 bufferOffset,
/*[AllowShared]*/ ArrayBuffer data,
optional GPUSize64 dataOffset = 0,
optional GPUSize64 size);
[Throws] void writeTexture(
GPUTextureCopyView destination,
/*[AllowShared]*/ ArrayBuffer data,
GPUTextureDataLayout dataLayout,
GPUExtent3D size);
//void copyImageBitmapToTexture(
// GPUImageBitmapCopyView source,
// GPUTextureCopyView destination,
// GPUExtent3D copySize);
};
GPUQueue includes GPUObjectBase;

View file

@ -92,3 +92,22 @@ 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;