Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning 41012 when using Compilation API #6011

Open
duerrbaby opened this issue Jan 6, 2025 · 0 comments
Open

warning 41012 when using Compilation API #6011

duerrbaby opened this issue Jan 6, 2025 · 0 comments
Labels
goal:quality & productivity Quality issues and issues that impact our productivity coding day to day inside slang kind:bug something doesn't work like it should

Comments

@duerrbaby
Copy link

Hi, I have a compute shader using spvRayQueryKHR. I got this when compiling:
warning 41012: entry point 'main' uses additional capabilities that are not part of the specified profile 'spirv_1_6'. The profile setting is automatically updated to include these capabilities: 'spvRayQueryKHR'

This is my entry point:

[require(spvRayQueryKHR)]
[shader("compute")]
[numthreads(16, 16, 4)] // u, v, batch index
void main(uint3 DTid: SV_DispatchThreadID)
{

This is my compilation session construction:

            // define target
            slang::SessionDesc desc = {};
            slang::TargetDesc targetDesc = {};
            targetDesc.format = SLANG_SPIRV;
            targetDesc.profile = m_globalSession->findProfile("spirv_1_6");
            targetDesc.flags = SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY;

            std::vector<slang::CompilerOptionEntry> targetOptionEntries;
            targetOptionEntries.push_back(slang::CompilerOptionEntry{slang::CompilerOptionName::MacroDefine, {.stringValue0 = "RAY_QUERY", .stringValue1 = "1"}});
            targetOptionEntries.push_back(slang::CompilerOptionEntry{slang::CompilerOptionName::Capability, {.intValue0 = m_globalSession->findCapability("spvRayQueryKHR")}});

            if (!targetOptionEntries.empty())
            {
                targetDesc.compilerOptionEntryCount = static_cast<uint32_t>(targetOptionEntries.size());
                targetDesc.compilerOptionEntries = targetOptionEntries.data();
            }

            desc.targets = &targetDesc;
            desc.targetCount = 1;

            std::vector<const char*> searchPathCStr;
            if (!searchPaths.empty())
            {
                searchPathCStr.reserve(searchPaths.size());
                for (const auto& path : searchPaths)
                {
                    searchPathCStr.push_back(path.data());
                }
                desc.searchPaths = searchPathCStr.data();
                desc.searchPathCount = static_cast<SlangInt>(searchPathCStr.size());
            }

            desc.preprocessorMacroCount = static_cast<SlangInt>(preprocessorMacros.size());
            desc.preprocessorMacros = preprocessorMacros.data();

            m_globalSession->createSession(desc, &m_Session);

I think I specified the extra capabilities correctly? Not sure what else is missing.

@bmillsNV bmillsNV added kind:bug something doesn't work like it should goal:quality & productivity Quality issues and issues that impact our productivity coding day to day inside slang labels Jan 7, 2025
@bmillsNV bmillsNV added this to the Q1 2025 (Winter) milestone Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:quality & productivity Quality issues and issues that impact our productivity coding day to day inside slang kind:bug something doesn't work like it should
Projects
None yet
Development

No branches or pull requests

2 participants