2022-11-20 03:45:42 +11:00
|
|
|
// SPDX-License-Identifier: Apache-2.0 OR MIT OR Unlicense
|
2022-10-25 08:53:12 +11:00
|
|
|
|
2023-03-04 12:46:50 +11:00
|
|
|
// This must be kept in sync with the struct in src/encoding/resolve.rs
|
2022-10-25 08:53:12 +11:00
|
|
|
struct Config {
|
|
|
|
width_in_tiles: u32,
|
|
|
|
height_in_tiles: u32,
|
2022-10-27 07:55:45 +11:00
|
|
|
|
2022-11-26 09:16:56 +11:00
|
|
|
target_width: u32,
|
|
|
|
target_height: u32,
|
|
|
|
|
2023-03-03 04:26:31 +11:00
|
|
|
// The initial color applied to the pixels in a tile during the fine stage.
|
|
|
|
// This is only used in the full pipeline. The format is packed RGBA8 in MSB
|
|
|
|
// order.
|
2023-03-03 09:29:06 +11:00
|
|
|
base_color: u32,
|
2023-03-03 04:26:31 +11:00
|
|
|
|
2022-10-27 07:55:45 +11:00
|
|
|
n_drawobj: u32,
|
2022-11-04 10:53:34 +11:00
|
|
|
n_path: u32,
|
2022-11-11 14:48:36 +11:00
|
|
|
n_clip: u32,
|
2022-10-27 07:55:45 +11:00
|
|
|
|
2022-11-30 12:35:19 +11:00
|
|
|
// To reduce the number of bindings, info and bin data are combined
|
|
|
|
// into one buffer.
|
|
|
|
bin_data_start: u32,
|
|
|
|
|
2022-10-29 06:01:15 +11:00
|
|
|
// offsets within scene buffer (in u32 units)
|
2022-11-03 12:07:32 +11:00
|
|
|
pathtag_base: u32,
|
|
|
|
pathdata_base: u32,
|
|
|
|
|
2022-10-27 07:55:45 +11:00
|
|
|
drawtag_base: u32,
|
|
|
|
drawdata_base: u32,
|
2022-11-04 13:33:11 +11:00
|
|
|
|
|
|
|
transform_base: u32,
|
2022-11-05 06:40:54 +11:00
|
|
|
linewidth_base: u32,
|
2023-01-19 13:36:32 +11:00
|
|
|
|
|
|
|
// Sizes of bump allocated buffers (in element size units)
|
|
|
|
binning_size: u32,
|
|
|
|
tiles_size: u32,
|
|
|
|
segments_size: u32,
|
|
|
|
ptcl_size: u32,
|
2022-10-25 08:53:12 +11:00
|
|
|
}
|
2022-10-29 06:01:15 +11:00
|
|
|
|
|
|
|
// Geometry of tiles and bins
|
|
|
|
|
|
|
|
let TILE_WIDTH = 16u;
|
|
|
|
let TILE_HEIGHT = 16u;
|
|
|
|
// Number of tiles per bin
|
|
|
|
let N_TILE_X = 16u;
|
|
|
|
let N_TILE_Y = 16u;
|
2022-10-31 02:08:22 +11:00
|
|
|
//let N_TILE = N_TILE_X * N_TILE_Y;
|
|
|
|
let N_TILE = 256u;
|
2023-01-18 06:08:20 +11:00
|
|
|
|
|
|
|
let BLEND_STACK_SPLIT = 4u;
|
2023-05-10 08:09:53 +10:00
|
|
|
|
2023-05-16 04:45:38 +10:00
|
|
|
// The following are computed in draw_leaf from the generic gradient parameters
|
|
|
|
// encoded in the scene, and stored in the gradient's info struct, for
|
|
|
|
// consumption during fine rasterization.
|
|
|
|
|
2023-05-10 08:09:53 +10:00
|
|
|
// Radial gradient kinds
|
|
|
|
let RAD_GRAD_KIND_CIRCULAR = 1u;
|
|
|
|
let RAD_GRAD_KIND_STRIP = 2u;
|
|
|
|
let RAD_GRAD_KIND_FOCAL_ON_CIRCLE = 3u;
|
|
|
|
let RAD_GRAD_KIND_CONE = 4u;
|
|
|
|
|
|
|
|
// Radial gradient flags
|
|
|
|
let RAD_GRAD_SWAPPED = 1u;
|