Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualoldgregg

Posted 04 December 2012 - 06:48 AM

Make sure that you're definitely ending up picking the 10 feature level. You'll also need to change the shader profile argument for D3DX11CompileFromFile. It's probably "ps_5_0" / "vs_5_0" right now. Change it accordingly -- on your card you'd need to use 4 instead.


It wasn't doing this, MY GPU doesn't support Feature level11 so I needed 10/10.1:
// Set the feature level to DirectX 11.
featureLevel = D3D_FEATURE_LEVEL_10_0;
// Create the swap chain, Direct3D device, and Direct3D device context.
result = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, &featureLevel, 1,
			 D3D11_SDK_VERSION, &swapChainDesc, &m_swapChain, &m_device, NULL, &m_deviceContext); //Used for GPU
Then I needed to add a flag to my shader code 'D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY' and change it to use 'vs_4_0' :
// Compile the vertex shader code.
result = D3DX11CompileFromFile(vsFilename, NULL, NULL, "LightVertexShader", "vs_4_0", D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY, 0, NULL,
		   &vertexShaderBuffer, &errorMessage, NULL);
(Same for PS)

Sorted now, It all runs on GPU and not CPU emulation :3!


EDIT: Thanks for all your help guys!

#2oldgregg

Posted 04 December 2012 - 06:48 AM

Make sure that you're definitely ending up picking the 10 feature level. You'll also need to change the shader profile argument for D3DX11CompileFromFile. It's probably "ps_5_0" / "vs_5_0" right now. Change it accordingly -- on your card you'd need to use 4 instead.


It wasn't doing this, MY GPU doesn't support Feature level11 so I needed 10/10.1:
// Set the feature level to DirectX 11.
featureLevel = D3D_FEATURE_LEVEL_10_0;
// Create the swap chain, Direct3D device, and Direct3D device context.
result = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, &featureLevel, 1,
			 D3D11_SDK_VERSION, &swapChainDesc, &m_swapChain, &m_device, NULL, &m_deviceContext); //Used for GPU
Then I needed to add a flag to my shader code 'D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY' and change it to use 'vs_4_0' :
// Compile the vertex shader code.
result = D3DX11CompileFromFile(vsFilename, NULL, NULL, "LightVertexShader", "vs_4_0", D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY, 0, NULL,
		   &vertexShaderBuffer, &errorMessage, NULL);
(Same for PS)

Sorted now, It all runs on GPU and not CPU emulation :3!


EDIT: Thanks for all your help guys!

#1oldgregg

Posted 04 December 2012 - 06:47 AM

Make sure that you're definitely ending up picking the 10 feature level. You'll also need to change the shader profile argument for D3DX11CompileFromFile. It's probably "ps_5_0" / "vs_5_0" right now. Change it accordingly -- on your card you'd need to use 4 instead.


It wasn't doing this, MY GPU doesn't support Feature level11 so I needed 10/10.1:
// Set the feature level to DirectX 11.
featureLevel = D3D_FEATURE_LEVEL_10_0;
// Create the swap chain, Direct3D device, and Direct3D device context.
result = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, &featureLevel, 1,
			 D3D11_SDK_VERSION, &swapChainDesc, &m_swapChain, &m_device, NULL, &m_deviceContext); //Used for GPU
Then I needed to add a flag to my shader code 'D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY' and change it to use 'vs_4_0' :
// Compile the vertex shader code.
result = D3DX11CompileFromFile(vsFilename, NULL, NULL, "LightVertexShader", "vs_4_0", D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY, 0, NULL,
		   &vertexShaderBuffer, &errorMessage, NULL);
(Same for PS)

Sorted now, It all runs on GPU and not CPU emulation :3!

PARTNERS