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

Read-only storage textures should be allowed without a feature #6372

Open
jimblandy opened this issue Oct 5, 2024 · 1 comment
Open

Read-only storage textures should be allowed without a feature #6372

jimblandy opened this issue Oct 5, 2024 · 1 comment

Comments

@jimblandy
Copy link
Member

Shouldn't this pass?

use std::borrow::Cow;

use wgpu_test::{gpu_test, GpuTestConfiguration, TestingContext, TestParameters};

#[gpu_test]
static READ_ONLY_STORAGE_TEXTURE: GpuTestConfiguration =
    GpuTestConfiguration::new()
    .parameters(
        TestParameters::default()
            .test_features_limits()
    )
    .run_async(read_only_storage_texture);

async fn read_only_storage_texture(ctx: TestingContext) {
    let label = Some("read_only_storage_texture");
    let module = ctx.device.create_shader_module(wgpu::ShaderModuleDescriptor {
        label,
        source: wgpu::ShaderSource::Wgsl(Cow::Borrowed(r#"
            @group(0) @binding(0) var s: texture_storage_2d<rg32float, read>;
            @compute @workgroup_size(1) fn csWithStorageUsage() {
                _ = textureLoad(s, vec2u(0));
            }
        "#)),
    });

    let _ = ctx.device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
        label,
        layout: None,
        module: &module,
        entry_point: Some("csWithStorageUsage"),
        compilation_options: wgpu::PipelineCompilationOptions::default(),
        cache: None,
    });
}
@jimblandy
Copy link
Member Author

Here's the error:

wgpu error: Validation Error

Caused by:
  In Device::create_compute_pipeline, label = 'read_only_storage_texture'
    Unable to derive an implicit layout
      Binding 0 entry is invalid
        Read-write and read-only storage textures are not allowed by webgpu, they require the
        native only feature TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant