Could someone explain me why tex2Dlod doesn’t work with d3d11/10 shaders? I need for it, and I can’t find any other useful function.
PLEASE HELP ME!!!
Could someone explain me why tex2Dlod doesn’t work with d3d11/10 shaders? I need for it, and I can’t find any other useful function.
PLEASE HELP ME!!!
d3d11_9x profile is for Windows RT (ARM hardware, not x86). So, while it is inconvenient that it won’t compile to that profile, it’s perhaps not a problem at all if you only need it to work for regular Windows machines.
To get it to compile without warnings for the other platforms, you could ignore the d3d11_9x profile with something like
#if !defined(SHADER_API_OPENGL) !defined(SHADER_API_D3D11_9X)
return tex2Dlod (tex, uv);
#else
OpenGL requires special attention too, so perhaps there is a way to compile tex2Dlod successfully for Windows RT.
so I can’t use tex2Dlod anyways in SM4/5 ?
Do I have to exclude the d3d11 renderers from my shader and then force compilation for only SM3?
directx 11 has a feature level (as they call it) so while the DirectX version might be 11.1 the current system might only support feature level 9.3 in which case your shaders will not work on that device. (As far as i know 9.3 only supports SM3 i am most likely wrong though) write a quick directx 11 app to print out your device info and supported feature levels. if your targeting windows store i believe you have to get it to work in feature level 9.3 though.
No you don’t have to do that, only the profile used when compiling for Windows RT throws the warning. You CAN use it with the ‘regular’ DX11 profile (SHADER_API_D3D11).
musikit is almost completely right. From this page: “Support for Direct3D feature level 9_1 is required for DirectX Windows Store apps that publish an ARM package.”. So if I’m reading the table on this page correctly, that means you need to support Shader Model 2, if you want to publish an application written for Windows RT, to the Windows Store.
Unfortunately, tex2Dlod is not supported by Shader Model 2.
well, I have dx11 on my computer and it can support sm5. The only problem is that when I run unity with dx11 and I compile my shader to #pragma target 4.0 or 5.0 it works, but it seems as if it doesn’t use properly tex2Dlod, which I use to compute parallax effects over my terrain
What do you mean with ‘doesn’t use tex2Dlod properly’?
Keep in mind that you’ll usually get the warnings and errors for all platforms, not just the ones for your own system (the warning ‘no subshader can run on this graphics card’ is an exception to that, of course).