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

Compiling Shaders (.SC) to (.BIN) Files #518

Closed
TheGameCreators opened this Issue Sep 11, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@ghost

ghost commented Sep 11, 2015

I have been trying for a few hours now to get my .SC files to be converted to .BIN files, and tried both the direct approach (shaderc.exe from the command line) and via the makefile (GNU MAKE approach). Either way in, I am getting a rather vague error report:

bad

Hopefully someone can shed light on this very strange (and frustrating) state of affairs. Thanks!

@bkaradzic

This comment has been minimized.

Show comment
Hide comment
@bkaradzic

bkaradzic Sep 11, 2015

Owner

It seems you're hitting this:
https://github.com/bkaradzic/bgfx/blob/master/tools/shaderc/shaderc_hlsl.cpp#L282

What's your OS version? Also find your d3d11shader.h and paste here what's your IID_ID3D11ShaderReflection GUID.

Owner

bkaradzic commented Sep 11, 2015

It seems you're hitting this:
https://github.com/bkaradzic/bgfx/blob/master/tools/shaderc/shaderc_hlsl.cpp#L282

What's your OS version? Also find your d3d11shader.h and paste here what's your IID_ID3D11ShaderReflection GUID.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Sep 11, 2015

My OS version is Windows 8.1 Pro (64-bit).

The D3D11 header file I am compiling with is located at: "C:\Program Files (x86)\Windows Kits\8.1\Include\um" and the IID_ID3D11ShaderReflection:

// {6E6FFA6A-9BAE-4613-A51E-91652D508C21}
interface DECLSPEC_UUID("6E6FFA6A-9BAE-4613-A51E-91652D508C21") ID3D11ShaderReflectionType;
DEFINE_GUID(IID_ID3D11ShaderReflectionType,
0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);

I will check out the link you provided, and thanks for the super quick reply!!

ghost commented Sep 11, 2015

My OS version is Windows 8.1 Pro (64-bit).

The D3D11 header file I am compiling with is located at: "C:\Program Files (x86)\Windows Kits\8.1\Include\um" and the IID_ID3D11ShaderReflection:

// {6E6FFA6A-9BAE-4613-A51E-91652D508C21}
interface DECLSPEC_UUID("6E6FFA6A-9BAE-4613-A51E-91652D508C21") ID3D11ShaderReflectionType;
DEFINE_GUID(IID_ID3D11ShaderReflectionType,
0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);

I will check out the link you provided, and thanks for the super quick reply!!

@bkaradzic

This comment has been minimized.

Show comment
Hide comment
@bkaradzic

bkaradzic Sep 11, 2015

Owner

Try getting latest and compiling shaderc again.

Owner

bkaradzic commented Sep 11, 2015

Try getting latest and compiling shaderc again.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Sep 11, 2015

I installed the latest Windows 10 SDK but the GUIDs are identical. I did notice my system has quite a few D3DCompiler_47.dll files floating about which might play a role. Here are how my native Include and Libs are ordered:

Include:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt
C:\Program Files (x86)\Windows Kits\8.1\Include\um
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
C:\Program Files (x86)\Windows Kits\8.1\Include\winrt

Lib:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\lib
C:\Program Files (x86)\Windows Kits\10\lib\10.0.10150.0\ucrt\x86
C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Lib\um\x86

Thanks for checking this out. I also suspect a weird one-off DX issue as I previously developed DX9 with June 2011 SDK prior to my DX11 specific work, so will be building a pure DX11 dev system this weekend which should hopefully get things running normally (and allow VS 2015 Graphics Debugger to finally start working). Thanks again.

ghost commented Sep 11, 2015

I installed the latest Windows 10 SDK but the GUIDs are identical. I did notice my system has quite a few D3DCompiler_47.dll files floating about which might play a role. Here are how my native Include and Libs are ordered:

Include:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt
C:\Program Files (x86)\Windows Kits\8.1\Include\um
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
C:\Program Files (x86)\Windows Kits\8.1\Include\winrt

Lib:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\lib
C:\Program Files (x86)\Windows Kits\10\lib\10.0.10150.0\ucrt\x86
C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Lib\um\x86

Thanks for checking this out. I also suspect a weird one-off DX issue as I previously developed DX9 with June 2011 SDK prior to my DX11 specific work, so will be building a pure DX11 dev system this weekend which should hopefully get things running normally (and allow VS 2015 Graphics Debugger to finally start working). Thanks again.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Sep 14, 2015

Turns out the SHADERC project includes a line in additional LIBS called: $(DXSDK_DIR)\lib\x86 which if you had previously installed DirectX June 2010 SDK would point to D3DCompiler.lib in 'that' SDK, and thus dynamically load D3DCompiler_43.dll (June 2010) which of course means the GUID would not be found. The solution is to delete the $(DXSDK_DIR)\lib\x86 entry or redefine the DXSDK_DIR macro to point to the new DX SDK now stored in Windows Kit (which will correctly link to D3DCompiler_47.dll). Hope this helps future users!

ghost commented Sep 14, 2015

Turns out the SHADERC project includes a line in additional LIBS called: $(DXSDK_DIR)\lib\x86 which if you had previously installed DirectX June 2010 SDK would point to D3DCompiler.lib in 'that' SDK, and thus dynamically load D3DCompiler_43.dll (June 2010) which of course means the GUID would not be found. The solution is to delete the $(DXSDK_DIR)\lib\x86 entry or redefine the DXSDK_DIR macro to point to the new DX SDK now stored in Windows Kit (which will correctly link to D3DCompiler_47.dll). Hope this helps future users!

@bkaradzic

This comment has been minimized.

Show comment
Hide comment
@bkaradzic
Owner

bkaradzic commented Sep 14, 2015

That was removed: 4583769#diff-d3fa69537e4b183d0b1f5921e65a6c63

Grab latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment