mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 13:18:37 +00:00
Tests: run the eight unregistered D3D12 GPU tests under ctest
d3d12_clear, d3d12_com, d3d12_descriptor, d3d12_method_variants, d3d12_resource_desc, d3d12_sampler2, d3d12_typeless_rtv and d3d12_uav_clear were built but never added with add_test, so ctest and CI never ran them. Each now exits 77 when there is no Vulkan GPU (DeviceStatus::unavailable), as d3d12_vulkan_device_test does, and is registered with SKIP_RETURN_CODE 77. (cherry picked from commit 2af37e5da368dd130ba23db385e812635cb1a768)
This commit is contained in:
@ -622,6 +622,8 @@ if(TARGET Vulkan::Headers)
|
||||
target_link_libraries(d3d12_com_test PRIVATE gta6rt_d3d12_com)
|
||||
target_compile_definitions(d3d12_com_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_options(d3d12_com_test PRIVATE /W4 /permissive- /utf-8)
|
||||
add_test(NAME d3d12_com COMMAND d3d12_com_test)
|
||||
set_tests_properties(d3d12_com PROPERTIES SKIP_RETURN_CODE 77)
|
||||
|
||||
add_executable(d3d12_shader_views_test test/d3d12_shader_views_test.cpp)
|
||||
target_link_libraries(d3d12_shader_views_test PRIVATE gta6rt_d3d12_com)
|
||||
@ -661,6 +663,8 @@ if(TARGET Vulkan::Headers)
|
||||
target_link_libraries(d3d12_uav_clear_test PRIVATE gta6rt_d3d12_com)
|
||||
target_compile_definitions(d3d12_uav_clear_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_options(d3d12_uav_clear_test PRIVATE /W4 /permissive- /utf-8)
|
||||
add_test(NAME d3d12_uav_clear COMMAND d3d12_uav_clear_test)
|
||||
set_tests_properties(d3d12_uav_clear PROPERTIES SKIP_RETURN_CODE 77)
|
||||
|
||||
# Debug markers as VK_EXT_debug_utils labels, and private data on every object (D3D-24).
|
||||
add_executable(d3d12_debug_markers_test test/d3d12_debug_markers_test.cpp)
|
||||
@ -683,12 +687,16 @@ if(TARGET Vulkan::Headers)
|
||||
target_link_libraries(d3d12_method_variants_test PRIVATE gta6rt_d3d12_com)
|
||||
target_compile_definitions(d3d12_method_variants_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_options(d3d12_method_variants_test PRIVATE /W4 /permissive- /utf-8)
|
||||
add_test(NAME d3d12_method_variants COMMAND d3d12_method_variants_test)
|
||||
set_tests_properties(d3d12_method_variants PROPERTIES SKIP_RETURN_CODE 77)
|
||||
|
||||
# CreateSampler2 (D3D-28) against CreateSampler, and its refusals against the host's PC runtime.
|
||||
add_executable(d3d12_sampler2_test test/d3d12_sampler2_test.cpp)
|
||||
target_link_libraries(d3d12_sampler2_test PRIVATE gta6rt_d3d12_com)
|
||||
target_compile_definitions(d3d12_sampler2_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_options(d3d12_sampler2_test PRIVATE /W4 /permissive- /utf-8)
|
||||
add_test(NAME d3d12_sampler2 COMMAND d3d12_sampler2_test)
|
||||
set_tests_properties(d3d12_sampler2 PROPERTIES SKIP_RETURN_CODE 77)
|
||||
|
||||
# Descriptors through the proxy: copies between heaps, what texture views and samplers write into their slots,
|
||||
# and (where glslangValidator is found) a compute shader the test runs on the device's bindless set, which
|
||||
@ -697,6 +705,8 @@ if(TARGET Vulkan::Headers)
|
||||
target_link_libraries(d3d12_descriptor_test PRIVATE gta6rt_d3d12_com)
|
||||
target_compile_definitions(d3d12_descriptor_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_options(d3d12_descriptor_test PRIVATE /W4 /permissive- /utf-8)
|
||||
add_test(NAME d3d12_descriptor COMMAND d3d12_descriptor_test)
|
||||
set_tests_properties(d3d12_descriptor PROPERTIES SKIP_RETURN_CODE 77)
|
||||
if(NOT Vulkan_GLSLANG_VALIDATOR_EXECUTABLE)
|
||||
find_program(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE glslangValidator HINTS "$ENV{VULKAN_SDK}/Bin" "$ENV{VULKAN_SDK}/bin")
|
||||
endif()
|
||||
@ -725,18 +735,24 @@ if(TARGET Vulkan::Headers)
|
||||
target_link_libraries(d3d12_clear_test PRIVATE gta6rt_d3d12_com d3d12 dxgi)
|
||||
target_compile_definitions(d3d12_clear_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_options(d3d12_clear_test PRIVATE /W4 /permissive- /utf-8)
|
||||
add_test(NAME d3d12_clear COMMAND d3d12_clear_test)
|
||||
set_tests_properties(d3d12_clear PROPERTIES SKIP_RETURN_CODE 77)
|
||||
|
||||
# Synthetic typed-view readbacks against Windows WARP; run explicitly on a Vulkan GPU.
|
||||
add_executable(d3d12_typeless_rtv_test test/d3d12_typeless_rtv_test.cpp)
|
||||
target_link_libraries(d3d12_typeless_rtv_test PRIVATE gta6rt_d3d12_com d3d12 dxgi)
|
||||
target_compile_definitions(d3d12_typeless_rtv_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_options(d3d12_typeless_rtv_test PRIVATE /W4 /permissive- /utf-8)
|
||||
add_test(NAME d3d12_typeless_rtv COMMAND d3d12_typeless_rtv_test)
|
||||
set_tests_properties(d3d12_typeless_rtv PROPERTIES SKIP_RETURN_CODE 77)
|
||||
|
||||
# ID3D12Resource::GetDesc against the host runtime and WARP; run explicitly on a Vulkan GPU.
|
||||
add_executable(d3d12_resource_desc_test test/d3d12_resource_desc_test.cpp)
|
||||
target_link_libraries(d3d12_resource_desc_test PRIVATE gta6rt_d3d12_com d3d12 dxgi)
|
||||
target_compile_definitions(d3d12_resource_desc_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_options(d3d12_resource_desc_test PRIVATE /W4 /permissive- /utf-8)
|
||||
add_test(NAME d3d12_resource_desc COMMAND d3d12_resource_desc_test)
|
||||
set_tests_properties(d3d12_resource_desc PROPERTIES SKIP_RETURN_CODE 77)
|
||||
|
||||
# ID3D12Resource::GetHeapProperties and ID3D12DescriptorHeap::GetDesc (node masks, resolved heap flags) against the
|
||||
# host runtime and WARP; run explicitly on a Vulkan GPU.
|
||||
|
||||
@ -263,7 +263,9 @@ int main(int argc, char** argv) {
|
||||
return 2;
|
||||
}
|
||||
vktest::Device vk;
|
||||
if (!vk.create()) return 1;
|
||||
const auto device_status = vk.initialize();
|
||||
if (device_status == vktest::DeviceStatus::unavailable) return 77; // no Vulkan GPU: ctest skips
|
||||
if (device_status != vktest::DeviceStatus::ready) return 1;
|
||||
const unsigned errors_before = vk.validation_errors();
|
||||
unsigned cases_checked = 0;
|
||||
const auto compare = [&]() -> int {
|
||||
|
||||
@ -33,7 +33,9 @@ int main(int argc, char** argv) {
|
||||
else if (argc != 1) return 2;
|
||||
using namespace leonida;
|
||||
vktest::Device d;
|
||||
EXPECT(d.create());
|
||||
const auto device_status = d.initialize();
|
||||
if (device_status == vktest::DeviceStatus::unavailable) return 77; // no Vulkan GPU: ctest skips
|
||||
if (device_status != vktest::DeviceStatus::ready) return 1;
|
||||
VulkanContext context(d.device_proc, d.device, true);
|
||||
EXPECT(context.loaded());
|
||||
|
||||
|
||||
@ -287,7 +287,9 @@ bool sample_through_set(vktest::Device& d, VkDescriptorSet set0, VkDescriptorSet
|
||||
|
||||
int main() {
|
||||
vktest::Device d;
|
||||
EXPECT(d.create());
|
||||
const auto device_status = d.initialize();
|
||||
if (device_status == vktest::DeviceStatus::unavailable) return 77; // no Vulkan GPU: ctest skips
|
||||
if (device_status != vktest::DeviceStatus::ready) return 1;
|
||||
|
||||
constexpr UINT size = 8, texels = size * size, bytes = texels * 4;
|
||||
std::vector<std::uint8_t> results(4 * bytes), after_destruction(bytes), borders(3 * bytes);
|
||||
|
||||
@ -270,7 +270,9 @@ std::vector<Edge> edge_answers(ID3D12Device10* device) {
|
||||
|
||||
int main() {
|
||||
vktest::Device d;
|
||||
EXPECT(d.create());
|
||||
const auto device_status = d.initialize();
|
||||
if (device_status == vktest::DeviceStatus::unavailable) return 77; // no Vulkan GPU: ctest skips
|
||||
if (device_status != vktest::DeviceStatus::ready) return 1;
|
||||
{
|
||||
rt::d3d12::VulkanDeviceInfo info{};
|
||||
info.get_instance_proc = d.instance_proc;
|
||||
|
||||
@ -110,7 +110,9 @@ Totals compare(ID3D12Device* ours, ID3D12Device* host, const char* host_name, co
|
||||
|
||||
int main() {
|
||||
vktest::Device vk;
|
||||
if (!vk.create()) return 1;
|
||||
const auto device_status = vk.initialize();
|
||||
if (device_status == vktest::DeviceStatus::unavailable) return 77; // no Vulkan GPU: ctest skips
|
||||
if (device_status != vktest::DeviceStatus::ready) return 1;
|
||||
unsigned matched = 0, mismatched = 0, references = 0;
|
||||
{
|
||||
Ref<ID3D12Device> ours;
|
||||
|
||||
@ -204,7 +204,9 @@ leonida::gfx10::SamplerWords words_of(const std::vector<unsigned char>& bytes) {
|
||||
|
||||
int main() {
|
||||
vktest::Device d;
|
||||
EXPECT(d.create());
|
||||
const auto device_status = d.initialize();
|
||||
if (device_status == vktest::DeviceStatus::unavailable) return 77; // no Vulkan GPU: ctest skips
|
||||
if (device_status != vktest::DeviceStatus::ready) return 1;
|
||||
{
|
||||
rt::d3d12::VulkanDeviceInfo info{};
|
||||
info.get_instance_proc = d.instance_proc;
|
||||
|
||||
@ -215,7 +215,9 @@ bool rejects_view(ID3D12Device* device, DXGI_FORMAT resource_format, const D3D12
|
||||
|
||||
int main() {
|
||||
vktest::Device vk;
|
||||
if (!vk.create()) return 1;
|
||||
const auto device_status = vk.initialize();
|
||||
if (device_status == vktest::DeviceStatus::unavailable) return 77; // no Vulkan GPU: ctest skips
|
||||
if (device_status != vktest::DeviceStatus::ready) return 1;
|
||||
unsigned comparisons = 0, mismatches = 0, rejected = 0;
|
||||
{
|
||||
Ref<ID3D12Device> ours, host;
|
||||
|
||||
@ -409,7 +409,9 @@ int main() {
|
||||
if (conversion_checks()) return 1;
|
||||
|
||||
vktest::Device d;
|
||||
EXPECT(d.create());
|
||||
const auto device_status = d.initialize();
|
||||
if (device_status == vktest::DeviceStatus::unavailable) return 77; // no Vulkan GPU: ctest skips
|
||||
if (device_status != vktest::DeviceStatus::ready) return 1;
|
||||
{
|
||||
rt::d3d12::VulkanDeviceInfo info{};
|
||||
info.get_instance_proc = d.instance_proc;
|
||||
|
||||
Reference in New Issue
Block a user