2 * Copyright © 2020 Google LLC
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 #include "freedreno_layout.h"
25 #include "fd_layout_test.h"
26 #include "adreno_common.xml.h"
27 #include "util/u_half.h"
32 /* Testcases generated from cffdump --script texturator-to-unit-test-5xx.lua
35 static const struct testcase testcases
[] = {
36 /* Basic POT, non-UBWC layout test */
38 .format
= PIPE_FORMAT_R9G9B9E5_FLOAT
,
41 .width0
= 32, .height0
= 32,
43 { .offset
= 0, .pitch
= 256 },
44 { .offset
= 8192, .pitch
= 256 },
45 { .offset
= 12288, .pitch
= 256 },
46 { .offset
= 14336, .pitch
= 256 },
47 { .offset
= 15360, .pitch
= 256 },
48 { .offset
= 15872, .pitch
= 256 },
53 /* Some 3D cases of sizes from the CTS, when I was suspicious of our 3D
57 .format
= PIPE_FORMAT_R9G9B9E5_FLOAT
,
62 .width0
= 59, .height0
= 37, .depth0
= 11,
64 { .offset
= 0, .pitch
= 256 },
65 { .offset
= 135168, .pitch
= 256 },
66 { .offset
= 176128, .pitch
= 256 },
67 { .offset
= 192512, .pitch
= 256 },
68 { .offset
= 200704, .pitch
= 256 },
69 { .offset
= 208896, .pitch
= 256 },
74 .format
= PIPE_FORMAT_R32G32_FLOAT
,
79 .width0
= 63, .height0
= 29, .depth0
= 11,
81 { .offset
= 0, .pitch
= 512 },
82 { .offset
= 180224, .pitch
= 512 },
83 { .offset
= 221184, .pitch
= 512 },
84 { .offset
= 237568, .pitch
= 512 },
85 { .offset
= 245760, .pitch
= 512 },
86 { .offset
= 253952, .pitch
= 512 },
93 main(int argc
, char **argv
)
97 for (int i
= 0; i
< ARRAY_SIZE(testcases
); i
++) {
98 if (!fdl_test_layout(&testcases
[i
], 540))