-
Notifications
You must be signed in to change notification settings - Fork 370
Add minmax-sampling feature #1283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1375,6 +1375,7 @@ enum GPUFeatureName { | |||||
| "pipeline-statistics-query", | ||||||
| "texture-compression-bc", | ||||||
| "timestamp-query", | ||||||
| "minmax-sampling", | ||||||
| }; | ||||||
| </script> | ||||||
|
|
||||||
|
|
@@ -2349,7 +2350,9 @@ match one texel. | |||||
| <script type=idl> | ||||||
| enum GPUFilterMode { | ||||||
| "nearest", | ||||||
| "linear" | ||||||
| "linear", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 |
||||||
| "minimim", | ||||||
|
kvark marked this conversation as resolved.
Outdated
|
||||||
| "maximum", | ||||||
| }; | ||||||
| </script> | ||||||
|
|
||||||
|
|
@@ -2361,6 +2364,16 @@ enum GPUFilterMode { | |||||
| : <dfn>"linear"</dfn> | ||||||
| :: | ||||||
| Select two texels in each dimension and return a linear interpolation between their values. | ||||||
|
|
||||||
| : <dfn>"minimum"</dfn> | ||||||
| :: | ||||||
| Select two texels in each dimension and return the minimum value between them. | ||||||
| Requires {{GPUFeatureName/"minmax-sampling"}} feature to be enabled. | ||||||
|
|
||||||
| : <dfn>"maximum"</dfn> | ||||||
| :: | ||||||
| Select two texels in each dimension and return the maximum value between them. | ||||||
| Requires {{GPUFeatureName/"minmax-sampling"}} feature to be enabled. | ||||||
| </dl> | ||||||
|
|
||||||
| {{GPUCompareFunction}} specifies the behavior of a comparison sampler. If a comparison sampler is | ||||||
|
|
@@ -2429,6 +2442,11 @@ enum GPUCompareFunction { | |||||
| - |descriptor|.{{GPUSamplerDescriptor/lodMinClamp}} is greater than or equal to 0. | ||||||
| - |descriptor|.{{GPUSamplerDescriptor/lodMaxClamp}} is greater than or equal to | ||||||
| |descriptor|.{{GPUSamplerDescriptor/lodMinClamp}}. | ||||||
| - |descriptor|.{{GPUSamplerDescriptor/magFilter}} and |descriptor.{{GPUSamplerDescriptor/mipmapFilter}} | ||||||
| are either {{GPUFilterMode/"nearest"}} or {{GPUFilterMode/"linear"}}, independently. | ||||||
| - if |descriptor|.{{GPUSamplerDescriptor/minFilter}} is {{GPUFilterMode/"minimum"}} or | ||||||
| {{GPUFilterMode/"maximum"}}, then the |device|.{{device/[[features]]}} | ||||||
| [=list/contain=] {{GPUFeatureName/"minmax-sampling"}}. | ||||||
|
kvark marked this conversation as resolved.
Outdated
|
||||||
| </div> | ||||||
|
|
||||||
| <dl dfn-type=method dfn-for=GPUDevice> | ||||||
|
|
@@ -7253,6 +7271,22 @@ The following enums are supported if and only if the {{GPUFeatureName/"timestamp | |||||
| * {{GPUQueryType/"timestamp"}} | ||||||
| </dl> | ||||||
|
|
||||||
| ## <dfn dfn-type=enum-value dfn-for=GPUFeatureName>minmax-sampling</dfn> ## {#minmax-sampling} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should change this across all features, consistently (as a follow-up) |
||||||
|
|
||||||
| Allows for sampling modes that take the minimum or maximum of texture values. | ||||||
|
|
||||||
| **Feature Enums** | ||||||
|
|
||||||
| The following enums are supported if and only if the {{GPUFeatureName/"minmax-sampling"}} | ||||||
| [=feature=] is enabled: | ||||||
|
|
||||||
| <dl> | ||||||
| : {{GPUFilterMode}} | ||||||
| :: | ||||||
| * {{GPUFilterMode/"minimum"}} | ||||||
| * {{GPUFilterMode/"maximum"}} | ||||||
| </dl> | ||||||
|
|
||||||
| # Appendices # {#appendices} | ||||||
|
|
||||||
| ## Texture Format Capabilities ## {#texture-format-caps} | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is minmax sampling allowed for uint, int textures, but also for comparison samplers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that's not a lot of formats.