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

Đang mở Phù hợp với người mới
#7,983 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
computer-graphics

Hướng nghiên cứu

Bắt đầu từ VulkanRenderer::initializeInstance, nơi nhánh không dùng OpenXR truyền createInfo trần vào vk::createInstanceUnique. So sánh với nhánh OpenXR, nhánh này truyền phần đầu của createInstanceChain. Biên dịch ở chế độ Debug với Vulkan, chạy với -gr_sync_validation và kiểm tra trong fs2_open.log các dòng SYNC-HAZARD. Hoàn thành khi chỉ riêng cờ này báo cáo cùng các hazard mà VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
488
Fork
184
Merge trung bình
2 ngày 1 phút
Pull request đã merge (30 ngày)
26

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của scp-fs2open/fs2open.github.com

Tất cả issue của scp-fs2open/fs2open.github.com

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.