This is a path specification problem, so if the correct path is given, the DLL will load correctly.
static void DumpShaderAsm(FString& String, const D3D12_SHADER_BYTECODE& Shader) { #if D3D12RHI_USE_D3DDISASSEMBLE if (Shader.pShaderBytecode) { // This function needs to load the bundled version of d3dcompiler lib explictly. Implicit linking results // in picking up the system lib by both the engine and SCWs (which links to this module), which makes // the shader compilation system-dependent. static pD3DDisassemble D3DDisasmFunc = nullptr; if (D3DDisasmFunc == nullptr) { static HMODULE CompilerDLL = NULL; // not nullptr as the return value of LoadLibrary remains defined as NULL #if 0 static const TCHAR* CompilerPath = TEXT("Binaries/ThirdParty/Windows/DirectX/x64/d3dcompiler_47.dll"); if (CompilerDLL == NULL) { CompilerDLL = LoadLibrary(CompilerPath); } #else if (CompilerDLL == NULL) { FString CompilerPath = FPaths::EngineDir(); CompilerPath.Append(TEXT("Binaries/ThirdParty/Windows/DirectX/x64/d3dcompiler_47.dll")); CompilerDLL = LoadLibrary(*CompilerPath); } #endif
// Copyright Epic Games, Inc. All Rights Reserved. #include "Common.ush" Texture2D InputTexture; SamplerState InputSampler; void ScreenPassVS( in float4 InPosition : ATTRIBUTE0, in float2 InTexCoord : ATTRIBUTE1, // out noperspective float4 OutUVAndScreenPos : TEXCOORD0, //comment out out noperspective float4 OutUVAndScreenPos : TEXCOORD2, //add this line out float4 OutPosition : SV_POSITION) { DrawRectangle(InPosition, InTexCoord, OutPosition, OutUVAndScreenPos); } ...
Result :
DumpShaderAsm fails to load d3dcompiler_47.dll. So the engine will not output disassemble code in the log
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-186891 in the post.
0 |
Component | UE - Rendering Architecture |
---|---|
Affects Versions | 5.1, 5.2 |
Target Fix | 5.3 |
Fix Commit | 25731620 |
---|---|
Main Commit | 25731704 |
Created | May 24, 2023 |
---|---|
Resolved | Jun 1, 2023 |
Updated | Aug 21, 2023 |