Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

entry point fn with too many params fails

Đang mở
#608 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust
Lĩnh vực
compilers

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện bản build rust-gpu đã được báo cáo với entry point cs_main được cung cấp và tham số RuntimeArray của nó. Kiểm tra SPIR-V được tạo ra xung quanh albedo_tex_table và lỗi OpTypeRuntimeArray của Vulkan; được xem là hoàn tất khi shader biên dịch mà không tạo một OpVariable không hợp lệ cho runtime array.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

I am trying to convert a project of mine from wgsl to rust-gpu. I got the basics done, but I have a shader I can't get to compile

This is the entry point

#[spirv(compute(threads(8, 8, 1)))]
pub fn cs_main(
    #[spirv(global_invocation_id)] gid: UVec3,
    #[spirv(uniform, descriptor_set = 1, binding = 0)] globals: &SBGlobalData,
    #[spirv(uniform, descriptor_set = 2, binding = 0)] camera: &SBCameraData,
    #[spirv(storage_buffer, descriptor_set = 3, binding = 0)] tlas_nodes: &[BvhNode],
    #[spirv(storage_buffer, descriptor_set = 3, binding = 1)] tlas_instances: &[TlasInstance],
    #[spirv(storage_buffer, descriptor_set = 3, binding = 2)] blas_nodes: &[BvhNode],
    #[spirv(storage_buffer, descriptor_set = 3, binding = 3)] blas_tris: &[Triangle],
    #[spirv(descriptor_set = 3, binding = 4)] rt_out: &Image!(2D, format = rgba16f, sampled = false, arrayed = false, multisampled = false),
    #[spirv(uniform, descriptor_set = 3, binding = 5)] rt_consts: &RaytracerConsts,
    #[spirv(uniform, descriptor_set = 3, binding = 6)] mat_consts: &RtLightConsts,
    #[spirv(storage_buffer, descriptor_set = 3, binding = 7)] rt_materials: &[RtMaterialEntry],
    #[spirv(descriptor_set = 3, binding = 8)] albedo_sampler: &Sampler,
    #[spirv(descriptor_set = 4, binding = 0)] albedo_tex_table: &RuntimeArray<Image!(2D, type = f32, sampled = true, arrayed = false, multisampled = false)>,
) {
Expected Behaviour

Shader compiles fine

Example & Steps To Reproduce

This is the errors I am getting

info: latest update on 2026-04-11 for version 1.96.0-nightly (02c7f9bec 2026-04-10)
info: component rust-src is up to date
warn: skipping unavailable component rust-std for target spirv-unknown-vulkan1.2
   Compiling shader-bench-rsgpu-user v0.1.0 (F:\rust\ideas\shader-bench\projects\raytracer-rs\.shader-bench\shader-cache\rust-gpu-build\ce910f26f4188d71)
warning: an unknown error occurred
  |
  = note: spirv-opt failed, leaving as unoptimized
error: [VUID-StandaloneSpirv-OpTypeRuntimeArray-04680] OpVariable, <id> '14[%albedo_tex_table]', is attempting to create memory for an illegal type, OpTypeRuntimeArray.

For Vulkan OpTypeRuntimeArray can only appear as the final member of an OpTypeStruct, thus cannot be instantiated via OpVariable
         %albedo_tex_table = OpVariable %_ptr_UniformConstant__runtimearr_94 UniformConstant

Bonus: u32.saturated_sub is not implemented btw

System Info

Windows + custom compiler wrap to compile rust-gpu shader at runtime without having my whole workspace on the specific nightly toolchain

Ngôn ngữ chính
Rust
Star
3.4k
Fork
126
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Rust-GPU/rust-gpu

Tất cả issue của Rust-GPU/rust-gpu

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.