Skip to content
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

Re-enable linear with comparisons. #4026

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

greggman
Copy link
Contributor

@greggman greggman commented Nov 1, 2024

It's a little confusing but depth textures used for "sampling" are not filterable but used for "comparisons" they are.

texture_?d with depth texture texture_depth_??
sampler 'linear' bad bad
sampler_comparison 'linear' N/A OK

It's a little confusing but depth textures used for
"sampling" are not filterable but used for "comparisons"
they are.

|                               | texture_?d<f32> with depth texture | texture_depth_?? |
| ----------------------------- | ---------------------------------- | ---------------- |
| sampler `'linear'`            |                bad                 |      bad         |
| sampler_comparison `'linear'` |                N/A                 |      OK          |
* * 'depth16unorm' -> false
* * 'rgba32float' -> true (you need to enable feature 'float32-filterable')
*/
export function isFilterableAsTextureF32(format: GPUTextureFormat) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: are r16float, rg16float, rgba16float filterable as TextureF32?

Copy link
Contributor Author

@greggman greggman Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, all normal color formats are filterable as textureF32 (r8unorm, r8snorm, rgba8norm, compressed formats, etc....). Effectively this is can you use the texture with texture_2d<f32>, texture_2d_array<f32>, texture_cube<f32>, etc...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh for r16float and etc, their info.color?.type is float already.

Copy link
Contributor

@shrekshao shrekshao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@greggman greggman merged commit 8328265 into gpuweb:main Nov 1, 2024
1 check passed
@greggman greggman deleted the re-enable-compare-with-linear branch November 1, 2024 21:51
greggman added a commit to greggman/cts that referenced this pull request Nov 2, 2024
texture_depth_xxx can only be used with non-filtering samplers
or comparison samples, not with filtering samplers.

see table in gpuweb#4026
greggman added a commit to greggman/cts that referenced this pull request Nov 2, 2024
texture_depth_xxx can only be used with non-filtering samplers
or comparison samples, not with filtering samplers.

see table in gpuweb#4026

Also enabled more depth tests
greggman added a commit to greggman/cts that referenced this pull request Nov 4, 2024
texture_depth_xxx can only be used with non-filtering samplers
or comparison samples, not with filtering samplers.

see table in gpuweb#4026

Also enabled more depth tests
greggman added a commit that referenced this pull request Nov 4, 2024
texture_depth_xxx can only be used with non-filtering samplers
or comparison samples, not with filtering samplers.

see table in #4026

Also enabled more depth tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants