d3d10core/tests: Prefer draw_color_quad() to custom pixel shader.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-07-09 13:52:19 +02:00 committed by Alexandre Julliard
parent c45b908abc
commit d165f4200d
1 changed files with 3 additions and 25 deletions

View File

@ -4279,37 +4279,18 @@ static void test_scissor(void)
D3D10_RASTERIZER_DESC rs_desc; D3D10_RASTERIZER_DESC rs_desc;
ID3D10RasterizerState *rs; ID3D10RasterizerState *rs;
D3D10_RECT scissor_rect; D3D10_RECT scissor_rect;
ID3D10PixelShader *ps;
ID3D10Device *device; ID3D10Device *device;
DWORD color; DWORD color;
HRESULT hr; HRESULT hr;
static const float red[] = {1.0f, 0.0f, 0.0f, 1.0f}; static const float red[] = {1.0f, 0.0f, 0.0f, 1.0f};
static const DWORD ps_code[] = static const struct vec4 green = {0.0f, 1.0f, 0.0f, 1.0f};
{
#if 0
float4 main(float4 position : SV_POSITION) : SV_Target
{
return float4(0.0, 1.0, 0.0, 1.0);
}
#endif
0x43425844, 0x30240e72, 0x012f250c, 0x8673c6ea, 0x392e4cec, 0x00000001, 0x000000d4, 0x00000003,
0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020,
0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49,
0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003,
0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040,
0x0000000e, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002,
0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e,
};
if (!init_test_context(&test_context)) if (!init_test_context(&test_context))
return; return;
device = test_context.device; device = test_context.device;
hr = ID3D10Device_CreatePixelShader(device, ps_code, sizeof(ps_code), &ps);
ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr);
rs_desc.FillMode = D3D10_FILL_SOLID; rs_desc.FillMode = D3D10_FILL_SOLID;
rs_desc.CullMode = D3D10_CULL_BACK; rs_desc.CullMode = D3D10_CULL_BACK;
rs_desc.FrontCounterClockwise = FALSE; rs_desc.FrontCounterClockwise = FALSE;
@ -4323,8 +4304,6 @@ static void test_scissor(void)
hr = ID3D10Device_CreateRasterizerState(device, &rs_desc, &rs); hr = ID3D10Device_CreateRasterizerState(device, &rs_desc, &rs);
ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr);
ID3D10Device_PSSetShader(device, ps);
scissor_rect.left = 160; scissor_rect.left = 160;
scissor_rect.top = 120; scissor_rect.top = 120;
scissor_rect.right = 480; scissor_rect.right = 480;
@ -4334,7 +4313,7 @@ static void test_scissor(void)
ID3D10Device_ClearRenderTargetView(device, test_context.backbuffer_rtv, red); ID3D10Device_ClearRenderTargetView(device, test_context.backbuffer_rtv, red);
check_texture_color(test_context.backbuffer, 0xff0000ff, 1); check_texture_color(test_context.backbuffer, 0xff0000ff, 1);
draw_quad(&test_context); draw_color_quad(&test_context, &green);
color = get_texture_color(test_context.backbuffer, 320, 60); color = get_texture_color(test_context.backbuffer, 320, 60);
ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color);
color = get_texture_color(test_context.backbuffer, 80, 240); color = get_texture_color(test_context.backbuffer, 80, 240);
@ -4348,7 +4327,7 @@ static void test_scissor(void)
ID3D10Device_ClearRenderTargetView(device, test_context.backbuffer_rtv, red); ID3D10Device_ClearRenderTargetView(device, test_context.backbuffer_rtv, red);
ID3D10Device_RSSetState(device, rs); ID3D10Device_RSSetState(device, rs);
draw_quad(&test_context); draw_color_quad(&test_context, &green);
color = get_texture_color(test_context.backbuffer, 320, 60); color = get_texture_color(test_context.backbuffer, 320, 60);
ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color);
color = get_texture_color(test_context.backbuffer, 80, 240); color = get_texture_color(test_context.backbuffer, 80, 240);
@ -4361,7 +4340,6 @@ static void test_scissor(void)
ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color);
ID3D10RasterizerState_Release(rs); ID3D10RasterizerState_Release(rs);
ID3D10PixelShader_Release(ps);
release_test_context(&test_context); release_test_context(&test_context);
} }