const struct lp_scene *scene = task->scene;
void *depth;
+ assert(x < scene->tiles_x * TILE_SIZE);
+ assert(y < scene->tiles_y * TILE_SIZE);
assert((x % TILE_VECTOR_WIDTH) == 0);
assert((y % TILE_VECTOR_HEIGHT) == 0);
{
const struct lp_scene *scene = task->scene;
+ assert(task->x < scene->tiles_x * TILE_SIZE);
+ assert(task->y < scene->tiles_y * TILE_SIZE);
assert(task->x % TILE_SIZE == 0);
assert(task->y % TILE_SIZE == 0);
assert(buf < scene->fb.nr_cbufs);
unsigned px, py, pixel_offset;
uint8_t *color;
+ assert(x < task->scene->tiles_x * TILE_SIZE);
+ assert(y < task->scene->tiles_y * TILE_SIZE);
assert((x % TILE_VECTOR_WIDTH) == 0);
assert((y % TILE_VECTOR_HEIGHT) == 0);
{
const struct lp_rast_triangle *tri = arg.triangle.tri;
const struct lp_rast_plane *plane = GET_PLANES(tri);
- int x = (arg.triangle.plane_mask & 0xff) + task->x;
- int y = (arg.triangle.plane_mask >> 8) + task->y;
+ unsigned x = (arg.triangle.plane_mask & 0xff) + task->x;
+ unsigned y = (arg.triangle.plane_mask >> 8) + task->y;
__m128i p0 = _mm_load_si128((__m128i *)&plane[0]); /* c, dcdx, dcdy, eo */
__m128i p1 = _mm_load_si128((__m128i *)&plane[1]); /* c, dcdx, dcdy, eo */
{
int ix0 = bbox->x0 / TILE_SIZE;
int iy0 = bbox->y0 / TILE_SIZE;
- int px = bbox->x0 & 63 & ~3;
- int py = bbox->y0 & 63 & ~3;
- int mask = px | (py << 8);
+ unsigned px = bbox->x0 & 63 & ~3;
+ unsigned py = bbox->y0 & 63 & ~3;
+ unsigned mask;
assert(iy0 == bbox->y1 / TILE_SIZE &&
ix0 == bbox->x1 / TILE_SIZE);
+ if (4 <= sz && sz < 16) {
+ /*
+ * 16x16 block is only 4x4 aligned, and can exceed the tile dimensions
+ * if the triangle is 16 pixels in one dimension but 4 in the other.
+ * So budge the 16x16 back inside the tile.
+ */
+ px = MIN2(px, TILE_SIZE - 16);
+ py = MIN2(py, TILE_SIZE - 16);
+ }
+
+ mask = px | (py << 8);
+
if (nr_planes == 3) {
if (sz < 4)
{
/* Triangle is contained in a single 4x4 stamp:
*/
+ assert(px + 4 <= TILE_SIZE);
+ assert(py + 4 <= TILE_SIZE);
return lp_scene_bin_cmd_with_state( scene, ix0, iy0,
setup->fs.stored,
LP_RAST_OP_TRIANGLE_3_4,
{
/* Triangle is contained in a single 16x16 block:
*/
+ assert(px + 16 <= TILE_SIZE);
+ assert(py + 16 <= TILE_SIZE);
return lp_scene_bin_cmd_with_state( scene, ix0, iy0,
setup->fs.stored,
LP_RAST_OP_TRIANGLE_3_16,
}
else if (nr_planes == 4 && sz < 16)
{
+ assert(px + 16 <= TILE_SIZE);
+ assert(py + 16 <= TILE_SIZE);
return lp_scene_bin_cmd_with_state(scene, ix0, iy0,
setup->fs.stored,
LP_RAST_OP_TRIANGLE_4_16,