mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Add GPUSampler to WebGPU implementation
Add dom_struct and webidl for GPUSampler, implement GPUDevice.createSampler() method.
This commit is contained in:
parent
43f29fe0ce
commit
dd04716b85
9 changed files with 318 additions and 142 deletions
|
@ -14,7 +14,7 @@ interface GPUDevice : EventTarget {
|
|||
GPUBuffer createBuffer(GPUBufferDescriptor descriptor);
|
||||
GPUMappedBuffer createBufferMapped(GPUBufferDescriptor descriptor);
|
||||
// GPUTexture createTexture(GPUTextureDescriptor descriptor);
|
||||
// GPUSampler createSampler(optional GPUSamplerDescriptor descriptor = {});
|
||||
GPUSampler createSampler(optional GPUSamplerDescriptor descriptor = {});
|
||||
|
||||
GPUBindGroupLayout createBindGroupLayout(GPUBindGroupLayoutDescriptor descriptor);
|
||||
GPUPipelineLayout createPipelineLayout(GPUPipelineLayoutDescriptor descriptor);
|
||||
|
|
43
components/script/dom/webidls/GPUSampler.webidl
Normal file
43
components/script/dom/webidls/GPUSampler.webidl
Normal file
|
@ -0,0 +1,43 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://gpuweb.github.io/gpuweb/#gpusampler
|
||||
[Exposed=(Window, DedicatedWorker), Pref="dom.webgpu.enabled"]
|
||||
interface GPUSampler {
|
||||
};
|
||||
GPUSampler includes GPUObjectBase;
|
||||
|
||||
dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase {
|
||||
GPUAddressMode addressModeU = "clamp-to-edge";
|
||||
GPUAddressMode addressModeV = "clamp-to-edge";
|
||||
GPUAddressMode addressModeW = "clamp-to-edge";
|
||||
GPUFilterMode magFilter = "nearest";
|
||||
GPUFilterMode minFilter = "nearest";
|
||||
GPUFilterMode mipmapFilter = "nearest";
|
||||
float lodMinClamp = 0;
|
||||
float lodMaxClamp = 0xfffff; // TODO: Update this. Value in spec was too big
|
||||
GPUCompareFunction compare;
|
||||
};
|
||||
|
||||
enum GPUAddressMode {
|
||||
"clamp-to-edge",
|
||||
"repeat",
|
||||
"mirror-repeat"
|
||||
};
|
||||
|
||||
enum GPUFilterMode {
|
||||
"nearest",
|
||||
"linear"
|
||||
};
|
||||
|
||||
enum GPUCompareFunction {
|
||||
"never",
|
||||
"less",
|
||||
"equal",
|
||||
"less-equal",
|
||||
"greater",
|
||||
"not-equal",
|
||||
"greater-equal",
|
||||
"always"
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue