Skip to content

Commit 8f50bb9

Browse files
Make passthrough shaders non-experimental (gfx-rs#9054)
* Refactored passthrough shaders * Added a changelog entry
1 parent 05861da commit 8f50bb9

12 files changed

Lines changed: 26 additions & 29 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ By @cwfitzgerald in [#8999](https://github.com/gfx-rs/wgpu/pull/8999).
107107
- Pipelines using passthrough shaders now correctly require explicit pipeline layout. By @inner-daemons in #8881.
108108
- Allow using a shader that defines I/O for dual-source blending in a pipeline that does not make use of it. By @andyleiserson in [#8856](https://github.com/gfx-rs/wgpu/pull/8856).
109109
- Validate `strip_index_format` isn't None and equals index buffer format for indexed drawing with strip topology. By @beicause in [#8850](https://github.com/gfx-rs/wgpu/pull/8850).
110+
- Renamed `EXPERIMENTAL_PASSTHROUGH_SHADERS` to `PASSTHROUGH_SHADERS` and made this no longer an experimental feature. by @inner-daemons in [#9054](https://github.com/gfx-rs/wgpu/pull/9054).
110111

111112
#### naga
112113

deno_webgpu/webidl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ pub fn feature_names_to_features(
520520
GPUFeatureName::ShaderI16 => Features::SHADER_I16,
521521
GPUFeatureName::ShaderPrimitiveIndex => Features::SHADER_PRIMITIVE_INDEX,
522522
GPUFeatureName::ShaderEarlyDepthTest => Features::SHADER_EARLY_DEPTH_TEST,
523-
GPUFeatureName::PassthroughShaders => Features::EXPERIMENTAL_PASSTHROUGH_SHADERS,
523+
GPUFeatureName::PassthroughShaders => Features::PASSTHROUGH_SHADERS,
524524
};
525525
features.set(feature, true);
526526
}
@@ -680,7 +680,7 @@ pub fn features_to_feature_names(
680680
if features.contains(wgpu_types::Features::SHADER_EARLY_DEPTH_TEST) {
681681
return_features.insert(ShaderEarlyDepthTest);
682682
}
683-
if features.contains(wgpu_types::Features::EXPERIMENTAL_PASSTHROUGH_SHADERS) {
683+
if features.contains(wgpu_types::Features::PASSTHROUGH_SHADERS) {
684684
return_features.insert(PassthroughShaders);
685685
}
686686

examples/features/src/mesh_shader/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct Shaders {
6565

6666
fn get_shaders(device: &wgpu::Device, backend: wgpu::Backend) -> Shaders {
6767
// In the case that the platform does support mesh shaders, the dummy
68-
// shader is used to avoid requiring EXPERIMENTAL_PASSTHROUGH_SHADERS.
68+
// shader is used to avoid requiring PASSTHROUGH_SHADERS.
6969
match backend {
7070
wgpu::Backend::Vulkan => {
7171
let compiled = compile_wgsl(device);
@@ -191,7 +191,7 @@ impl crate::framework::Example for Example {
191191
Default::default()
192192
}
193193
fn required_features() -> wgpu::Features {
194-
wgpu::Features::EXPERIMENTAL_MESH_SHADER | wgpu::Features::EXPERIMENTAL_PASSTHROUGH_SHADERS
194+
wgpu::Features::EXPERIMENTAL_MESH_SHADER | wgpu::Features::PASSTHROUGH_SHADERS
195195
}
196196
fn required_limits() -> wgpu::Limits {
197197
wgpu::Limits::defaults().using_recommended_minimum_mesh_shader_values()
@@ -222,10 +222,7 @@ pub static TEST: crate::framework::ExampleTestParams = crate::framework::Example
222222
height: 768,
223223
optional_features: wgpu::Features::default(),
224224
base_test_parameters: wgpu_test::TestParameters::default()
225-
.features(
226-
wgpu::Features::EXPERIMENTAL_MESH_SHADER
227-
| wgpu::Features::EXPERIMENTAL_PASSTHROUGH_SHADERS,
228-
)
225+
.features(wgpu::Features::EXPERIMENTAL_MESH_SHADER | wgpu::Features::PASSTHROUGH_SHADERS)
229226
.instance_flags(wgpu::InstanceFlags::advanced_debugging())
230227
.limits(wgpu::Limits::defaults().using_recommended_minimum_mesh_shader_values())
231228
.skip(wgpu_test::FailureCase {

tests/tests/wgpu-gpu/mesh_shader/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn get_shaders(
9999
unreachable!();
100100
}
101101
// In the case that the platform does support mesh shaders, the dummy
102-
// shader is used to avoid requiring EXPERIMENTAL_PASSTHROUGH_SHADERS.
102+
// shader is used to avoid requiring PASSTHROUGH_SHADERS.
103103
match backend {
104104
wgpu::Backend::Vulkan => {
105105
let compiled = compile_wgsl(device);
@@ -395,7 +395,7 @@ fn default_gpu_test_config(draw_type: DrawType) -> GpuTestConfiguration {
395395
.instance_flags(wgpu::InstanceFlags::GPU_BASED_VALIDATION)
396396
.features(
397397
wgpu::Features::EXPERIMENTAL_MESH_SHADER
398-
| wgpu::Features::EXPERIMENTAL_PASSTHROUGH_SHADERS
398+
| wgpu::Features::PASSTHROUGH_SHADERS
399399
| match draw_type {
400400
DrawType::Standard | DrawType::Indirect | DrawType::MultiIndirect => {
401401
wgpu::Features::empty()

tests/tests/wgpu-gpu/passthrough/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn metal_test(ctx: TestingContext) {
9090
static METAL_PASSTHROUGH_SHADER: GpuTestConfiguration = GpuTestConfiguration::new()
9191
.parameters(
9292
TestParameters::default()
93-
.features(Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)
93+
.features(Features::PASSTHROUGH_SHADERS)
9494
.skip(FailureCase::backend(!Backends::METAL)),
9595
)
9696
.run_sync(metal_test);
@@ -192,7 +192,7 @@ fn metallib_test(ctx: TestingContext) {
192192
static METALLIB_PASSTHROUGH_SHADER: GpuTestConfiguration = GpuTestConfiguration::new()
193193
.parameters(
194194
TestParameters::default()
195-
.features(Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)
195+
.features(Features::PASSTHROUGH_SHADERS)
196196
.skip(FailureCase::backend(!Backends::METAL)),
197197
)
198198
.run_sync(metallib_test);
@@ -216,7 +216,7 @@ fn hlsl_test(ctx: TestingContext) {
216216
static HLSL_PASSTHROUGH_SHADER: GpuTestConfiguration = GpuTestConfiguration::new()
217217
.parameters(
218218
TestParameters::default()
219-
.features(Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)
219+
.features(Features::PASSTHROUGH_SHADERS)
220220
.skip(FailureCase::backend(!Backends::DX12)),
221221
)
222222
.run_sync(hlsl_test);
@@ -296,7 +296,7 @@ fn dxil_test(ctx: TestingContext) {
296296
static DXIL_PASSTHROUGH_SHADER: GpuTestConfiguration = GpuTestConfiguration::new()
297297
.parameters(
298298
TestParameters::default()
299-
.features(Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)
299+
.features(Features::PASSTHROUGH_SHADERS)
300300
.skip(FailureCase::backend(!Backends::DX12)),
301301
)
302302
.run_sync(dxil_test);
@@ -351,7 +351,7 @@ fn spirv_test(ctx: TestingContext) {
351351
static SPIRV_PASSTHROUGH_SHADER: GpuTestConfiguration = GpuTestConfiguration::new()
352352
.parameters(
353353
TestParameters::default()
354-
.features(Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)
354+
.features(Features::PASSTHROUGH_SHADERS)
355355
.skip(FailureCase::backend(!Backends::VULKAN)),
356356
)
357357
.run_sync(spirv_test);
@@ -386,7 +386,7 @@ fn glsl_test(ctx: TestingContext) {
386386
static GLSL_PASSTHROUGH_SHADER: GpuTestConfiguration = GpuTestConfiguration::new()
387387
.parameters(
388388
TestParameters::default()
389-
.features(Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)
389+
.features(Features::PASSTHROUGH_SHADERS)
390390
.skip(FailureCase::backend(!Backends::GL)),
391391
)
392392
.run_sync(glsl_test);
@@ -410,7 +410,7 @@ fn wgsl_test(ctx: TestingContext) {
410410
static WGSL_PASSTHROUGH_SHADER: GpuTestConfiguration = GpuTestConfiguration::new()
411411
.parameters(
412412
TestParameters::default()
413-
.features(Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)
413+
.features(Features::PASSTHROUGH_SHADERS)
414414
.skip(FailureCase::backend(!Backends::BROWSER_WEBGPU)),
415415
)
416416
.run_sync(wgsl_test);
@@ -450,7 +450,7 @@ fn all_passthrough_shaders_binary(ctx: TestingContext) {
450450

451451
#[gpu_test]
452452
static ALL_PASSTHROUGH_SHADERS_BINARY: GpuTestConfiguration = GpuTestConfiguration::new()
453-
.parameters(TestParameters::default().features(Features::EXPERIMENTAL_PASSTHROUGH_SHADERS))
453+
.parameters(TestParameters::default().features(Features::PASSTHROUGH_SHADERS))
454454
.run_sync(all_passthrough_shaders_binary);
455455

456456
fn all_passthrough_shader_source(ctx: TestingContext) {
@@ -488,7 +488,7 @@ fn all_passthrough_shader_source(ctx: TestingContext) {
488488

489489
#[gpu_test]
490490
static ALL_PASSTHROUGH_SHADERS_SOURCE: GpuTestConfiguration = GpuTestConfiguration::new()
491-
.parameters(TestParameters::default().features(Features::EXPERIMENTAL_PASSTHROUGH_SHADERS))
491+
.parameters(TestParameters::default().features(Features::PASSTHROUGH_SHADERS))
492492
.run_sync(all_passthrough_shader_source);
493493

494494
fn explicit_layout_validation(ctx: TestingContext) {
@@ -556,7 +556,7 @@ static PASSTHROUGH_SHADERS_EXPLICIT_LAYOUT_VALIDATION: GpuTestConfiguration =
556556
GpuTestConfiguration::new()
557557
.parameters(
558558
TestParameters::default()
559-
.features(Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)
559+
.features(Features::PASSTHROUGH_SHADERS)
560560
.expect_fail(FailureCase::always()),
561561
)
562562
.run_sync(explicit_layout_validation);

tests/tests/wgpu-validation/api/experimental.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn request_multiple_experimental_features_when_not_enabled() {
6161
let dq = pollster::block_on(adapter.request_device(&wgpu::DeviceDescriptor {
6262
// Experimental
6363
required_features: wgpu::Features::EXPERIMENTAL_MESH_SHADER
64-
| wgpu::Features::EXPERIMENTAL_PASSTHROUGH_SHADERS,
64+
| wgpu::Features::EXPERIMENTAL_COOPERATIVE_MATRIX,
6565
experimental_features: wgpu::ExperimentalFeatures::disabled(),
6666
..Default::default()
6767
}));

wgpu-core/src/device/resource.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,7 @@ impl Device {
23552355
descriptor: &pipeline::ShaderModuleDescriptorPassthrough<'a>,
23562356
) -> Result<Arc<pipeline::ShaderModule>, pipeline::CreateShaderModuleError> {
23572357
self.check_is_valid()?;
2358-
self.require_features(wgt::Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)?;
2358+
self.require_features(wgt::Features::PASSTHROUGH_SHADERS)?;
23592359

23602360
let hal_shader = match self.backend() {
23612361
wgt::Backend::Vulkan => hal::ShaderInput::SpirV(

wgpu-hal/src/dx12/adapter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ impl super::Adapter {
487487
| wgt::Features::TEXTURE_FORMAT_NV12
488488
| wgt::Features::FLOAT32_FILTERABLE
489489
| wgt::Features::TEXTURE_ATOMIC
490-
| wgt::Features::EXPERIMENTAL_PASSTHROUGH_SHADERS
490+
| wgt::Features::PASSTHROUGH_SHADERS
491491
| wgt::Features::EXTERNAL_TEXTURE;
492492

493493
//TODO: in order to expose this, we need to run a compute shader

wgpu-hal/src/metal/adapter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ impl super::PrivateCapabilities {
10161016
| F::SHADER_F16
10171017
| F::DEPTH32FLOAT_STENCIL8
10181018
| F::BGRA8UNORM_STORAGE
1019-
| F::EXPERIMENTAL_PASSTHROUGH_SHADERS
1019+
| F::PASSTHROUGH_SHADERS
10201020
| F::EXTERNAL_TEXTURE;
10211021

10221022
features.set(F::FLOAT32_FILTERABLE, self.supports_float_filtering);

wgpu-hal/src/vulkan/adapter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ impl PhysicalDeviceFeatures {
648648
| F::PIPELINE_CACHE
649649
| F::SHADER_EARLY_DEPTH_TEST
650650
| F::TEXTURE_ATOMIC
651-
| F::EXPERIMENTAL_PASSTHROUGH_SHADERS;
651+
| F::PASSTHROUGH_SHADERS;
652652

653653
let mut dl_flags = Df::COMPUTE_SHADERS
654654
| Df::BASE_VERTEX

0 commit comments

Comments
 (0)