mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
0218546161
The piet-gpu project is dual licensed under the Apache 2.0 and MIT, and the shaders themselves are also offered under the UNLICENSE terms. See https://github.com/linebender/piet-gpu#license-and-contributions, as of commit 72e2dfab3da8ae1adf7a0fb056b71ccbc4cfa29a: "The piet-gpu project is dual-licensed under both Apache 2.0 and MIT licenses. In addition, the shaders are provided under the terms of the Unlicense. The intent is for this research to be used in as broad a context as possible." Signed-off-by: Elias Naur <mail@eliasnaur.com>
39 lines
1.1 KiB
C
39 lines
1.1 KiB
C
// SPDX-License-Identifier: Apache-2.0 OR MIT OR Unlicense
|
|
|
|
// Various constants for the sizes of groups and tiles.
|
|
|
|
// Much of this will be made dynamic in various ways, but for now it's easiest
|
|
// to hardcode and keep all in one place.
|
|
|
|
// A LG_WG_FACTOR of n scales workgroup sizes by 2^n. Use 0 for a
|
|
// maximum workgroup size of 128, or 1 for a maximum size of 256.
|
|
#define LG_WG_FACTOR 0
|
|
#define WG_FACTOR (1<<LG_WG_FACTOR)
|
|
|
|
#define TILE_WIDTH_PX 32
|
|
#define TILE_HEIGHT_PX 32
|
|
|
|
#define PTCL_INITIAL_ALLOC 1024
|
|
|
|
// These should probably be renamed and/or reworked. In the binning
|
|
// kernel, they represent the number of bins. Also, the workgroup size
|
|
// of that kernel is equal to the number of bins, but should probably
|
|
// be more flexible (it's 512 in the K&L paper).
|
|
#define N_TILE_X 16
|
|
#define N_TILE_Y (8 * WG_FACTOR)
|
|
#define N_TILE (N_TILE_X * N_TILE_Y)
|
|
#define LG_N_TILE (7 + LG_WG_FACTOR)
|
|
#define N_SLICE (N_TILE / 32)
|
|
|
|
struct Config {
|
|
uint n_elements; // paths
|
|
uint n_pathseg;
|
|
uint width_in_tiles;
|
|
uint height_in_tiles;
|
|
Alloc tile_alloc;
|
|
Alloc bin_alloc;
|
|
Alloc ptcl_alloc;
|
|
Alloc pathseg_alloc;
|
|
Alloc anno_alloc;
|
|
};
|