Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Using latest `main` breaks `glam` build (`core::…` not found).

オープン
#365 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust

調査の方向性

シェーダーソース、Cargo.toml の依存関係、および最新の main を使って失敗を再現し、動作している simplest-shader のセットアップと比較します。まず、core traits と関数が見つからないという報告された glam エラーから始め、sirv-std 0.9.0 ではなく最新のブランチで提供されたシェーダーをコンパイルして修正を確認します。

索引モデルが issue の本文から書いたものです。

説明

bug

I have a shader whose logic I can compile under rust-gpu by modifying the simplest-shader's toml and lib.rs.

However, under my own project, the exact same shader fails to compile with a long list of errors claiming that core funcitons such as panic, clone, copy... cannot be found, for example:

error[E0405]: cannot find trait `Clone` in this scope
 --> /home/makogan/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/glam-0.24.2/src/swizzles/vec_traits.rs:3:40
  |
3 | pub trait Vec2Swizzles: Sized + Copy + Clone {
  |                                        ^^^^^ not found in this scope
  |
help: consider importing this trait
  |
3 + use core::clone::Clone;

This code does compile on my project if I depend on sirv-std 0.9.0, but not if I depend on the latest gh branch.

This shader:

#![cfg_attr(target_arch = "spirv", no_std, feature(lang_items))]
#![allow(internal_features)]

extern crate bytemuck;
extern crate spirv_std;

pub use spirv_std::glam::{Mat2, Vec2, Vec3, Vec4};
use spirv_std::spirv;

#[spirv(fragment)]
pub fn main_fs(color: Vec4, output: &mut Vec4)
{
    *output = Vec4::new(color.x, color.y, color.z, 1.0); //
}

#[spirv(vertex)]
pub fn main_vs(
    #[spirv(uniform, descriptor_set = 1, binding = 0)] transform: &Mat2,
    // [[dem_config(binding = 0)]]
    position_bind0: Vec2,
    // [[dem_config(binding = 0)]]
    color_bind0: Vec3,
    #[spirv(position, invariant)] out_pos: &mut Vec4,
    out_color: &mut Vec4,
)
{
    let res: Vec2 = *transform * position_bind0;
    *out_pos = Vec4::new(res.x, res.y, 0., 1.);

    *out_color = Vec4::new(color_bind0.x, color_bind0.y, color_bind0.z, 1.0);
}

And this toml:

[package]
name = "spinning-triangle-shader"
version = "0.0.0"
publish = false

[lib]
crate-type = ["rlib", "cdylib"]

[dependencies]
spirv-std = { git = "https://github.com/Rust-GPU/rust-gpu/", rev = "df1628a" }
bytemuck = { version = "1.20.0", features = ["derive"] }
libm = "=0.2.11"
主要言語
Rust
スター
3.4k
フォーク
126
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Rust-GPU/rust-gpu のほかの issue

Rust-GPU/rust-gpu の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。