• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By isu diss
      How do I fill the gap between sky and terrain? Scaling the terrain or procedural terrain rendering?

    • By Jiraya
      For a 2D game, does using a float2 for position increases performance in any way?
      I know that in the end the vertex shader will have to return a float4 anyway, but does using a float2 decreases the amount of data that will have to be sent from the CPU to the GPU?
    • By ucfchuck
      I am feeding in 16 bit unsigned integer data to process in a compute shader and i need to get a standard deviation.
      So I read in a series of samples and push them into float arrays
      float vals1[9], vals2[9], vals3[9], vals4[9]; int x = 0,y=0; for ( x = 0; x < 3; x++) { for (y = 0; y < 3; y++) { vals1[3 * x + y] = (float) (asuint(Input1[threadID.xy + int2(x - 1, y - 1)].x)); vals2[3 * x + y] = (float) (asuint(Input2[threadID.xy + int2(x - 1, y - 1)].x)); vals3[3 * x + y] = (float) (asuint(Input3[threadID.xy + int2(x - 1, y - 1)].x)); vals4[3 * x + y] = (float) (asuint(Input4[threadID.xy + int2(x - 1, y - 1)].x)); } } I can send these values out directly and the data is as expected

      Output1[threadID.xy] = (uint) (vals1[4] ); Output2[threadID.xy] = (uint) (vals2[4] ); Output3[threadID.xy] = (uint) (vals3[4] ); Output4[threadID.xy] = (uint) (vals4[4] ); however if i do anything to that data it is destroyed.
      If i add a
      vals1[4] = vals1[4]/2; 
      or a
      vals1[4] = vals[1]-vals[4];
      the data is gone and everything comes back 0.
      How does one go about converting a uint to a float and performing operations on it and then converting back to a rounded uint?
    • By fs1
      I have been trying to see how the ID3DInclude, and how its methods Open and Close work.
      I would like to add a custom path for the D3DCompile function to search for some of my includes.
      I have not found any working example. Could someone point me on how to implement these functions? I would like D3DCompile to look at a custom C:\Folder path for some of the include files.
    • By stale
      I'm continuing to learn more about terrain rendering, and so far I've managed to load in a heightmap and render it as a tessellated wireframe (following Frank Luna's DX11 book). However, I'm getting some really weird behavior where a large section of the wireframe is being rendered with a yellow color, even though my pixel shader is hard coded to output white. 

      The parts of the mesh that are discolored changes as well, as pictured below (mesh is being clipped by far plane).

      Here is my pixel shader. As mentioned, I simply hard code it to output white:
      float PS(DOUT pin) : SV_Target { return float4(1.0f, 1.0f, 1.0f, 1.0f); } I'm completely lost on what could be causing this, so any help in the right direction would be greatly appreciated. If I can help by providing more information please let me know.
  • Advertisement
  • Advertisement
Sign in to follow this  

DX11 Feature level shaders...

This topic is 1315 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Was recently think of adding feature level support to my dx11 engine and was wondering if feature level 9_3 supports shader model 2_a or 2_b. I see that it doesn't support 3_0 but couldn't find info of what shader model 2_x shaders are supported. Also do I write the shaders just like shader model 5_0 as far as data sent to the shaders and just limit them to the limits from my dx9 engine (supporting 2_b and 3_0).thanks for any help in this matter would just be nice to combine both my engines if possible.

Share this post

Link to post
Share on other sites

Always read the footnotes: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876%28v=vs.85%29.aspx




Also do I write the shaders just like shader model 5_0 as far as data sent to the shaders and just limit them to the limits from my dx9 engine (supporting 2_b and 3_0).

You don't have to implement any such limiting. The DX11 API enforces the feature levels for you, so for example, if you try to set a shader that is not supported by the feature level in use, it won't set it. You can use the debug layer to check if the shader was set successfully, or if there were compatibility errors. As for the shader input data,  you'll get errors if try to use a shader-input format that doesn't match the input fromat of the compiled shader. The shader compiler will also give you errors if you use features (like data formats) that aren't compatible with the shader model specified during compilation.


If you want to support multiple feature levels, and use the shader features supported by newer shader models with the newer feature levels, you'll have to write (or use #ifdefs extensively) and copile the shaders separately, for each shader model... And if all your shaders are going to use only the shader models supported by the lowest feature level, then you can still use them with the newer feature levels, but then I think there's no point in using the higher feature levels - the higher feature levels are only useful if you actually use the new shader features.


So no, you can't just write your shaders with SM5.0 features and compile them for lower SM targets (unless you can #ifdef-out the use of the SM5.0 features).

Edited by tonemgub

Share this post

Link to post
Share on other sites

I probably didn't explain myself that well, I didn't mean use my sm_5_0 directly (as I have already compiled them all I just wanted to add a new rendering pipeline that would use the dx9 features instead).

I meant, being I have a list of shader model 2_x shaders could I just add them to the dx11 engine and run them instead, as my sm 5 shaders use mrt's but of coarse i can't do that in dx9 I just wanted to use the shaders from my older engine in my new dx 11 engine as a seperate pipeline if dx11 isn't supported and was wondering if they still needed to be in the fx shader format or the new hlsl format where vertex and pixel shaders are separate and using cBuffers etc, so compiling a seperate shader frame work is fine with me I just wondered if there was any voodoo I had to perform in porting them, as in do I write the shaders like the .fx files or the same as hlsl 5_0 with seperate vs and ps files if that makes sense. thanks for the link, I'm assuming 2_x is the equivelant to 2_a/2_b based on dx9_b and dx9_c.

Share this post

Link to post
Share on other sites

The Effects framework is no longer part of DirectX SDK (since DX10 even).


You could also still use Effects in DirectX11, as Microsoft provides it as source-code, but they also said that it will be completely removed in a future DirectX version, along with the rest of the D3DX functions (they will probably not be supported starting with DX12).


The hlsl format hasn't changed though... You just can't use Effects techniques and shader passes in your shaders anymore. You don't have to remove the techniques, because the compiler will just ignore them, but you still can't use them without the Effects framework.

You have to compile and load each shader separately now, along with setting constant buffers and sampler states (if you used to set them from hlsl before) - this would be the same as not using the Effects framework in DX9.


And sadly, you also cannot use preshaders anymore: http://msdn.microsoft.com/en-us/library/windows/desktop/bb206299%28v=vs.85%29.aspx#PreShaders_Improve_Performance so you have to be a lot more careful about what calculations you put in your shaders - if they are better done on the CPU, you have to move them out of your shaders manually now if you want to improve performance.


But I think this is exactly what you wanted (no Effects), right?


2_x refers to all of the shader model 2 shaders (2_a, 2_b etc...) except 2.0.


I also found another footnote, which may be of interest to you:

(from http://msdn.microsoft.com/en-us/library/windows/desktop/jj215820%28v=vs.85%29.aspx#direct3d_9.1__9.2__and_9.3_feature_levels)


Feature level 9.3 effectively requires hardware that complies with the requirements for legacy Direct3D 9 shader model 3.0, but this feature level does not make use of vs_3_0 or ps_3_0 targets

Edited by tonemgub

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement