Pixel Shader Profile Question

Started by
1 comment, last by Sagito 16 years, 2 months ago
Hi... I'm trying to use pixel shading for the first time in my graphical engine (learning as I go...) To compile a shader, I use the D3DXGetPixelShaderProfile function to get the highest HLSL profile that my device can use (a HAL Device). In my old laptop, that function returns NULL, what means that my device does not support HLSL (correct?). But, if I force the compiler to use "ps_1_1" for example (did not try further versions), it will render correctly, although very slowly. So, what is happening here? Is the device falling back to REF or something? Maybe this is just an idiot question, but it left me very curious about this... Thanks in advance...
http://sagito.wordpress.com
Advertisement
The documentation says exactly that - "If the device does not support pixel shaders then the function returns NULL."

I don't see how it can render anything that's pixel shaded unless it's using REF, but non shaded things will obviously still render (and vertex shaders can always be done in software on any device).

I did a very simple test code for the pixel shading which draws a sphere created with D3DXCreateSphere, with a texture and nothing else is rendered... The device is specified as HAL in CreateDevice (I think I've never used REF, to be quite honest). Also, no vertex shaders were specified (they are present in the engine, but are never applied in this sample). Can the device be turning himself to REF to try to "survive" and not crash or something? =X
http://sagito.wordpress.com

This topic is closed to new replies.

Advertisement