🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

DirectXShaderCompiler

Started by
2 comments, last by advance-software 3 years, 8 months ago

Hi guys,

Grabbed new DirectX compiler artifacts build yesterday. Having difficulty getting it running. Noob with this toolchain so likely something I've yet to comprehend, rather than something wrong with it.

DxcCreateInstance is failing : Class not registered.

Tried registering
regsvr32 /i dxcompiler.dll
regsvr32 /i dxil.dll

.. but no joy as they don't expose the interface regsvr32 requires.

Unsure how to register the required classes.

Tried removing other versions of those dlls on my system to ensure the right version of the dlls are picked up.

Ouput window shows the dlls are loaded.

static dxc::DxcDllSupport support; 

void DXC_Init() 
{    
	static bool done = false;    
	if (!done)    
	{       
		support.Initialize();       
		done=true;    
	} 
} 

bool DXC_Test() 
{     
	DXC_Init();    
	ComPtr<IDxcUtils> pUtils;    
	auto hr = DxcCreateInstance(CLSID_DxcUtils, IID_PPV_ARGS(pUtils.GetAddressOf()));    	return hr == S_OK; 
} 
Advertisement

Fixed my issue initializing dxcompile thingy.

auto hr = support.m_createFn(CLSID_DxcLibrary, __uuidof(IDxcLibrary), &library);

// HRESULT hr = DxcCreateInstance(CLSID_DxcLibrary, __uuidof(IDxcLibrary), &library);

seems binding the function statically is pulling in something in my header dependancies that's old & out of date.

slight mod to dxc::DxcDllSupport support to expose the function I want got that step passing & means I know exactly what version of that function is being called. yay.

suggest DxcCreateInstance is renamed so its not possible to pull in an old wrong version by mistake.

hmm interesting…

and you are triple sure that your dlls are 32bit and u have run the 32bit version of regsvr32? @advance-software

c:\windows\sysWOW64\regsvr32.exe // if  i remember well this was the 32bit not the 64bit version  

I'm happy to stand corrected;

Until then ?

dlls are 64 bit, as is our app.

could be the issue is regsvr32 32 bit called on a 64 bit dll, I guess. the registration attempt failed.

dunno. something to bear in mind for the future, but for now I've got the binding I need the way I described above.

better that way, as other apps could register their version of the compiler leading to potential issues in ours someway down the line.

better to run a known stable version & upgrade as & when we feel its suitable.

thanks for the insight - hadn't considered that but prefer it how I have it now.

This topic is closed to new replies.

Advertisement