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

DXIL ByteAddressBuffer doesn't support float4x4 in templated load #3371

Closed
Jasper-Bekkers opened this issue Jan 20, 2021 · 1 comment · Fixed by #3469
Closed

DXIL ByteAddressBuffer doesn't support float4x4 in templated load #3371

Jasper-Bekkers opened this issue Jan 20, 2021 · 1 comment · Fixed by #3469
Assignees

Comments

@Jasper-Bekkers
Copy link

struct PSInput
{
	float4 color : COLOR;
};

ByteAddressBuffer g_stuff;

float4 PSMain(PSInput input) : SV_TARGET
{
	return mul(g_stuff.Load<float4x4>(0), input.color);
}

Output:

C:\Users\Jasper\>dxc -Tps_6_5 -EPSMain test.hlsl

C:\Users\Jasper\>echo %ERRORLEVEL%
-1073741819

However,

struct PSInput
{
	float4 color : COLOR;
};

ByteAddressBuffer g_stuff;

struct Mat4x4Wrapper {
    float4x4 internal;
};

float4 PSMain(PSInput input) : SV_TARGET
{
	return mul(g_stuff.Load<Mat4x4Wrapper>(0).internal, input.color);
}

Run the same way, does result in correct DXIL output.

@Jasper-Bekkers
Copy link
Author

Callstack:

 	dxcompiler.dll!llvm::Type::getScalarType() Line 46	C++
 	[Inline Frame] dxcompiler.dll!llvm::Type::isFPOrFPVectorTy() Line 183	C++
 	[Inline Frame] dxcompiler.dll!llvm::FPMathOperator::classof(const llvm::Instruction *) Line 317	C++
 	[Inline Frame] dxcompiler.dll!llvm::isa_impl<llvm::FPMathOperator,llvm::Instruction,void>::doit(const llvm::Instruction &) Line 56	C++
 	[Inline Frame] dxcompiler.dll!llvm::isa_impl_cl<llvm::FPMathOperator,llvm::Instruction *>::doit(const llvm::Instruction *) Line 82	C++
 	[Inline Frame] dxcompiler.dll!llvm::isa_impl_wrap<llvm::FPMathOperator,llvm::Instruction *,llvm::Instruction *>::doit(llvm::Instruction * const &) Line 122	C++
 	[Inline Frame] dxcompiler.dll!llvm::isa_impl_wrap<llvm::FPMathOperator,llvm::ilist_iterator<llvm::Instruction> const ,llvm::Instruction *>::doit(const llvm::ilist_iterator<llvm::Instruction> &) Line 112	C++
 	[Inline Frame] dxcompiler.dll!llvm::isa(const llvm::ilist_iterator<llvm::Instruction> &) Line 133	C++
 	[Inline Frame] dxcompiler.dll!llvm::dyn_cast(llvm::ilist_iterator<llvm::Instruction> &) Line 293	C++
 	dxcompiler.dll!TranslatePreciseAttributeOnFunction(llvm::Function & F, llvm::Module & M) Line 638	C++
 	dxcompiler.dll!`anonymous namespace'::DxilGenerationPass::TranslatePreciseAttribute() Line 684	C++
 	dxcompiler.dll!`anonymous namespace'::DxilGenerationPass::runOnModule(llvm::Module & M) Line 274	C++
 	dxcompiler.dll!`anonymous namespace'::MPPassManager::runOnModule(llvm::Module & M) Line 1643	C++
 	[Inline Frame] dxcompiler.dll!llvm::legacy::PassManagerImpl::run(llvm::Module &) Line 1745	C++
 	dxcompiler.dll!llvm::legacy::PassManager::run(llvm::Module & M) Line 1785	C++
 	dxcompiler.dll!`anonymous namespace'::EmitAssemblyHelper::EmitAssembly(clang::BackendAction Action, llvm::raw_pwrite_stream * OS) Line 739	C++
 	dxcompiler.dll!clang::EmitBackendOutput(clang::DiagnosticsEngine & Diags, const clang::CodeGenOptions & CGOpts, const clang::TargetOptions & TOpts, const clang::LangOptions & LOpts, llvm::StringRef TDesc, llvm::Module * M, clang::BackendAction Action, llvm::raw_pwrite_stream * OS) Line 760	C++
 	dxcompiler.dll!clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext & C) Line 195	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::CodeGenAction::ExecuteAction() Line 804	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 785	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 1418	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 1324	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 868	C++
 	dxc.exe!dxc::main(int argc, const wchar_t * * argv_) Line 1323	C++
>	[Inline Frame] dxc.exe!invoke_main() Line 90	C++
 	dxc.exe!__scrt_common_main_seh() Line 288	C++
 	kernel32.dll!00007ff9dd9353fe()	Unknown
 	ntdll.dll!00007ff9de1c590b()	Unknown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants