We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Repro:
struct Jasper { float4 asdf; }; StructuredBuffer<uint> g_input : register(t0, space0); RWStructuredBuffer<uint> g_output : register(u1, space0); ConstantBuffer<Jasper> g_constant : register(b2, space0); StructuredBuffer<uint> g_bindlessInput[] : register(t0, space1); Texture2D<uint> g_texture2d : register(t0, space2); RWTexture2D<uint> g_rwtexture2d : register(u1, space3); [numthreads(64, 1, 1)] void main(int threadId: SV_DispatchThreadID) { g_output[threadId] = g_input[threadId] + g_constant.asdf + g_bindlessInput[threadId][threadId] + g_texture2d.Load(0, 0) + g_rwtexture2d.Load(0, 0); }
Invoking the compiler with like this outputs an error:
> dxc -Tcs_6_3 repro.hlsl repro.hlsl:16:24: warning: implicit truncation of vector type [-Wconversion] g_output[threadId] = g_input[threadId] + g_constant.asdf + g_bindlessInput[threadId][threadId] + g_texture2d.Load(0, 0) + g_rwtexture2d.Load(0, 0); ^ repro.hlsl:16:149: error: cannot compile this unexpected cast lvalue yet g_output[threadId] = g_input[threadId] + g_constant.asdf + g_bindlessInput[threadId][threadId] + g_texture2d.Load(0, 0) + g_rwtexture2d.Load(0, 0);
However, adding -spirv crashes the compiler; instead yielding no output:
> dxc -Tcs_6_3 -spirv repro.hlsl
Relevant callstack:
> [Inline Frame] dxcompiler.dll!spvtools::opt::Instruction::opcode() Line 219 C++ dxcompiler.dll!spvtools::opt::Instruction::GetBaseAddress() Line 228 C++ [Inline Frame] dxcompiler.dll!spvtools::opt::MemPass::GetPtr(unsigned int) Line 108 C++ dxcompiler.dll!spvtools::opt::MemPass::GetPtr(spvtools::opt::Instruction * ip, unsigned int * varId) Line 132 C++ dxcompiler.dll!spvtools::opt::AggressiveDCEPass::AggressiveDCE(spvtools::opt::Function * func) Line 364 C++ [Inline Frame] dxcompiler.dll!std::_Func_class<bool,spvtools::opt::Function *>::operator()(spvtools::opt::Function * <_Args_0>) Line 899 C++ dxcompiler.dll!spvtools::opt::IRContext::ProcessCallTreeFromRoots(std::function<bool __cdecl(spvtools::opt::Function *)> & pfn, std::queue<unsigned int,std::deque<unsigned int,std::allocator<unsigned int>>> * roots) Line 899 C++ dxcompiler.dll!spvtools::opt::IRContext::ProcessEntryPointCallTree(std::function<bool __cdecl(spvtools::opt::Function *)> & pfn) Line 854 C++ dxcompiler.dll!spvtools::opt::AggressiveDCEPass::ProcessImpl() Line 655 C++ dxcompiler.dll!spvtools::opt::Pass::Run(spvtools::opt::IRContext * ctx) Line 41 C++ dxcompiler.dll!spvtools::opt::PassManager::Run(spvtools::opt::IRContext * context) Line 51 C++ dxcompiler.dll!spvtools::Optimizer::Run(const unsigned int * original_binary, const unsigned __int64 original_binary_size, std::vector<unsigned int,std::allocator<unsigned int>> * optimized_binary, spv_optimizer_options_t * const opt_options) Line 576 C++ dxcompiler.dll!clang::spirv::SpirvEmitter::spirvToolsOptimize(std::vector<unsigned int,std::allocator<unsigned int>> * mod, std::string * messages) Line 11661 C++ dxcompiler.dll!clang::spirv::SpirvEmitter::HandleTranslationUnit(clang::ASTContext & context) Line 603 C++ dxcompiler.dll!clang::ParseAST(clang::Sema & S, bool PrintStats, bool SkipFunctionBodies) Line 162 C++ dxcompiler.dll!clang::ASTFrontendAction::ExecuteAction() Line 554 C++ dxcompiler.dll!clang::FrontendAction::Execute() Line 469 C++ dxcompiler.dll!DxcCompiler::Compile(const DxcBuffer * pSource, const wchar_t * * pArguments, unsigned int argCount, IDxcIncludeHandler * pIncludeHandler, const _GUID & riid, void * * ppResult) Line 736 C++ dxcompiler.dll!hlsl::DxcCompilerAdapter::WrapCompile(int bPreprocess, IDxcBlob * pSource, const wchar_t * pSourceName, const wchar_t * pEntryPoint, const wchar_t * pTargetProfile, const wchar_t * * pArguments, unsigned int argCount, const DxcDefine * pDefines, unsigned int defineCount, IDxcIncludeHandler * pIncludeHandler, IDxcOperationResult * * ppResult, wchar_t * * ppDebugBlobName, IDxcBlob * * ppDebugBlob) Line 1376 C++ dxcompiler.dll!hlsl::DxcCompilerAdapter::CompileWithDebug(IDxcBlob * pSource, const wchar_t * pSourceName, const wchar_t * pEntryPoint, const wchar_t * pTargetProfile, const wchar_t * * pArguments, unsigned int argCount, const DxcDefine * pDefines, unsigned int defineCount, IDxcIncludeHandler * pIncludeHandler, IDxcOperationResult * * ppResult, wchar_t * * ppDebugBlobName, IDxcBlob * * ppDebugBlob) Line 1282 C++ dxcompiler.dll!hlsl::DxcCompilerAdapter::Compile(IDxcBlob * pSource, const wchar_t * pSourceName, const wchar_t * pEntryPoint, const wchar_t * pTargetProfile, const wchar_t * * pArguments, unsigned int argCount, const DxcDefine * pDefines, unsigned int defineCount, IDxcIncludeHandler * pIncludeHandler, IDxcOperationResult * * ppResult) Line 72 C++ dxc.exe!DxcContext::Compile() Line 810 C++ dxc.exe!dxc::main(int argc, const wchar_t * * argv_) Line 1264 C++ [Inline Frame] dxc.exe!invoke_main() Line 90 C++ dxc.exe!__scrt_common_main_seh() Line 288 C++ kernel32.dll!00007ffb002d7bd4() Unknown ntdll.dll!00007ffb00a2ce51() Unknown
The text was updated successfully, but these errors were encountered:
Another one for @ehsannas to triage through I suppose 😊
Sorry, something went wrong.
Thanks for reporting @Jasper-Bekkers
[spirv] Handle invalid arg for residency code.
6374533
Fixes microsoft#3045
[spirv] Handle invalid arg for residency code. (#3064)
0e04763
* [spirv] Handle invalid arg for residency code. Fixes #3045 * add comments about residencyCode.
ehsannas
Successfully merging a pull request may close this issue.
Repro:
Invoking the compiler with like this outputs an error:
However, adding -spirv crashes the compiler; instead yielding no output:
Relevant callstack:
The text was updated successfully, but these errors were encountered: