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
parent d37dec85
...@@ -414,14 +414,17 @@ void Program::link() ...@@ -414,14 +414,17 @@ void Program::link()
return; return;
} }
IDirect3DDevice9 *device = getDevice();
const char *vertexProfile = D3DXGetVertexShaderProfile(device);
const char *pixelProfile = D3DXGetPixelShaderProfile(device);
const char *pixelHLSL = mFragmentShader->linkHLSL(); const char *pixelHLSL = mFragmentShader->linkHLSL();
const char *vertexHLSL = mVertexShader->linkHLSL(pixelHLSL); const char *vertexHLSL = mVertexShader->linkHLSL(pixelHLSL);
ID3DXBuffer *vertexBinary = compileToBinary(vertexHLSL, "vs_3_0", &mConstantTableVS); ID3DXBuffer *vertexBinary = compileToBinary(vertexHLSL, vertexProfile, &mConstantTableVS);
ID3DXBuffer *pixelBinary = compileToBinary(pixelHLSL, "ps_3_0", &mConstantTablePS); ID3DXBuffer *pixelBinary = compileToBinary(pixelHLSL, pixelProfile, &mConstantTablePS);
if (vertexBinary && pixelBinary) if (vertexBinary && pixelBinary)
{ {
IDirect3DDevice9 *device = getDevice();
HRESULT vertexResult = device->CreateVertexShader((DWORD*)vertexBinary->GetBufferPointer(), &mVertexExecutable); HRESULT vertexResult = device->CreateVertexShader((DWORD*)vertexBinary->GetBufferPointer(), &mVertexExecutable);
HRESULT pixelResult = device->CreatePixelShader((DWORD*)pixelBinary->GetBufferPointer(), &mPixelExecutable); HRESULT pixelResult = device->CreatePixelShader((DWORD*)pixelBinary->GetBufferPointer(), &mPixelExecutable);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment