d3d10core/tests: Simplify test_cb_relative_addressing() a bit.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2019-02-12 18:26:00 +01:00 committed by Alexandre Julliard
parent 9844d73b66
commit 2d46fb2476
1 changed files with 3 additions and 11 deletions

View File

@ -1389,6 +1389,9 @@ static void draw_quad_vs_(unsigned int line, struct d3d10core_test_context *cont
ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr);
}
if (!context->vb)
context->vb = create_buffer(device, D3D10_BIND_VERTEX_BUFFER, sizeof(quad), quad);
if (context->vs_code != vs_code)
{
if (context->vs)
@ -1400,9 +1403,6 @@ static void draw_quad_vs_(unsigned int line, struct d3d10core_test_context *cont
context->vs_code = vs_code;
}
if (!context->vb)
context->vb = create_buffer(device, D3D10_BIND_VERTEX_BUFFER, sizeof(quad), quad);
ID3D10Device_IASetInputLayout(context->device, context->input_layout);
ID3D10Device_IASetPrimitiveTopology(context->device, D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
stride = sizeof(*quad);
@ -10338,10 +10338,6 @@ static void test_cb_relative_addressing(void)
DWORD color;
HRESULT hr;
static const D3D10_INPUT_ELEMENT_DESC layout_desc[] =
{
{"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0},
};
static const DWORD vs_code[] =
{
#if 0
@ -10451,10 +10447,6 @@ float4 main(const ps_in v) : SV_TARGET
device = test_context.device;
hr = ID3D10Device_CreateInputLayout(device, layout_desc, ARRAY_SIZE(layout_desc),
vs_code, sizeof(vs_code), &test_context.input_layout);
ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr);
colors_cb = create_buffer(device, D3D10_BIND_CONSTANT_BUFFER, sizeof(colors), &colors);
index_cb = create_buffer(device, D3D10_BIND_CONSTANT_BUFFER, sizeof(index), NULL);