DirectX error: E_INVALIDARG

Hi and thanks in advance.

I’m receiving the following error during cooking for the Windows™ platform:
Flax Error - DX11 Shader

If you could let me know what I’ve done wrong, and what I can do to overcome this problem it would be much appreciated. Or even if you can point me in the right direction so I can work this out, I’m hard stuck on this error.

Please note that I don’t have an F: drive.
I suspect I don’t have the correct software installed, because I did a fresh install of Windows™ and since then I can no longer cook my projects.

I’ve tried a few fixes to no avail.
I tried -vulkan and -d3d12 args when running the editor (same error appears)
DirectX12 is installed on my PC.
The following components were installed using VS2022 installer:
Windows 10 SDK (10.0.20348.0)
Windows Universal CRT SDK
MSVC v140 - VS 2015 C++ build tools (v14.00)

The following lines from the log should be relevant:

[ 00:00:07.155 ]: [Info] Closing splash screen
[ 00:00:07.158 ]: [Info] Loading last opened scene
[ 00:00:07.161 ]: [Info] Changing editor state from FlaxEditor.States.EditingSceneState to FlaxEditor.States.ChangingScenesState
[ 00:00:07.177 ]: [Info] Loading scene…
[ 00:00:07.297 ]: [Info] Created graph for scene ‘Scene’ in 6 ms
[ 00:00:07.298 ]: [Info] Changing editor state from FlaxEditor.States.ChangingScenesState to FlaxEditor.States.EditingSceneState
[ 00:00:07.299 ]: [Info] Scene loaded in 122 ms
[ 00:00:17.267 ]: [Fatal] DirectX error: E_INVALIDARG at F:\FlaxEngine\Source\Engine\GraphicsDevice\DirectX\DX11\GPUShaderDX11.cpp:152

[ 00:00:17.267 ]: [Error] Critical error! Reason: DirectX error: E_INVALIDARG at F:\FlaxEngine\Source\Engine\GraphicsDevice\DirectX\DX11\GPUShaderDX11.cpp:152
[ 00:00:17.285 ]: [Info] Editor exit
[ 00:00:17.286 ]: [Info] Changing editor state from FlaxEditor.States.EditingSceneState to FlaxEditor.States.ClosingState
[ 00:00:17.290 ]: [Info] Select code editor null
[ 00:00:17.304 ]: [Info] Main window is closing, reason: EngineExit
[ 00:00:17.307 ]: [Info] Main window is closed


[ 00:00:17.343 ]: [Info] Unloading binary modules
[ 00:00:17.412 ]: [Info] Thread ‘File System Watchers’ ID=0x1dec exits with code 0
[ 00:00:17.448 ]: [Error] Stack trace:
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!Log::Logger::Write() in F:\FlaxEngine\Source\Engine\Core\Log.cpp:line 261
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!RenderToolsDX::ValidateD3DResult() in F:\FlaxEngine\Source\Engine\GraphicsDevice\DirectX\RenderToolsDX.h:line 261
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!GPUShaderDX11::CreateGPUShaderProgram() in F:\FlaxEngine\Source\Engine\GraphicsDevice\DirectX\DX11\GPUShaderDX11.cpp:line 155
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!GPUShader::Create() in F:\FlaxEngine\Source\Engine\Graphics\Shaders\GPUShader.cpp:line 119
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!Shader::load() in F:\FlaxEngine\Source\Engine\Content\Assets\Shader.cpp:line 45
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!BinaryAsset::loadAsset() in F:\FlaxEngine\Source\Engine\Content\BinaryAsset.cpp:line 548
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!Asset::onLoad() in F:\FlaxEngine\Source\Engine\Content\Asset.cpp:line 560
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!LoadAssetTask::run() in F:\FlaxEngine\Source\Engine\Content\Loading\Tasks\LoadAssetTask.h:line 67
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!ContentLoadTask::Run() in F:\FlaxEngine\Source\Engine\Content\Loading\ContentLoadingManager.cpp:line 226
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!Task::Execute() in F:\FlaxEngine\Source\Engine\Threading\Task.cpp:line 148
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!LoadingThread::Run() in F:\FlaxEngine\Source\Engine\Content\Loading\ContentLoadingManager.cpp:line 130
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!ThreadBase::Run() in F:\FlaxEngine\Source\Engine\Platform\Base\ThreadBase.cpp:line 94
[ 00:00:17.448 ]: [Error] at FlaxEditor.exe!Win32Thread::ThreadProc() in F:\FlaxEngine\Source\Engine\Platform\Win32\Win32Thread.cpp:line 103
[ 00:00:17.449 ]: [Error] at KERNEL32.DLL 0x7ffcccf57034
[ 00:00:17.449 ]: [Error] at ntdll.dll 0x7ffccd422651

Please note that I’m not a graphics programmer, nor am I familiar with this part of the engine. However, after a quick glance, it seems to be a geometry shader issue, possibly from a lack of the feature level support of the shader.

You said that it worked fine before you clean installed Windows. Since then, have you created any complex shaders? Are your GPU drivers up to date? Some users with Intel iGPUs experienced similar issues.

After a quick Google search, it seems that setting certain graphics settings too high can also cause the issue. Again, I’m not a graphics programmer, so I can’t give you any more help. I hope this points you in the right direction.

Sorry, I should have mentioned that I also started using Flax 1.4 when I reinstalled, and it seems to be an issue with that as I’ve just made a fresh Flax 1.3 project and I was able to cook it without the issue above.
My Flax 1.4 projects are new “Basic Scene” projects, with no custom shaders etc.

My Graphics card is a Radeon HD 7450 which is very old/weak, but it shouldn’t be an issue (I intend to only use Flax UI elements in my projects for now) as Flax 1.3 is useable.

Perhaps there are new settings or features in Flax 1.4 that are enabled by default that I need to turn off?
I’ve tried adjusting settings in Window>Graphics Quality and Project/Contect/Settings/Graphics Settings
and tried toggling support for Dirext X versions under Project/Contect/Settings/Windows Settings

The main big new graphics feature in 1.4 is real-time GI, but I believe that’s turned off by default. I hope you’re able to solve the issue.