6 Replies - 1246 Views - Last Post: 15 January 2013 - 01:44 PM Rate Topic: -----

#1 thedodgeruk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 23-October 11

run dx11 code on a dx10 machine?

Posted 12 January 2013 - 05:41 AM

i wrote a project using directx11 devices
 ID3D11Device* g_pd3dDevice;
 ID3D11DeviceContext* g_pd3dContext;




no shader uses tesselation code .

is there a way i can run this on a dx10 machine.

my main machine died and having to use a laptop which is dx10 , and not want to reprogram a ton of code if i not have to
Is This A Good Question/Topic? 0
  • +

Replies To: run dx11 code on a dx10 machine?

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: run dx11 code on a dx10 machine?

Posted 12 January 2013 - 07:54 AM

You will have the DX11 runtime environment on the machine you're using, so trying a downgrade to DX10 will be near impossible for a complete DX10 environment.

Why not just change the code to be DX11 compliant? It won't take that much time at all.
Was This Post Helpful? 0
  • +
  • -

#3 thedodgeruk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 23-October 11

Re: run dx11 code on a dx10 machine?

Posted 12 January 2013 - 11:28 AM

View PostButchDean, on 12 January 2013 - 07:54 AM, said:

You will have the DX11 runtime environment on the machine you're using, so trying a downgrade to DX10 will be near impossible for a complete DX10 environment.

Why not just change the code to be DX11 compliant? It won't take that much time at all.


sorry , i not know what you mean , could you explain or link me somewere that will explain it please
Was This Post Helpful? 0
  • +
  • -

#4 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: run dx11 code on a dx10 machine?

Posted 12 January 2013 - 11:55 AM

Your system has DX10 so update to DX11.

Got a bit muddled up with the versions.

This post has been edited by ButchDean: 12 January 2013 - 11:57 AM

Was This Post Helpful? 0
  • +
  • -

#5 bonyjoe  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 175
  • View blog
  • Posts: 548
  • Joined: 08-September 10

Re: run dx11 code on a dx10 machine?

Posted 12 January 2013 - 04:38 PM

I think he means his graphics card is not DX11 compatible, which would mean it can't run most new DirectX 11 features. However it should run on a DX10 card as long as you don't use any new DX11 features I believe. You may have to change your shaders to use shader level 4 instead of 5.
Was This Post Helpful? 0
  • +
  • -

#6 thedodgeruk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 23-October 11

Re: run dx11 code on a dx10 machine?

Posted 13 January 2013 - 12:06 PM

View Postbonyjoe, on 12 January 2013 - 04:38 PM, said:

I think he means his graphics card is not DX11 compatible, which would mean it can't run most new DirectX 11 features. However it should run on a DX10 card as long as you don't use any new DX11 features I believe. You may have to change your shaders to use shader level 4 instead of 5.

cheers was in the middle of doing that and not tested it yet , but good too know i not alone in thinking this :)


is there any code that can detect which directx you have on that machine so i can do
shader*;
#if (DIRECTX10)
shader =  file.Open("directx10.fx");
#endif

#if (DIRECTX11)
shader =  file.Open("directx11.fx");
#endif

Was This Post Helpful? 0
  • +
  • -

#7 bonyjoe  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 175
  • View blog
  • Posts: 548
  • Joined: 08-September 10

Re: run dx11 code on a dx10 machine?

Posted 15 January 2013 - 01:44 PM

Yes, when creating your device you can check the feature level, this is done by passing a D3D_FEATURE_LEVEL object as the 9th parameter for D3D11CreateDevice.

After the device is created you can check the feature level by comparing it to the feature level enum, so D3D_FEATURE_LEVEL_11_0 is the highest, D3D_FEATURE_LEVEL_10_0 and D3D_FEATURE_LEVEL_10_1 are the ones available for d3d 10.

Also I don't think you need to change the fx file loaded in, in each separate effect you have just include a d3d10 version of the technique, that compiles using shader level 4
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1