ac/surface/tests: fix a random segfault in the modifier test

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10003>
This commit is contained in:
Marek Olšák 2021-04-07 17:20:53 -04:00 committed by Marge Bot
parent 23b2cf032a
commit 8771d45a74
1 changed files with 6 additions and 1 deletions

View File

@ -43,6 +43,9 @@ struct test_entry {
/* u_vector requires power of two sizing */
char padding[8];
#ifdef PIPE_ARCH_X86
char padding2[8];
#endif
};
static uint64_t
@ -394,8 +397,10 @@ static void print_test_entry(const struct test_entry *e)
int main()
{
STATIC_ASSERT(sizeof(struct test_entry) == 64);
struct u_vector test_entries;
u_vector_init(&test_entries, util_next_power_of_two(sizeof(struct test_entry)), 4096);
u_vector_init(&test_entries, sizeof(struct test_entry), 4096);
for (unsigned i = 0; i < ARRAY_SIZE(testcases); ++i) {
struct radeon_info info = get_radeon_info(&testcases[i]);