[SPIR-V] Segfault: `vk::SpirvType` pointer as a push-constant member

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

メンテナーはふだん 2 日以内に返信

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

評価

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

調査の方向性

Start with the SPIR-V code path that lowers vk::SpirvType members in push constants, then reproduce the crash using the HLSL snippet and flags in the issue. Compare the generated layout and memory model with the expected Offset 8 and PhysicalStorageBuffer64; done means compilation succeeds without a segfault and produces those results.

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

説明

bug needs-triage spirv

Version: DXC trunk (Compiler Explorer)
Flags: -spirv -T cs_6_8 -E main -HV 202x -fspv-target-env=vulkan1.3 -fvk-use-scalar-layout

[[vk::binding(0,0)]] RWStructuredBuffer<uint32_t> buf;

typedef vk::SpirvType</*OpTypePointer*/32, /*size*/8, /*alignment*/8,
                      vk::Literal<vk::integral_constant<uint32_t, /*PhysicalStorageBuffer*/5349> >, uint32_t> PhysicalUintPtr;

struct PushData
{
    uint32_t        a;
    PhysicalUintPtr p;
};
[[vk::push_constant]] PushData pc;

[[vk::ext_capability(/*PhysicalStorageBufferAddresses*/5347)]]
[numthreads(64,1,1)]
void main(uint32_t gi : SV_GroupIndex)
{
    buf[gi] = pc.a;
}

Expected: compiles; p at Offset 8, OpMemoryModel PhysicalStorageBuffer64.
Actual: Program terminated with signal SIGSEGV (11) Compiler returned: 139.

主要言語
C++
スター
3.7k
フォーク
926
平均マージ
3日 22時間
マージ済み PR(30日)
45

環境構築

はじめの一歩

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

microsoft/DirectXShaderCompiler のほかの issue

microsoft/DirectXShaderCompiler の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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