Rust-GPU / Rust-GPU/rust-gpu

destructurizing structs containing opaque types

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

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

enhancement
主要言語
Rust
スター
3.4k
フォーク
126
PR マージ指標
30日以内にマージされた PR はありません

説明

I'd love to be able to pack opaque types like depth into structs, but whenever I do, this happens:

  error: error:0:0 - [VUID-StandaloneSpirv-None-04667] In Vulkan, OpTypeStruct must not contain an opaque type.
           %material__screen_space_shadows__directional__SSSDirectionalLight____ = OpTypeStruct %renderer__camera__Camera %v3float %v2uint %v2uint %uint %uint %float %_ptr_UniformConstant_192
    |
    = note: spirv-val failed

I know you're already inlining all methods that reference opaque types, as one cannot simply pass an opaque type to a function in glsl. Could we also get that for structs?

Example use-case: Custom Samplers (or buffer loaders). Right now you are forced to pass the image to sample from to every single sample call, as you can't store the image in the custom sampler's struct. Often when constructing your sampler you want to pass in the image anyway, to load some metadata about it (eg. size) that will be constant throughout all sampling operations. And let's just hope noone accidentally passes in a different image for sampling than the one used to construct the sampler...

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

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

はじめの一歩

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

調査の方向性

まず、opaque types を参照するメソッドをインライン化する既存の処理を追跡し、次にレポートに示されている生成済みの SPIR-V 構造と spirv-val の失敗を調査します。opaque types を含む構造体(カスタムサンプラーを含む)が、すべてのサンプリング呼び出しに image を渡さなくても使用できるようになれば完了です。

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

評価

技術スタック
rust
領域
compilers, computer-graphics
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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