Commit ae274b25 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3dcompiler/tests: Load d3dx9_36.dll dynamically.

Windows 7 Professional ships d3dcompiler_47 by default, but no version of d3dx9. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47894Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarMatteo Bruni <mbruni@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3b1c3e57
TESTDLL = d3dcompiler_43.dll TESTDLL = d3dcompiler_43.dll
IMPORTS = d3d9 d3dx9 user32 IMPORTS = d3d9 user32
EXTRADEFS = -DD3D_COMPILER_VERSION=43 EXTRADEFS = -DD3D_COMPILER_VERSION=43
C_SRCS = \ C_SRCS = \
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
static pD3DCompile ppD3DCompile; static pD3DCompile ppD3DCompile;
static HRESULT (WINAPI *pD3DXGetShaderConstantTable)(const DWORD *byte_code, ID3DXConstantTable **constant_table);
static D3DMATRIX *(WINAPI *pD3DXMatrixOrthoLH)(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
struct vertex struct vertex
{ {
float x, y, z; float x, y, z;
...@@ -182,7 +185,7 @@ static IDirect3DPixelShader9 *compile_pixel_shader9(IDirect3DDevice9 *device, co ...@@ -182,7 +185,7 @@ static IDirect3DPixelShader9 *compile_pixel_shader9(IDirect3DDevice9 *device, co
errors ? (char *)ID3D10Blob_GetBufferPointer(errors) : ""); errors ? (char *)ID3D10Blob_GetBufferPointer(errors) : "");
if (FAILED(hr)) return NULL; if (FAILED(hr)) return NULL;
hr = D3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(compiled), constants); hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(compiled), constants);
ok(hr == D3D_OK, "Could not get constant table from compiled pixel shader\n"); ok(hr == D3D_OK, "Could not get constant table from compiled pixel shader\n");
hr = IDirect3DDevice9_CreatePixelShader(device, ID3D10Blob_GetBufferPointer(compiled), &pshader); hr = IDirect3DDevice9_CreatePixelShader(device, ID3D10Blob_GetBufferPointer(compiled), &pshader);
...@@ -197,7 +200,7 @@ static void draw_quad_with_shader9(IDirect3DDevice9 *device, IDirect3DVertexBuff ...@@ -197,7 +200,7 @@ static void draw_quad_with_shader9(IDirect3DDevice9 *device, IDirect3DVertexBuff
HRESULT hr; HRESULT hr;
D3DXMATRIX projection_matrix; D3DXMATRIX projection_matrix;
D3DXMatrixOrthoLH(&projection_matrix, 2.0f, 2.0f, 0.0f, 1.0f); pD3DXMatrixOrthoLH(&projection_matrix, 2.0f, 2.0f, 0.0f, 1.0f);
IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &projection_matrix); IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &projection_matrix);
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
...@@ -641,6 +644,7 @@ START_TEST(hlsl) ...@@ -641,6 +644,7 @@ START_TEST(hlsl)
IDirect3DVertexDeclaration9 *vdeclaration; IDirect3DVertexDeclaration9 *vdeclaration;
IDirect3DVertexBuffer9 *quad_geometry; IDirect3DVertexBuffer9 *quad_geometry;
IDirect3DVertexShader9 *vshader_passthru; IDirect3DVertexShader9 *vshader_passthru;
HMODULE mod;
if (!load_d3dcompiler()) if (!load_d3dcompiler())
{ {
...@@ -648,6 +652,14 @@ START_TEST(hlsl) ...@@ -648,6 +652,14 @@ START_TEST(hlsl)
return; return;
} }
if (!(mod = LoadLibraryA("d3dx9_36.dll")))
{
win_skip("Failed to load d3dx9_36.dll.\n");
return;
}
pD3DXGetShaderConstantTable = (void *)GetProcAddress(mod, "D3DXGetShaderConstantTable");
pD3DXMatrixOrthoLH = (void *)GetProcAddress(mod, "D3DXMatrixOrthoLH");
device = init_d3d9(&vdeclaration, &quad_geometry, &vshader_passthru); device = init_d3d9(&vdeclaration, &quad_geometry, &vshader_passthru);
if (!device) return; if (!device) return;
......
TESTDLL = d3dcompiler_47.dll TESTDLL = d3dcompiler_47.dll
IMPORTS = d3d9 d3dx9 user32 IMPORTS = d3d9 user32
EXTRADEFS = -DD3D_COMPILER_VERSION=47 EXTRADEFS = -DD3D_COMPILER_VERSION=47
PARENTSRC = ../../d3dcompiler_43/tests PARENTSRC = ../../d3dcompiler_43/tests
......
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