Commit dba338f2 authored by Alexandre Julliard's avatar Alexandre Julliard

d3d9/tests: Don't test texture states beyond the supported maximum.

parent 5db5744c
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
static HMODULE d3d9_handle = 0; static HMODULE d3d9_handle = 0;
static DWORD texture_stages;
static HWND create_window(void) static HWND create_window(void)
{ {
WNDCLASS wc = {0}; WNDCLASS wc = {0};
...@@ -761,7 +763,7 @@ static void transform_set_handler( ...@@ -761,7 +763,7 @@ static void transform_set_handler(
hret = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &tdata->texture0); hret = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &tdata->texture0);
ok(hret == D3D_OK, "SetTransform returned %#lx.\n", hret); ok(hret == D3D_OK, "SetTransform returned %#lx.\n", hret);
hret = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE7, &tdata->texture7); hret = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0 + texture_stages - 1, &tdata->texture7);
ok(hret == D3D_OK, "SetTransform returned %#lx.\n", hret); ok(hret == D3D_OK, "SetTransform returned %#lx.\n", hret);
hret = IDirect3DDevice9_SetTransform(device, D3DTS_WORLD, &tdata->world0); hret = IDirect3DDevice9_SetTransform(device, D3DTS_WORLD, &tdata->world0);
...@@ -786,7 +788,7 @@ static void transform_get_handler( ...@@ -786,7 +788,7 @@ static void transform_get_handler(
hret = IDirect3DDevice9_GetTransform(device, D3DTS_TEXTURE0, &tdata->texture0); hret = IDirect3DDevice9_GetTransform(device, D3DTS_TEXTURE0, &tdata->texture0);
ok(hret == D3D_OK, "GetTransform returned %#lx.\n", hret); ok(hret == D3D_OK, "GetTransform returned %#lx.\n", hret);
hret = IDirect3DDevice9_GetTransform(device, D3DTS_TEXTURE7, &tdata->texture7); hret = IDirect3DDevice9_GetTransform(device, D3DTS_TEXTURE0 + texture_stages - 1, &tdata->texture7);
ok(hret == D3D_OK, "GetTransform returned %#lx.\n", hret); ok(hret == D3D_OK, "GetTransform returned %#lx.\n", hret);
hret = IDirect3DDevice9_GetTransform(device, D3DTS_WORLD, &tdata->world0); hret = IDirect3DDevice9_GetTransform(device, D3DTS_WORLD, &tdata->world0);
...@@ -1317,6 +1319,8 @@ static void test_state_management( ...@@ -1317,6 +1319,8 @@ static void test_state_management(
ok(hret == D3D_OK, "GetDeviceCaps returned %#lx.\n", hret); ok(hret == D3D_OK, "GetDeviceCaps returned %#lx.\n", hret);
if (hret != D3D_OK) return; if (hret != D3D_OK) return;
texture_stages = caps.MaxTextureBlendStages;
if (caps.VertexShaderVersion & 0xffff) { if (caps.VertexShaderVersion & 0xffff) {
shader_constants_queue_test(device, &tests[tcount], &buffer[bcount], FALSE); shader_constants_queue_test(device, &tests[tcount], &buffer[bcount], FALSE);
bcount += SHADER_CONSTANTS_REQ_BUFFER; bcount += SHADER_CONSTANTS_REQ_BUFFER;
......
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