Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

extractBits unimplemented #2365

Closed
Brad-Hesson opened this issue Jun 1, 2023 · 3 comments
Closed

extractBits unimplemented #2365

Brad-Hesson opened this issue Jun 1, 2023 · 3 comments

Comments

@Brad-Hesson
Copy link

Got the following error during compilation using WGPU

2023-06-01T22:10:20.973603Z ERROR wgpu::backend::direct: Shader translation error for stage ShaderStages(NONE | VERTEX): HLSL: Unimplemented("write_expr_math ExtractBits")
2023-06-01T22:10:20.973856Z ERROR wgpu::backend::direct: Please report it to https://github.com/gfx-rs/naga
2023-06-01T22:10:20.974506Z ERROR wgpu::backend::direct: Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `Render Pipeline`
    Internal error in ShaderStages(NONE | VERTEX) shader: HLSL: Unimplemented("write_expr_math ExtractBits")

'

This is the code:

@vertex
fn vs_main(
    vertex: VertexInput,
    @location(2) instance: u32,
    @location(3) color: u32
) -> VertexOutput {
    var coords = vec2<f32>(hilbert_decode(instance, N));
    coords = coords / f32(1u << 16u) * 2. - 1.;
    var pos = vertex.position.xy;
    pos = pos / f32(1u << 16u) + coords;
    pos += pan_zoom.pan;
    pos *= pan_zoom.zoom;
    var out: VertexOutput;
    out.color = vec4<f32>(
        f32(extractBits(color, 0u, 8u)),
        f32(extractBits(color, 8u, 8u)),
        f32(extractBits(color, 16u, 8u)),
        f32(extractBits(color, 24u, 8u))
    );
    out.clip_position = vec4<f32>(pos, 1., 1.0);
    return out;
}
@cwfitzgerald
Copy link
Member

cwfitzgerald commented Jun 1, 2023

Duplicate of #1929
Will be solved by #2353

@cwfitzgerald cwfitzgerald closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2023
@Brad-Hesson
Copy link
Author

Brad-Hesson commented Jun 1, 2023

my bad, should've searched harder for an existing issue. Thanks

@cwfitzgerald
Copy link
Member

No worries at all! Would much rather too many issues get filled than we miss an issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants