HLSL compilation shouldn't assume a 3.0 profile

TRAC #11054
Signed-off-by: Daniel Koch
Author:    Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@67 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Program.cpp b/src/libGLESv2/Program.cpp
index 3f2b143..a9f2f64 100644
--- a/src/libGLESv2/Program.cpp
+++ b/src/libGLESv2/Program.cpp
@@ -414,14 +414,17 @@
         return;
     }
 
+    IDirect3DDevice9 *device = getDevice();
+    const char *vertexProfile = D3DXGetVertexShaderProfile(device);
+    const char *pixelProfile = D3DXGetPixelShaderProfile(device);
+
     const char *pixelHLSL = mFragmentShader->linkHLSL();
     const char *vertexHLSL = mVertexShader->linkHLSL(pixelHLSL);
-    ID3DXBuffer *vertexBinary = compileToBinary(vertexHLSL, "vs_3_0", &mConstantTableVS);
-    ID3DXBuffer *pixelBinary = compileToBinary(pixelHLSL, "ps_3_0", &mConstantTablePS);
+    ID3DXBuffer *vertexBinary = compileToBinary(vertexHLSL, vertexProfile, &mConstantTableVS);
+    ID3DXBuffer *pixelBinary = compileToBinary(pixelHLSL, pixelProfile, &mConstantTablePS);
 
     if (vertexBinary && pixelBinary)
     {
-        IDirect3DDevice9 *device = getDevice();
         HRESULT vertexResult = device->CreateVertexShader((DWORD*)vertexBinary->GetBufferPointer(), &mVertexExecutable);
         HRESULT pixelResult = device->CreatePixelShader((DWORD*)pixelBinary->GetBufferPointer(), &mPixelExecutable);