diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp index b0227e468..8101ae296 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp @@ -547,10 +547,10 @@ void btSoftBodyTriangleDataDX11::generateBatches() -btDX11SoftBodySolver::btDX11SoftBodySolver(ID3D11Device * dx11Device, ID3D11DeviceContext* dx11Context) : +btDX11SoftBodySolver::btDX11SoftBodySolver(ID3D11Device * dx11Device, ID3D11DeviceContext* dx11Context, DXFunctions::CompileFromMemoryFunc dx11CompileFromMemory) : m_dx11Device( dx11Device ), m_dx11Context( dx11Context ), - dxFunctions( m_dx11Device, m_dx11Context ), + dxFunctions( m_dx11Device, m_dx11Context, dx11CompileFromMemory ), m_linkData(m_dx11Device, m_dx11Context), m_vertexData(m_dx11Device, m_dx11Context), m_triangleData(m_dx11Device, m_dx11Context), @@ -1976,7 +1976,7 @@ DXFunctions::KernelDesc DXFunctions::compileComputeShaderFromString( const char* ID3DBlob* pBlob = NULL; ID3D11ComputeShader* kernelPointer = 0; - hr = D3DX11CompileFromMemory( + hr = m_dx11CompileFromMemory( shaderString, strlen(shaderString), shaderName, diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h index f34d9f2cd..6721e35b6 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h @@ -30,12 +30,16 @@ class DXFunctions { public: + typedef HRESULT (WINAPI * CompileFromMemoryFunc)(LPCSTR,SIZE_T,LPCSTR,const D3D10_SHADER_MACRO*,LPD3D10INCLUDE,LPCSTR,LPCSTR,UINT,UINT,ID3DX11ThreadPump*,ID3D10Blob**,ID3D10Blob**,HRESULT*); + ID3D11Device * m_dx11Device; ID3D11DeviceContext* m_dx11Context; + CompileFromMemoryFunc m_dx11CompileFromMemory; - DXFunctions( ID3D11Device *dx11Device, ID3D11DeviceContext* dx11Context) : + DXFunctions(ID3D11Device *dx11Device, ID3D11DeviceContext* dx11Context, CompileFromMemoryFunc dx11CompileFromMemory) : m_dx11Device( dx11Device ), - m_dx11Context( dx11Context ) + m_dx11Context( dx11Context ), + m_dx11CompileFromMemory( dx11CompileFromMemory ) { } @@ -561,7 +565,7 @@ protected: void releaseKernels(); public: - btDX11SoftBodySolver(ID3D11Device * dx11Device, ID3D11DeviceContext* dx11Context); + btDX11SoftBodySolver(ID3D11Device * dx11Device, ID3D11DeviceContext* dx11Context, DXFunctions::CompileFromMemoryFunc dx11CompileFromMemory = &D3DX11CompileFromMemory); virtual ~btDX11SoftBodySolver(); @@ -655,8 +659,8 @@ protected: void releaseKernels(); public: - btSoftBodySolverOutputDXtoDX(ID3D11Device *dx11Device, ID3D11DeviceContext* dx11Context) : - dxFunctions( dx11Device, dx11Context ) + btSoftBodySolverOutputDXtoDX(ID3D11Device *dx11Device, ID3D11DeviceContext* dx11Context, DXFunctions::CompileFromMemoryFunc dx11CompileFromMemory = &D3DX11CompileFromMemory) : + dxFunctions( dx11Device, dx11Context, dx11CompileFromMemory ) { m_shadersInitialized = false; } diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11SIMDAware.cpp b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11SIMDAware.cpp index 71cc49cbb..8229d1a29 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11SIMDAware.cpp +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11SIMDAware.cpp @@ -173,9 +173,9 @@ bool btSoftBodyLinkDataDX11SIMDAware::moveFromAccelerator() -btDX11SIMDAwareSoftBodySolver::btDX11SIMDAwareSoftBodySolver(ID3D11Device * dx11Device, ID3D11DeviceContext* dx11Context) : - btDX11SoftBodySolver( dx11Device, dx11Context ), - m_linkData(m_dx11Device, m_dx11Context) +btDX11SIMDAwareSoftBodySolver::btDX11SIMDAwareSoftBodySolver(ID3D11Device * dx11Device, ID3D11DeviceContext* dx11Context, DXFunctions::CompileFromMemoryFunc dx11CompileFromMemory) : + btDX11SoftBodySolver( dx11Device, dx11Context, dx11CompileFromMemory ), + m_linkData(m_dx11Device, m_dx11Context) { // Initial we will clearly need to update solver constants // For now this is global for the cloths linked with this solver - we should probably make this body specific diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11SIMDAware.h b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11SIMDAware.h index 059bd44fe..554e40cef 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11SIMDAware.h +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11SIMDAware.h @@ -60,7 +60,7 @@ protected: public: - btDX11SIMDAwareSoftBodySolver(ID3D11Device * dx11Device, ID3D11DeviceContext* dx11Context); + btDX11SIMDAwareSoftBodySolver(ID3D11Device * dx11Device, ID3D11DeviceContext* dx11Context, DXFunctions::CompileFromMemoryFunc dx11CompileFromMemory = &D3DX11CompileFromMemory); virtual ~btDX11SIMDAwareSoftBodySolver();