Skip to content

Commit 6a8698f

Browse files
committed
fix ci
1 parent 28f32e4 commit 6a8698f

4 files changed

Lines changed: 46 additions & 29 deletions

File tree

benchmarks/soc_bench.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,8 +1096,6 @@ static int allocate_queries(workload* work)
10961096
? 0.05f
10971097
: (definition->large_queries ? 0.04f : 0.01f);
10981098
float center_z = case_occluded_depth(definition);
1099-
float minimum_z;
1100-
float maximum_z;
11011099

11021100
if (definition->query_pattern == QUERY_VISIBLE) {
11031101
center_z = case_visible_depth(definition);
@@ -1117,16 +1115,12 @@ static int allocate_queries(workload* work)
11171115
center_z = 1.0f;
11181116
half_depth = 0.10f;
11191117
} else {
1120-
minimum_z = 0.95f;
1121-
maximum_z = 1.05f;
1122-
}
1123-
if (perspective != SOC_TRUE) {
11241118
work->bounds[index].min.x = x - radius;
11251119
work->bounds[index].min.y = y - radius;
1126-
work->bounds[index].min.z = minimum_z;
1120+
work->bounds[index].min.z = 0.95f;
11271121
work->bounds[index].max.x = x + radius;
11281122
work->bounds[index].max.y = y + radius;
1129-
work->bounds[index].max.z = maximum_z;
1123+
work->bounds[index].max.z = 1.05f;
11301124
continue;
11311125
}
11321126
}
@@ -1136,14 +1130,12 @@ static int allocate_queries(workload* work)
11361130
y *= center_z;
11371131
radius *= center_z;
11381132
}
1139-
minimum_z = center_z - half_depth;
1140-
maximum_z = center_z + half_depth;
11411133
work->bounds[index].min.x = x - radius;
11421134
work->bounds[index].min.y = y - radius;
1143-
work->bounds[index].min.z = minimum_z;
1135+
work->bounds[index].min.z = center_z - half_depth;
11441136
work->bounds[index].max.x = x + radius;
11451137
work->bounds[index].max.y = y + radius;
1146-
work->bounds[index].max.z = maximum_z;
1138+
work->bounds[index].max.z = center_z + half_depth;
11471139
}
11481140
return 0;
11491141
}

benchmarks/soc_kernel_bench.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ static uint64_t checksum_f32(const float* values, size_t count)
474474
}
475475

476476
static uint64_t checksum_transform_outputs(
477-
const soc_kernel_clip_vertex outputs[TRANSFORM_POSITION_SET_COUNT][3],
477+
soc_kernel_clip_vertex outputs[TRANSFORM_POSITION_SET_COUNT][3],
478478
const soc_kernel_clip_metadata metadata[TRANSFORM_POSITION_SET_COUNT]
479479
)
480480
{
@@ -1431,8 +1431,15 @@ static int run_transform_case(
14311431
int success = 0;
14321432
const transform_triangle_fn scalar_transform =
14331433
soc_kernel_transform_triangle_f32_scalar;
1434+
#if defined(__aarch64__) || defined(_M_ARM64) || \
1435+
((defined(__arm__) || defined(_M_ARM)) && \
1436+
defined(SOC_BUILD_AARCH32_NEON_FMA))
14341437
const transform_triangle_fn neon_transform =
14351438
soc_kernel_transform_triangle_f32_neon;
1439+
#else
1440+
const transform_triangle_fn neon_transform =
1441+
soc_kernel_transform_triangle_f32_scalar;
1442+
#endif
14361443

14371444
initialize_transform_workload(&scalar_workload);
14381445
initialize_transform_workload(&neon_workload);

tests/test_hiz.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,11 @@ static int test_masked_layout_clear_and_build(void)
472472
};
473473
const float level_two[] = {0.10f};
474474
soc_projected_aabb projected = {
475-
.minimum_ndc_x = 0.10,
476-
.maximum_ndc_x = 0.40,
477-
.minimum_ndc_y = -0.40,
478-
.maximum_ndc_y = -0.20,
479-
.nearest_depth = 0.50,
475+
.minimum_ndc_x = 0.10f,
476+
.maximum_ndc_x = 0.40f,
477+
.minimum_ndc_y = -0.40f,
478+
.maximum_ndc_y = -0.20f,
479+
.nearest_depth = 0.50f,
480480
};
481481
soc_hiz hiz = {0};
482482
size_t index;
@@ -505,7 +505,7 @@ static int test_masked_layout_clear_and_build(void)
505505
soc_test_projected_aabb_scalar(&hiz, &projected) ==
506506
SOC_VISIBILITY_OCCLUDED
507507
);
508-
projected.minimum_ndc_x = -0.20;
508+
projected.minimum_ndc_x = -0.20f;
509509
CHECK(
510510
soc_test_projected_aabb_scalar(&hiz, &projected) ==
511511
SOC_VISIBILITY_VISIBLE
@@ -659,8 +659,14 @@ static int test_split_band_build_matches_serial(void)
659659
};
660660
size_t shape_index;
661661

662-
CHECK(SOC_HIZ_LOWER_BAND_HEIGHT == 16u);
663-
CHECK(SOC_HIZ_LOWER_LEVEL_COUNT == 4u);
662+
_Static_assert(
663+
SOC_HIZ_LOWER_BAND_HEIGHT == 16u,
664+
"unexpected lower Hi-Z band height"
665+
);
666+
_Static_assert(
667+
SOC_HIZ_LOWER_LEVEL_COUNT == 4u,
668+
"unexpected lower Hi-Z level count"
669+
);
664670
for (shape_index = 0u;
665671
shape_index < ARRAY_COUNT(shapes);
666672
++shape_index) {

tests/test_rasterizer.c

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,15 @@ static int test_compact_prepared_edges_are_integer_exact(void)
573573
uint32_t random_state = UINT32_C(0x91e10da5);
574574
size_t edge_index;
575575

576-
CHECK(sizeof(soc_raster_prepared_edge) == 24u);
577-
CHECK(sizeof(soc_raster_prepared_triangle) == 108u ||
578-
sizeof(soc_raster_prepared_triangle) == 112u);
576+
_Static_assert(
577+
sizeof(soc_raster_prepared_edge) == 24u,
578+
"unexpected prepared edge size"
579+
);
580+
_Static_assert(
581+
sizeof(soc_raster_prepared_triangle) == 108u ||
582+
sizeof(soc_raster_prepared_triangle) == 112u,
583+
"unexpected prepared triangle size"
584+
);
579585
for (edge_index = 0u;
580586
edge_index < ARRAY_COUNT(boundary_edges);
581587
++edge_index) {
@@ -815,7 +821,7 @@ static int test_q8_snapped_coverage_and_depth_match_f32_math(void)
815821
{
816822
const double point_x = (double)x + 0.5;
817823
const double point_y = (double)y + 0.5;
818-
const double area = continuous_edge_value(
824+
const double triangle_area = continuous_edge_value(
819825
&reconstructed[0],
820826
&reconstructed[1],
821827
reconstructed[2].x,
@@ -843,7 +849,7 @@ static int test_q8_snapped_coverage_and_depth_match_f32_math(void)
843849
(float)weight0 * reconstructed[0].depth +
844850
(float)weight1 * reconstructed[1].depth +
845851
(float)weight2 * reconstructed[2].depth
846-
) / (float)area;
852+
) / (float)triangle_area;
847853

848854
CHECK(stored_depth >= 0.0f);
849855
CHECK(stored_depth <= 1.0f);
@@ -2111,9 +2117,15 @@ static int test_prepared_list_and_invalid_state_semantics(void)
21112117
uint64_t clipped_count;
21122118
uint64_t rasterized_count;
21132119

2114-
CHECK(sizeof(soc_raster_prepared_edge) == 24u);
2115-
CHECK(sizeof(soc_raster_prepared_triangle) == 108u ||
2116-
sizeof(soc_raster_prepared_triangle) == 112u);
2120+
_Static_assert(
2121+
sizeof(soc_raster_prepared_edge) == 24u,
2122+
"unexpected prepared edge size"
2123+
);
2124+
_Static_assert(
2125+
sizeof(soc_raster_prepared_triangle) == 108u ||
2126+
sizeof(soc_raster_prepared_triangle) == 112u,
2127+
"unexpected prepared triangle size"
2128+
);
21172129
CHECK(soc_raster_prepared_list_reserve(NULL, 1u) ==
21182130
SOC_RESULT_INVALID_ARGUMENT);
21192131
CHECK(soc_raster_prepared_list_reserve(&list, 2u) == SOC_RESULT_OK);

0 commit comments

Comments
 (0)