From 23dcea810a79e19051e70ff2aa0b8953429c6461 Mon Sep 17 00:00:00 2001 From: "Harsh Aggarwal (NVIDIA)" Date: Thu, 19 Jun 2025 15:31:25 +0530 Subject: Enabling optix ci pipeline (#7311) * Revert "Disable OptiX tests by default. (#1331)" This reverts commit e45f8c1f49855cebe90b6722324ec24146ff5a3d. * Enable optix submodule to build Add support for default entry points in compilation Implemented logic to check for defined entry points in the module when no explicit entry points are provided. If found, these entry points are added to the `specializedEntryPoints` list, with the assumption that no specialization is needed for them at this time. * Disable optix if cuda is not enabled * Add submodule OptixSDK path in search * Distinguish user-explicit vs auto-detected SLANG_ENABLE_OPTIX When SLANG_ENABLE_OPTIX is explicitly set by user and CUDA is not available, show SEND_ERROR to maintain strict validation. When OptiX is auto-detected (e.g., local submodule present) but CUDA unavailable, gracefully disable with STATUS message to allow builds to continue. This addresses review feedback to keep error for explicit requests while handling auto-detection gracefully. * Apply CMake formatting to SLANG_ENABLE_OPTIX validation logic * revert: slang-rhi changes as those are merged independently as in PR # slang-rhi#400 --- tools/render-test/slang-support.cpp | 16 ++++++++++++++++ tools/slang-test/slang-test-main.cpp | 6 ------ 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/render-test/slang-support.cpp b/tools/render-test/slang-support.cpp index f98372330..b40473d41 100644 --- a/tools/render-test/slang-support.cpp +++ b/tools/render-test/slang-support.cpp @@ -451,6 +451,22 @@ static SlangResult _compileProgramImpl( specializedEntryPoints.add(specializedEntryPoint); } + // If no explicit entry points were provided, check if the module has any + // defined entry points (e.g., functions marked with [shader(...)] attributes) + if (explicitEntryPointCount == 0 && !options.dontAddDefaultEntryPoints) + { + SlangInt32 definedEntryPointCount = module->getDefinedEntryPointCount(); + for (SlangInt32 ee = 0; ee < definedEntryPointCount; ++ee) + { + ComPtr entryPoint; + SLANG_RETURN_ON_FAIL(module->getDefinedEntryPoint(ee, entryPoint.writeRef())); + + // For now, we'll assume no specialization is needed for discovered entry points + // If specialization is needed, this would need to be updated + specializedEntryPoints.add(entryPoint); + } + } + if (input.passThrough == SLANG_PASS_THROUGH_NONE) { componentsRawPtr.add(specializedModule); diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index a5f5ee316..c22b6dbf6 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -5047,12 +5047,6 @@ SlangResult innerMain(int argc, char** argv) options.includeCategories.add(fullTestCategory, fullTestCategory); } - // Don't include OptiX tests unless the client has explicit opted into them. - if (!options.includeCategories.containsKey(optixTestCategory)) - { - options.excludeCategories.add(optixTestCategory, optixTestCategory); - } - // Exclude rendering tests when building under AppVeyor. // // TODO: this is very ad hoc, and we should do something cleaner. -- cgit v1.2.3