Jump to content

Pre-Pull Request: D3D11 Initial testing


JeffR

Recommended Posts

For anyone interested the phase 2 of all this work will be here https://github.com/rextimmy/Torque3D/tree/dx11_phase2. Just be warned though, i can't guarantee it will always be stable, so treat it as experimental.


No problem @TorqueFan , it was a lot of hard work but quite a few people not just myself.

 

Thanks a lot! I shall play around with it. :mrgreen:

 

Not much has been done on that branch yet, still designing all the new constant buffer stuff which is going to take a little bit, until that goes in dx11 will lag behind dx9 on pure speed. Hopefully i finish in time for 3.9 release but if not it won't be too far behind. Having said that, dx11 is definitely in a working state though.

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Hey all,


Bringing this discussion over here from the RiftDK2 thread, since it is more related to DX11...



I just did a fresh build of a freshly created Dx11 project, using the current T3d_Development github download...


Am working in 64 bit, so I removed the .asm files from the project as usual.


Not adding in any Oculus or OpenVr support, this is just stock.


And I get these unresolved externals:


1>------ Build started: Project: Dx11Test DLL, Configuration: Release x64 ------

1>../../Link/VC2010.Release.x64/Dx11Test DLL/fileDialog.obj : warning LNK4042: object specified more than once; extras ignored

1> Creating library ../../../game/Dx11Test DLL.lib and object ../../../game/Dx11Test DLL.exp

1>gfxD3D11Device.obj : error LNK2019: unresolved external symbol CreateDXGIFactory1 referenced in function "private: virtual void __cdecl GFXD3D11Device::enumerateVideoModes(void)" (?enumerateVideoModes@GFXD3D11Device@@EEAAXXZ)

1>gfxD3D11Device.obj : error LNK2019: unresolved external symbol D3D11CreateDeviceAndSwapChain referenced in function "public: virtual void __cdecl GFXD3D11Device::init(struct GFXVideoMode const &,class PlatformWindow *)" (?init@GFXD3D11Device@@UEAAXAEBUGFXVideoMode@@PEAVPlatformWindow@@@Z)

1>gfxD3D11Device.obj : error LNK2019: unresolved external symbol D3DCompile referenced in function "public: virtual class GFXVertexDecl * __cdecl GFXD3D11Device::allocVertexDecl(class GFXVertexFormat const *)" (?allocVertexDecl@GFXD3D11Device@@UEAAPEAVGFXVertexDecl@@PEBVGFXVertexFormat@@@Z)

1>gfxD3D11Shader.obj : error LNK2001: unresolved external symbol D3DCompile

1>gfxD3D11Shader.obj : error LNK2019: unresolved external symbol D3DReflect referenced in function "protected: virtual bool __cdecl GFXD3D11Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3D_SHADER_MACRO const *,class GenericConstBufferLayout *,class Vector &)" (?_compileShader@GFXD3D11Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3D_SHADER_MACRO@@PEAVGenericConstBufferLayout@@AEAV?$Vector@UGFXShaderConstDesc@@@@@Z)

1>gfxD3D11Shader.obj : error LNK2019: unresolved external symbol D3DDisassemble referenced in function "protected: virtual bool __cdecl GFXD3D11Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3D_SHADER_MACRO const *,class GenericConstBufferLayout *,class Vector &)" (?_compileShader@GFXD3D11Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3D_SHADER_MACRO@@PEAVGenericConstBufferLayout@@AEAV?$Vector@UGFXShaderConstDesc@@@@@Z)

1>gfxD3D11Shader.obj : error LNK2019: unresolved external symbol D3DCreateBlob referenced in function "protected: virtual bool __cdecl GFXD3D11Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3D_SHADER_MACRO const *,class GenericConstBufferLayout *,class Vector &)" (?_compileShader@GFXD3D11Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3D_SHADER_MACRO@@PEAVGenericConstBufferLayout@@AEAV?$Vector@UGFXShaderConstDesc@@@@@Z)

1>gfxD3D9Shader.obj : error LNK2019: unresolved external symbol D3DXDisassembleShader referenced in function "protected: virtual bool __cdecl GFXD3D9Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3DXMACRO const *,class GenericConstBufferLayout *,class GenericConstBufferLayout *,class Vector &)" (?_compileShader@GFXD3D9Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3DXMACRO@@PEAVGenericConstBufferLayout@@3AEAV?$Vector@UGFXShaderConstDesc@@@@@Z)

1>gfxD3D9Shader.obj : error LNK2019: unresolved external symbol DXGetErrorStringA referenced in function "protected: virtual bool __cdecl GFXD3D9Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3DXMACRO const *,class GenericConstBufferLayout *,class GenericConstBufferLayout *,class Vector &)" (?_compileShader@GFXD3D9Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3DXMACRO@@PEAVGenericConstBufferLayout@@3AEAV?$Vector@UGFXShaderConstDesc@@@@@Z)

1>gfxD3D9Shader.obj : error LNK2019: unresolved external symbol DXGetErrorDescriptionA referenced in function "protected: virtual bool __cdecl GFXD3D9Shader::_compileShader(class Torque::Path const &,class String const &,struct _D3DXMACRO const *,class GenericConstBufferLayout *,class GenericConstBufferLayout *,class Vector &)" (?_compileShader@GFXD3D9Shader@@MEAA_NAEBVPath@Torque@@AEBVString@@PEBU_D3DXMACRO@@PEAVGenericConstBufferLayout@@3AEAV?$Vector@UGFXShaderConstDesc@@@@@Z)

1>gfxD3D9TextureManager.obj : error LNK2019: unresolved external symbol D3DXLoadSurfaceFromMemory referenced in function "protected: virtual bool __cdecl GFXD3D9TextureManager::_loadTexture(class GFXTextureObject *,class GBitmap *)" (?_loadTexture@GFXD3D9TextureManager@@MEAA_NPEAVGFXTextureObject@@PEAVGBitmap@@@Z)

1>gfxPCD3D9Device.obj : error LNK2019: unresolved external symbol Direct3DCreate9 referenced in function "protected: static void __cdecl GFXPCD3D9Device::createDirect3D9(struct IDirect3D9 * &,struct IDirect3D9Ex * &)" (?createDirect3D9@GFXPCD3D9Device@@KAXAEAPEAUIDirect3D9@@AEAPEAUIDirect3D9Ex@@@Z)

1>gfxPCD3D9Device.obj : error LNK2019: unresolved external symbol D3DPERF_BeginEvent referenced in function "public: virtual void __cdecl GFXPCD3D9Device::enterDebugEvent(class ColorI,char const *)" (?enterDebugEvent@GFXPCD3D9Device@@UEAAXVColorI@@PEBD@Z)

1>gfxPCD3D9Device.obj : error LNK2019: unresolved external symbol D3DPERF_EndEvent referenced in function "public: virtual void __cdecl GFXPCD3D9Device::leaveDebugEvent(void)" (?leaveDebugEvent@GFXPCD3D9Device@@UEAAXXZ)

1>gfxPCD3D9Device.obj : error LNK2019: unresolved external symbol D3DPERF_SetMarker referenced in function "public: virtual void __cdecl GFXPCD3D9Device::setDebugMarker(class ColorI,char const *)" (?setDebugMarker@GFXPCD3D9Device@@UEAAXVColorI@@PEBD@Z)

1>sfxXAudioDevice.obj : error LNK2019: unresolved external symbol __imp_X3DAudioCalculate referenced in function "public: void __cdecl SFXXAudioDevice::_setOutputMatrix(class SFXXAudioVoice *)" (?_setOutputMatrix@SFXXAudioDevice@@QEAAXPEAVSFXXAudioVoice@@@Z)

1>sfxXAudioDevice.obj : error LNK2019: unresolved external symbol __imp_X3DAudioInitialize referenced in function "public: __cdecl SFXXAudioDevice::SFXXAudioDevice(class SFXProvider *,class String const &,struct IXAudio2 *,unsigned int,unsigned int,unsigned int)" (??0SFXXAudioDevice@@QEAA@PEAVSFXProvider@@AEBVString@@PEAUIXAudio2@@III@Z)

1>../../../game/Dx11Test DLL.dll : fatal error LNK1120: 16 unresolved externals

2>------ Build started: Project: Dx11Test, Configuration: Release x64 ------

2> Dx11Test.vcxproj -> C:\Torque\Torque3D-development\My Projects\Dx11Test\buildFiles\VisualStudio 2010\projects\../../../game/Dx11Test.exe

========== Build: 1 succeeded, 1 failed, 15 up-to-date, 0 skipped ==========



Any ideas what step I may be missing?


Oh and my OS is Windows 7, video card is 2GB Radeon (older but still good). I have Dx11, dxdiag reports version 11 with no issues. Other DirectX11 games work fine. So drivers and environment should be fine for this.


Thanks again for the help, cheers

P

Link to comment
Share on other sites

If you are going to do 64bit builds i highly recommend using cmake to generate the project files for you, the project manager doesn't "officially" support 64bit and you gotta manually do some things to make it work. Sounds like something is wrong with the paths in your case and is not finding the dx11 libs it needs to link against. Can you show what paths it has?

Link to comment
Share on other sites

OK, I figured that out, typical include pathing error I had to hunt down, grr.


Anyhow, it compiles fine, and runs fine too, I can switch to DirectX11 in the video options and everything looks good.


However, when I add in my custom code which includes the Oculus/Vr support, I get this error on startup when in DX11 mode (dX9 loads fine):


Using Advanced Lighting

D3D11 ERROR: ID3D11DeviceContext::Map: Map cannot be called with MAP_WRITE_DISCARD access, because the Resource was not created with the D3D11_CPU_ACCESS_WRITE flag. [ RESOURCE_MANIPULATION ERROR #2097210: RESOURCE_MAP_INVALIDMAPTYPE]

..\..\..\..\..\Engine\source\gfx\D3D11\gfxD3D11IndexBuffer.cpp(97,0): {Fatal} - GFXD3D11PrimitiveBuffer::lock - Could not lock primitive buffer.



Any ideas on that one?


Thanks :)

Link to comment
Share on other sites

Ok glad it worked. With the error above, this will most likely be coming from some of that custom code, i'm sure james would have given me a nudge by now if that one popped up. Check the code and make sure the primitive buffer that is causing this error is not created with GFXBufferTypeStatic and than you are trying to update it, if it requires data to be changed than you must use GFXBufferTypeDynamic or GFXBufferTypeVolatile (depending on what your usage is for this buffer). DX11 is very strict on this compared to DX9

Link to comment
Share on other sites

  • 1 month later...

Hi,


Has anyone tried creating an accumulation volume in the DX 11 build? I am getting a crash with "unable to compile shader", this doesn't happen on the Dx9 build, but I can't actually see the accumulation on Dx9 either.


If anyone could confirm that accumulation works on DX 11, I will at least know if it's just my build or not. I am using the Dx11/OpenVR build.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...