P3: -gr_sync_validation reports itself enabled but never turns on synchronization validation

オープン 初心者向け
#7,983 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp

調査の方向性

VulkanRenderer::initializeInstance から始めてください。ここでは OpenXR 以外の経路が、そのままの createInfo を vk::createInstanceUnique に渡しています。これを、createInstanceChain の先頭を渡す OpenXR 分岐と比較してください。Vulkan を有効にして Debug ビルドし、-gr_sync_validation を付けて起動し、fs2_open.log で SYNC-HAZARD の行を確認してください。フラグだけで、VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true が報告するのと同じハザードが報告されれば完了です。

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

説明

Problem

-gr_sync_validation does not turn on Vulkan synchronization validation. The log says "Vulkan: Synchronization validation enabled (-gr_sync_validation)", but no synchronization hazards are ever reported, so a clean run with the flag proves nothing. Outside OpenXR, vk::createInstanceUnique is passed the bare createInfo instead of the head of the structure chain, so the validation-features struct (and the debug messenger meant to catch messages during instance creation) never reaches the driver. The OpenXR branch passes the chain correctly.

Steps to reproduce

  1. Build current master (tested on 8afa31842) in Debug with Vulkan, MediaVPs 5.0.2, no other mods.
  2. Run SM1-01 with -vulkan -gr_sync_validation for about 20 seconds of gameplay. fs2_open.log: the "Synchronization validation enabled" line, 0 lines containing SYNC-HAZARD.
  3. Run the same thing again with the environment variable VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true (which turns the same check on from the validation layer's side). fs2_open.log: 10 SYNC-HAZARD-WRITE-AFTER-WRITE lines from vkCmdClearAttachments in the same 20 seconds.

Expected vs. actual behavior

  • Expected: the flag alone reports the same hazards as step 3.
  • Actual: the flag alone reports none, while the log claims it is on.

Proposed fixes

  1. In VulkanRenderer::initializeInstance, pass createInstanceChain.get<vk::InstanceCreateInfo>() to vk::createInstanceUnique, as the OpenXR branch already does.
  2. Same change, plus a one-time check after instance creation that logs whether the layer accepted synchronization validation, so the log line reflects what actually happened.
  3. Same change, plus a note in the flag's help text that VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true works as a fallback on older builds.

The hazards in step 3 are reported as observed; I have not looked into whether each is a real problem.

主要言語
C++
スター
488
フォーク
184
平均マージ
2日 1分
マージ済み PR(30日)
26

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

scp-fs2open/fs2open.github.com のほかの issue

scp-fs2open/fs2open.github.com の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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