tests: Fix compiler warnings in various tests.
Mostly related to casting vec4 struct to float where array[4] is expected. Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
parent
ce5df40f01
commit
010db2bb7b
|
@ -141,7 +141,7 @@ void test_clear_depth_stencil_view(void)
|
|||
void test_clear_render_target_view(void)
|
||||
{
|
||||
static const unsigned int array_expected_colors[] = {0xff00ff00, 0xff0000ff, 0xffff0000};
|
||||
static const struct vec4 array_colors[] =
|
||||
static const float array_colors[][4] =
|
||||
{
|
||||
{0.0f, 1.0f, 0.0f, 1.0f},
|
||||
{1.0f, 0.0f, 0.0f, 1.0f},
|
||||
|
@ -325,7 +325,7 @@ void test_clear_render_target_view(void)
|
|||
|
||||
ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, &array_colors[i].x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, array_colors[i], 0, NULL);
|
||||
}
|
||||
|
||||
transition_resource_state(command_list, resource,
|
||||
|
@ -356,7 +356,7 @@ void test_clear_render_target_view(void)
|
|||
|
||||
ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, &array_colors[i].x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, array_colors[i], 0, NULL);
|
||||
}
|
||||
|
||||
transition_resource_state(command_list, resource,
|
||||
|
|
|
@ -554,9 +554,9 @@ void test_copy_texture_buffer(void)
|
|||
|
||||
void test_copy_buffer_to_depth_stencil(void)
|
||||
{
|
||||
ID3D12Resource *src_buffer_stencil = NULL;
|
||||
ID3D12GraphicsCommandList *command_list;
|
||||
struct resource_readback rb_stencil;
|
||||
ID3D12Resource *src_buffer_stencil;
|
||||
struct resource_readback rb_depth;
|
||||
ID3D12Resource *src_buffer_depth;
|
||||
struct test_context_desc desc;
|
||||
|
|
|
@ -1509,7 +1509,7 @@ static void test_raytracing_pipeline(enum rt_test_mode mode, D3D12_RAYTRACING_TI
|
|||
#define INSTANCE_GEOM_SCALE (0.5f)
|
||||
|
||||
D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC postbuild_desc[3];
|
||||
float sbt_colors[NUM_GEOM_DESC * NUM_UNMASKED_INSTANCES + 1][2];
|
||||
float sbt_colors[NUM_GEOM_DESC * NUM_UNMASKED_INSTANCES + 1][2] = {{0}};
|
||||
D3D12_ROOT_SIGNATURE_DESC root_signature_desc;
|
||||
D3D12_DESCRIPTOR_RANGE descriptor_ranges[2];
|
||||
ID3D12GraphicsCommandList4 *command_list4;
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
void test_unbound_rtv_rendering(void)
|
||||
{
|
||||
static const struct vec4 white = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
static const struct vec4 red = { 1.0f, 0.0f, 0.0f, 1.0f };
|
||||
static const float white[] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc;
|
||||
ID3D12GraphicsCommandList *command_list;
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rt_handle;
|
||||
|
@ -91,8 +91,8 @@ void test_unbound_rtv_rendering(void)
|
|||
&IID_ID3D12PipelineState, (void **)&context.pipeline_state);
|
||||
ok(hr == S_OK, "Failed to create state, hr %#x.\n", hr);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rt_handle, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rt_handle, white, 0, NULL);
|
||||
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
|
||||
ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state);
|
||||
ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
|
||||
|
@ -120,7 +120,8 @@ void test_unbound_rtv_rendering(void)
|
|||
|
||||
void test_unknown_rtv_format(void)
|
||||
{
|
||||
static const struct vec4 white = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
static const struct vec4 vec4_white = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
struct vec4 expected_vec4 = {0.0f, 0.0f, 0.0f, 1.0f};
|
||||
D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc;
|
||||
ID3D12GraphicsCommandList *command_list;
|
||||
|
@ -185,7 +186,7 @@ void test_unknown_rtv_format(void)
|
|||
create_render_target(&context, &desc, &render_targets[1], &rtvs[2]);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(rtvs); ++i)
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtvs[i], &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtvs[i], white, 0, NULL);
|
||||
|
||||
/* NULL RTV */
|
||||
memset(&rtv_desc, 0, sizeof(rtv_desc));
|
||||
|
@ -212,7 +213,7 @@ void test_unknown_rtv_format(void)
|
|||
transition_resource_state(command_list, render_targets[1],
|
||||
D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||
|
||||
check_sub_resource_vec4(context.render_target, 0, queue, command_list, &white, 0);
|
||||
check_sub_resource_vec4(context.render_target, 0, queue, command_list, &vec4_white, 0);
|
||||
reset_command_list(command_list, context.allocator);
|
||||
expected_vec4.x = 2.0f;
|
||||
check_sub_resource_vec4(render_targets[0], 0, queue, command_list, &expected_vec4, 0);
|
||||
|
|
|
@ -5134,7 +5134,7 @@ void test_gather(void)
|
|||
{0.3f, 1.3f, 1.2f, 0.2f}, {1.3f, 2.3f, 2.2f, 1.2f}, {2.3f, 3.3f, 3.2f, 2.2f}, {3.3f, 3.3f, 3.2f, 3.2f},
|
||||
{0.3f, 1.3f, 1.3f, 0.3f}, {1.3f, 2.3f, 2.3f, 1.3f}, {2.3f, 3.3f, 3.3f, 2.3f}, {3.3f, 3.3f, 3.3f, 3.3f},
|
||||
};
|
||||
static const struct vec4 white = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
static const D3D12_SUBRESOURCE_DATA resource_data = {&texture_data, sizeof(texture_data) / 4};
|
||||
|
||||
memset(&desc, 0, sizeof(desc));
|
||||
|
@ -5171,7 +5171,7 @@ void test_gather(void)
|
|||
context.pipeline_state = create_pipeline_state(context.device,
|
||||
context.root_signature, desc.rt_format, NULL, &ps_gather4, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
|
||||
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
|
||||
|
@ -5209,7 +5209,7 @@ void test_gather(void)
|
|||
context.pipeline_state = create_pipeline_state(context.device,
|
||||
context.root_signature, desc.rt_format, NULL, &ps_gather4_offset, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
|
||||
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
|
||||
|
@ -5247,7 +5247,7 @@ void test_gather(void)
|
|||
context.pipeline_state = create_pipeline_state(context.device,
|
||||
context.root_signature, desc.rt_format, NULL, &ps_gather4_green, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
|
||||
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
|
||||
|
@ -5285,7 +5285,7 @@ void test_gather(void)
|
|||
context.pipeline_state = create_pipeline_state(context.device,
|
||||
context.root_signature, desc.rt_format, NULL, &ps_gather4_po, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
|
||||
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
|
||||
|
@ -5321,7 +5321,7 @@ void test_gather(void)
|
|||
constants.offset_x = 0;
|
||||
constants.offset_y = 0;
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
|
||||
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
|
||||
|
@ -5455,7 +5455,7 @@ void test_gather_c(void)
|
|||
{0.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 1.0f, 0.0f}, {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{0.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 1.0f, 0.0f}, {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f},
|
||||
};
|
||||
static const struct vec4 white = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
static const D3D12_SUBRESOURCE_DATA resource_data = {&texture_data, sizeof(texture_data) / 4};
|
||||
static const D3D12_STATIC_SAMPLER_DESC sampler_desc =
|
||||
{
|
||||
|
@ -5511,7 +5511,7 @@ void test_gather_c(void)
|
|||
context.pipeline_state = create_pipeline_state(context.device,
|
||||
context.root_signature, desc.rt_format, NULL, &ps_gather4_c, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
|
||||
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
|
||||
|
@ -5549,7 +5549,7 @@ void test_gather_c(void)
|
|||
context.pipeline_state = create_pipeline_state(context.device,
|
||||
context.root_signature, desc.rt_format, NULL, &ps_gather4_po_c, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
|
||||
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
|
||||
|
@ -5585,7 +5585,7 @@ void test_gather_c(void)
|
|||
constants.offset_x = 0;
|
||||
constants.offset_y = 0;
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
|
||||
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
|
||||
|
@ -6281,7 +6281,7 @@ void test_multisample_array_texture(void)
|
|||
};
|
||||
static const D3D12_SHADER_BYTECODE ps = {ps_code, sizeof(ps_code)};
|
||||
static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
static const struct vec4 colors[] =
|
||||
static const float colors[][4] =
|
||||
{
|
||||
{1.0f, 0.0f, 0.0f, 1.0f},
|
||||
{0.0f, 1.0f, 0.0f, 1.0f},
|
||||
|
@ -6387,7 +6387,7 @@ void test_multisample_array_texture(void)
|
|||
rtv_desc.Texture2DMSArray.ArraySize = 1;
|
||||
ID3D12Device_CreateRenderTargetView(device, texture, &rtv_desc, cpu_handle);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, cpu_handle, &colors[i].x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, cpu_handle, colors[i], 0, NULL);
|
||||
}
|
||||
|
||||
transition_resource_state(command_list, texture,
|
||||
|
|
|
@ -2131,8 +2131,8 @@ void test_sv_barycentric(void)
|
|||
#define BARY_RES 128
|
||||
|
||||
static const D3D12_VIEWPORT vp = { 0, 0, BARY_RES, BARY_RES, 0, 1 };
|
||||
static const float white[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
static const D3D12_RECT sci = { 0, 0, BARY_RES, BARY_RES };
|
||||
static const float white[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
static const uint8_t provoking_lut[] = {
|
||||
192, 212, 224, 244,
|
||||
128, 144, 160, 176,
|
||||
|
@ -4834,7 +4834,7 @@ void test_shader_sm66_is_helper_lane(void)
|
|||
{
|
||||
/* Oh, hi there. */
|
||||
static const float alpha_keys[4] = { 0.75f, 2.25f, 3.25f, 3.75f };
|
||||
static const struct vec4 white = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
static const float white[] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
||||
D3D12_FEATURE_DATA_SHADER_MODEL shader_model;
|
||||
D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc;
|
||||
D3D12_UNORDERED_ACCESS_VIEW_DESC uav_desc;
|
||||
|
@ -5041,7 +5041,7 @@ void test_shader_sm66_is_helper_lane(void)
|
|||
ID3D12Device_CreateUnorderedAccessView(context.device, atomic_buffer, NULL, &uav_desc, cpu_handle);
|
||||
|
||||
ID3D12GraphicsCommandList_SetDescriptorHeaps(command_list, 1, &heap);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
|
||||
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
|
||||
ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state);
|
||||
|
@ -5088,7 +5088,7 @@ void test_shader_sm66_is_helper_lane(void)
|
|||
expected.w = 8881.0f;
|
||||
}
|
||||
else
|
||||
expected = white;
|
||||
memcpy(&expected, white, sizeof(white));
|
||||
|
||||
ok(compare_vec4(value, &expected, 0), "Mismatch pixel %u, %u, (%f %f %f %f) != (%f %f %f %f).\n",
|
||||
x, y, expected.x, expected.y, expected.z, expected.w,
|
||||
|
|
Loading…
Reference in New Issue