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

Aperta Adatta ai principianti
#7,983 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Inizia da VulkanRenderer::initializeInstance, dove il percorso non OpenXR passa il createInfo semplice a vk::createInstanceUnique. Confrontalo con il ramo OpenXR, che passa la testa di createInstanceChain. Compila in Debug con Vulkan, avvia con -gr_sync_validation e controlla in fs2_open.log le righe SYNC-HAZARD. È completato quando il solo flag segnala gli stessi hazard che segnala VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C++
Stelle
488
Fork
184
Merge medio
3g 1h
PR unite (30g)
29

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di scp-fs2open/fs2open.github.com

Tutte le issue di scp-fs2open/fs2open.github.com

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.