-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add feature float32-filterable #4759
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8040c17
Add feature float32-filterable
almarklein 34ec931
fmt
almarklein e9a8dd7
float32-filterable on gles
almarklein a1074ad
floa32-filterable for d3d11 and d3d12
almarklein 1247f99
Add for Vulkan
almarklein ee4ec41
Update description
almarklein 7f7ae42
Update querying support for metal
almarklein 659e393
Merge remote-tracking branch 'almar/float32-filterable' into float32-…
almarklein 3bd6c10
fix is_blendable
almarklein 1bedb7b
fmt
almarklein e6a90aa
Add unit test for float32-filterable
almarklein d4ce162
Fix error about unused variable
almarklein 0bb7ec1
Fix more format errors
almarklein 5fe75c7
in gles backend, use float32-filterable feature instead of PrivateCap…
almarklein 2181623
Fix sample_type()
almarklein 3376fff
Merge branch 'trunk' into float32-filterable
almarklein c813c48
Fix test
almarklein f6f8945
Fix for dx12 and gl
almarklein 757b37b
Make second arg of sample_type() optional
almarklein a3aee1f
Merge branch 'trunk' into float32-filterable
almarklein a295e3e
Add to changelog
almarklein f90d383
clippy
almarklein 2e3e1d4
Merge branch 'trunk' into float32-filterable
teoxoy 44f39e7
Merge branch 'trunk' into float32-filterable
teoxoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| //! Tests for texture copy bounds checks. | ||
| //! Tests for BGRA8UNORM_STORAGE feature | ||
|
|
||
| use std::borrow::Cow; | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| //! Tests for FLOAT32_FILTERABLE feature. | ||
|
|
||
| use wgpu_test::{fail, gpu_test, GpuTestConfiguration, TestParameters}; | ||
|
|
||
| fn create_texture_binding(device: &wgpu::Device, format: wgpu::TextureFormat, filterable: bool) { | ||
| let texture = device.create_texture(&wgpu::TextureDescriptor { | ||
| label: None, | ||
| size: wgpu::Extent3d { | ||
| width: 256, | ||
| height: 256, | ||
| depth_or_array_layers: 1, | ||
| }, | ||
| mip_level_count: 1, | ||
| sample_count: 1, | ||
| dimension: wgpu::TextureDimension::D2, | ||
| format, | ||
| usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST, | ||
| view_formats: &[], | ||
| }); | ||
|
|
||
| let view = texture.create_view(&wgpu::TextureViewDescriptor::default()); | ||
|
|
||
| let bgl = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { | ||
| label: None, | ||
| entries: &[wgpu::BindGroupLayoutEntry { | ||
| binding: 0, | ||
| visibility: wgpu::ShaderStages::FRAGMENT, | ||
| ty: wgpu::BindingType::Texture { | ||
| sample_type: wgpu::TextureSampleType::Float { filterable }, | ||
| multisampled: false, | ||
| view_dimension: wgpu::TextureViewDimension::D2, | ||
| }, | ||
| count: None, | ||
| }], | ||
| }); | ||
|
|
||
| let _bg = device.create_bind_group(&wgpu::BindGroupDescriptor { | ||
| label: None, | ||
| layout: &bgl, | ||
| entries: &[wgpu::BindGroupEntry { | ||
| binding: 0, | ||
| resource: wgpu::BindingResource::TextureView(&view), | ||
| }], | ||
| }); | ||
| } | ||
|
|
||
| #[gpu_test] | ||
| static FLOAT32_FILTERABLE_WITHOUT_FEATURE: GpuTestConfiguration = GpuTestConfiguration::new() | ||
| .parameters(TestParameters::default()) | ||
| .run_sync(|ctx| { | ||
| let device = &ctx.device; | ||
| // Unorm textures are always filterable | ||
| create_texture_binding(device, wgpu::TextureFormat::R8Unorm, true); | ||
| create_texture_binding(device, wgpu::TextureFormat::R8Unorm, false); | ||
| // As are float16 textures | ||
| create_texture_binding(device, wgpu::TextureFormat::R16Float, true); | ||
| create_texture_binding(device, wgpu::TextureFormat::R16Float, false); | ||
| // Float 32 textures can be used as non-filterable only | ||
| create_texture_binding(device, wgpu::TextureFormat::R32Float, false); | ||
| // This is supposed to fail, since we have not activated the feature | ||
| fail(&ctx.device, || { | ||
| create_texture_binding(device, wgpu::TextureFormat::R32Float, true); | ||
| }); | ||
| }); | ||
|
|
||
| #[gpu_test] | ||
| static FLOAT32_FILTERABLE_WITH_FEATURE: GpuTestConfiguration = GpuTestConfiguration::new() | ||
| .parameters(TestParameters::default().features(wgpu::Features::FLOAT32_FILTERABLE)) | ||
| .run_sync(|ctx| { | ||
| let device = &ctx.device; | ||
| // With the feature enabled, it does work! | ||
| create_texture_binding(device, wgpu::TextureFormat::R32Float, true); | ||
| create_texture_binding(device, wgpu::TextureFormat::Rg32Float, true); | ||
| create_texture_binding(device, wgpu::TextureFormat::Rgba32Float, true); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.