diff options
| author | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 21:45:01 +0000 |
|---|---|---|
| committer | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 21:45:01 +0000 |
| commit | f1d006bdbda200bb599d7652d828bb03fbf54d5a (patch) | |
| tree | a013defefc537a6767c5b05a04faeb1a829f1302 /runtime/test/vk_harness.cpp | |
| parent | d030b991282748d5bbbd11a20eae6c6ea65ef36d (diff) | |
| parent | fc7d1f514d9d73c7366336c1e7adbdf5c689dfa0 (diff) | |
Merge #4025 (test/877b-shader-programs-validation)
Diffstat (limited to 'runtime/test/vk_harness.cpp')
| -rw-r--r-- | runtime/test/vk_harness.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/test/vk_harness.cpp b/runtime/test/vk_harness.cpp index 23d58bc70..d20c9d2c1 100644 --- a/runtime/test/vk_harness.cpp +++ b/runtime/test/vk_harness.cpp | |||
| @@ -30,10 +30,12 @@ | |||
| 30 | // dwords, default 0x92,0xc00000,0x14500000,0) at sampler index 1. | 30 | // dwords, default 0x92,0xc00000,0x14500000,0) at sampler index 1. |
| 31 | // | 31 | // |
| 32 | #define VK_NO_PROTOTYPES | 32 | #define VK_NO_PROTOTYPES |
| 33 | // LEONIDA_VK_VALIDATION=1 (env): a validation error from VK_LAYER_KHRONOS_validation fails the run (vk_validation.h). | ||
| 33 | #include "vulkan_loader.h" | 34 | #include "vulkan_loader.h" |
| 34 | #include "vk_device_pick.h" | 35 | #include "vk_device_pick.h" |
| 35 | #include "vk_shader_fma.h" | 36 | #include "vk_shader_fma.h" |
| 36 | #include "vk_pc_tail.h" | 37 | #include "vk_pc_tail.h" |
| 38 | #include "vk_validation.h" | ||
| 37 | #include "../src/descriptor_table.h" | 39 | #include "../src/descriptor_table.h" |
| 38 | #include "../src/gfx10_descriptors.h" | 40 | #include "../src/gfx10_descriptors.h" |
| 39 | #include "spirv_capability.h" | 41 | #include "spirv_capability.h" |
| @@ -137,7 +139,7 @@ static bool read_mesh(const char* path, uint32_t stride, std::vector<uint8_t>& v | |||
| 137 | return bool(f); | 139 | return bool(f); |
| 138 | } | 140 | } |
| 139 | 141 | ||
| 140 | int main(int argc, char** argv) { | 142 | static int run(int argc, char** argv) { |
| 141 | if (argc < 4) { | 143 | if (argc < 4) { |
| 142 | std::fprintf(stderr, "usage: vk_harness vs.spv fs.spv out.raw [w h [clip-test-s0 clip-test-s1]]\n" | 144 | std::fprintf(stderr, "usage: vk_harness vs.spv fs.spv out.raw [w h [clip-test-s0 clip-test-s1]]\n" |
| 143 | " vk_harness ms.spv fs.spv out.raw --mesh-group-readback X Y Z\n"); | 145 | " vk_harness ms.spv fs.spv out.raw --mesh-group-readback X Y Z\n"); |
| @@ -250,7 +252,10 @@ int main(int argc, char** argv) { | |||
| 250 | app.apiVersion = VK_API_VERSION_1_3; | 252 | app.apiVersion = VK_API_VERSION_1_3; |
| 251 | VkInstanceCreateInfo ici{VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO}; | 253 | VkInstanceCreateInfo ici{VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO}; |
| 252 | ici.pApplicationInfo = &app; | 254 | ici.pApplicationInfo = &app; |
| 255 | leonida::vk_test::OptInValidation validation; // LEONIDA_VK_VALIDATION | ||
| 256 | if (!validation.prepare(gipa, ici)) return 1; | ||
| 253 | CHECK(vkCreateInstance(&ici, nullptr, &inst)); | 257 | CHECK(vkCreateInstance(&ici, nullptr, &inst)); |
| 258 | CHECK(validation.attach(gipa, inst)); | ||
| 254 | LOADI(vkEnumeratePhysicalDevices); LOADI(vkGetPhysicalDeviceProperties); | 259 | LOADI(vkEnumeratePhysicalDevices); LOADI(vkGetPhysicalDeviceProperties); |
| 255 | LOADI(vkGetPhysicalDeviceProperties2); LOADI(vkGetPhysicalDeviceFeatures2); | 260 | LOADI(vkGetPhysicalDeviceProperties2); LOADI(vkGetPhysicalDeviceFeatures2); |
| 256 | LOADI(vkGetPhysicalDeviceQueueFamilyProperties); LOADI(vkGetPhysicalDeviceMemoryProperties); | 261 | LOADI(vkGetPhysicalDeviceQueueFamilyProperties); LOADI(vkGetPhysicalDeviceMemoryProperties); |
| @@ -1183,3 +1188,7 @@ int main(int argc, char** argv) { | |||
| 1183 | std::fprintf(stderr, "ok %ux%u -> %s\n", W, H, argv[3]); | 1188 | std::fprintf(stderr, "ok %ux%u -> %s\n", W, H, argv[3]); |
| 1184 | return 0; | 1189 | return 0; |
| 1185 | } | 1190 | } |
| 1191 | |||
| 1192 | int main(int argc, char** argv) { | ||
| 1193 | return leonida::vk_test::OptInValidation::exit_status(run(argc, argv)); | ||
| 1194 | } | ||