mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #26630 - kunalmohan:gpu-sampler, r=jdm
Add GPUSampler to WebGPU implementation Add dom_struct and webidl for GPUSampler, implement GPUDevice.createSampler() method. <!-- 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:
commit
95a818e262
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