Conversation
| "pipeline-statistics-query", | ||
| "texture-compression-bc", | ||
| "timestamp-query", | ||
| "minmax-sampling", |
There was a problem hiding this comment.
Is minmax sampling allowed for uint, int textures, but also for comparison samplers?
There was a problem hiding this comment.
The minmax feature in vulkan doesn't require support for any integer formats, so I assume we wouldn't support any. It also can't be used with comparison samplers apparently (kinda weird).
If the format is a depth/stencil format, this bit only specifies that the depth aspect (not the stencil aspect) of an image of this format supports min/max filtering, and that min/max filtering of the depth aspect is supported when depth compare is disabled in the sampler.
There was a problem hiding this comment.
It could be, but getting the stats for this is hard :(
For now the spec only allows it on a few selected formats (see last commit).
There was a problem hiding this comment.
Wow, that's not a lot of formats.
| * {{GPUQueryType/"timestamp"}} | ||
| </dl> | ||
|
|
||
| ## <dfn dfn-type=enum-value dfn-for=GPUFeatureName>minmax-sampling</dfn> ## {#minmax-sampling} |
There was a problem hiding this comment.
| ## <dfn dfn-type=enum-value dfn-for=GPUFeatureName>minmax-sampling</dfn> ## {#minmax-sampling} | |
| ## <dfn enum-value for=GPUFeatureName>minmax-sampling</dfn> ## {#minmax-sampling} |
There was a problem hiding this comment.
We should change this across all features, consistently (as a follow-up)
| "pipeline-statistics-query", | ||
| "texture-compression-bc", | ||
| "timestamp-query", | ||
| "minmax-sampling", |
There was a problem hiding this comment.
Wow, that's not a lot of formats.
|
Thank you for the quick and detailed reviews! We have now gone through a few iterations, and the spec is not quite the same as it was in the first draft.
So it sounds like a format still has to be filterable, even if the min/max reduction mode is used. This mostly affects "r32float", which I tentatively marked as enabled for min/maxing, even though one technically can do it today, since filtering is not supported (i.e. they get a WebGPU validation error because of filtering requirements). |
kainino0x
left a comment
There was a problem hiding this comment.
OK; as I said on the issue I wasn't sure whether it was tied to filterability or not.
I should have noticed that this should have defined a reduction mode instead of a filter mode, whoops.
| |s|.{{GPUSampler/[[descriptor]]}}.{{GPUSamplerDescriptor/compare}} is `null` or undefined. | ||
| Otherwise, set it to `true`. | ||
| 1. Set |s|.{{GPUSampler/[[isMinMax]]}} to `false` if | ||
| |s|.{{GPUSampler/[[descriptor]]}}.{{GPUSamplerDescriptor/reduction}} is {{GPUReductionMode/"weighted-average"}}. |
There was a problem hiding this comment.
Seems kind of backward, I think it's easier to read if it says set it to true if it's "minimum" or "maximum"
| {{GPUFilterMode/"linear"}}. Otherwise, set it to `true`. | ||
| 1. Set |s|.{{GPUSampler/[[isComparison]]}} to `false` if | ||
| |s|.{{GPUSampler/[[descriptor]]}}.{{GPUSamplerDescriptor/compare}} is `null` or undefined. | ||
| Otherwise, set it to `true`. |
There was a problem hiding this comment.
You can just say undefined; JS null and undefined both get converted to IDL undefined
https://heycam.github.io/webidl/#es-dictionary
I would probably flip this to say "true if compare is defined" or "is specified" or "is not undefined".
Wish we could come up with a better phrasing than "otherwise set it to true". Like "set isComparison to (s.descriptor.compare ≠ undefined)" maybe?
| :: the |binding| is a comparison sampler | ||
| : {{GPUSamplerBindingType/"minmax"}} | ||
| :: the |binding| is a min/max sampler | ||
| :: the |binding| is a non-comparison sampler |
There was a problem hiding this comment.
Maybe have "filtering or non-filtering or minmax" as one case, or just "otherwise".
| enum GPUFilterMode { | ||
| "nearest", | ||
| "linear" | ||
| "linear", |
There was a problem hiding this comment.
Briefly considering if we try to come up with a word other than linear, since this also describes minmax filters which aren't exactly "linear"? I'm not sure what it would be; "nearest"/"linear"(/"cubic") is well understood terminology. I think they're clearest.
Vulkan has an extension to use min/max with "cubic", too, fwiw: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#textures-texel-cubic-filtering
|
nit: are we sure we want to have this in the spec given it seems a very niche or advanced feature? I'm worried you both have spend significant time on this when it is nowhere close to the critical path to getting WebGPU out :) |
|
I just needed a warm-up before starting #1293 :) |
…1417) This PR adds unimplmented stubs for the read-write-modify atomic operations. * `atomicAdd` * `atomicAnd` * `atomicCompareExchangeWeak` * `atomicExchange` * `atomicMax` * `atomicMin` * `atomicOr` * `atomicSub` * `atomicXor` Issue gpuweb#1275, gpuweb#1276, gpuweb#1277, gpuweb#1278, gpuweb#1279, gpuweb#1280, gpuweb#1281, gpuweb#1282, gpuweb#1283
Closes #1267
This is useful for building hierarchical depth bounds, as one example.
Hardware support:
VK_EXT_sampler_filter_minmaxis present on around 50% desktops and 25% Android devices. There is a set of formats supporting min/max sampling, enabled by filterMinmaxSingleComponentFormats property. It's hard to grasp the support surface for the others.Note: min/max sampling shouldn't be considered "filtering" for the purpose of validation.
TODO:
Preview | Diff