Files
SpartanPort/tests/test_frame_capture.cpp
devLucasEmiliano 0c03388881 Test(GPU): regressão da captura de quadro com data nulo
Buffer() com ponteiro nulo (ring binding dos user data achatados,
endereço guest 0) derrubava o jogo no F11. O alvo frame-capture-test
liga só vk_frame_capture.cpp, sem gow3gpu nem device Vulkan.

Refs #174
2026-10-13 20:10:21 -03:00

20 lines
876 B
C++

// SPDX-License-Identifier: GPL-2.0-or-later
// The frame analyzer's buffer dump (vk_frame_capture.cpp). A binding whose bytes the host cannot
// read (data null: a constant-ring copy of the flattened user data carries guest address 0,
// issue #174) is skipped instead of read through the null pointer. No game or Vulkan device.
#include <array>
#include <cstdio>
#include "video_core/renderer_vulkan/vk_frame_capture.h"
int main() {
// A buffer with host bytes is dumped as before.
std::array<float, 16> words{};
Vulkan::FrameCapture::Buffer(0x1234, 0, 0x1000, words.data(), sizeof(words));
// Flattened user data in the constant ring: host copy only, guest address 0, and here
// nothing readable at all. Must not dereference `data`.
Vulkan::FrameCapture::Buffer(0x1234, 1, 0, nullptr, 64);
std::puts("frame-capture-test ok");
return 0;
}