| 27 | }; |
| 28 | |
| 29 | CGPUInstanceId init_instance(ECGPUBackend backend, bool enable_debug_layer, bool enableGPUValidation) |
| 30 | { |
| 31 | SKR_DECLARE_ZERO(CGPUInstanceDescriptor, desc) |
| 32 | desc.backend = backend; |
| 33 | desc.enable_debug_layer = enable_debug_layer; |
| 34 | desc.enable_gpu_based_validation = enableGPUValidation; |
| 35 | CGPUInstanceId instance = cgpu_create_instance(&desc); |
| 36 | SKR_DECLARE_ZERO(CGPUInstanceFeatures, instance_features) |
| 37 | cgpu_query_instance_features(instance, &instance_features); |
| 38 | if (backend == ECGPUBackend::CGPU_BACKEND_VULKAN) |
| 39 | { |
| 40 | EXPECT_TRUE(instance_features.specialization_constant); |
| 41 | } |
| 42 | else if (backend == ECGPUBackend::CGPU_BACKEND_D3D12) |
| 43 | { |
| 44 | EXPECT_FALSE(instance_features.specialization_constant); |
| 45 | } |
| 46 | else if (backend == ECGPUBackend::CGPU_BACKEND_METAL) |
| 47 | { |
| 48 | EXPECT_TRUE(instance_features.specialization_constant); |
| 49 | } |
| 50 | return instance; |
| 51 | } |
| 52 | |
| 53 | int enum_adapters(CGPUInstanceId instance) |
| 54 | { |