系列博客总目录:https://blog.csdn.net/cRGBc/article/details/120412614
文章目录
WebGPU 之纹理
1 纹理的创建
纹理由 device.createTexture()
创建,类型是 GPUTexture
:
[Exposed=(Window, DedicatedWorker), SecureContext]
interface GPUTexture {
GPUTextureView createView(optional GPUTextureViewDescriptor descriptor = {});
undefined destroy();
};
GPUTexture includes GPUObjectBase;
createTexture
方法需要一个 GPUTextureDescriptor
类型的对象:
dictionary GPUTextureDescriptor : GPUObjectDescriptorBase {
required GPUExtent3D size;
GPUIntegerCoordinate mipLevelCount = 1;
GPUSize32 sampleCount = 1;
GPUTextureDimension dimension = "2d";
required GPUTextureFormat format;
required