Struct webrender::renderer::init::WebRenderOptions

source ·
pub struct WebRenderOptions {
Show 47 fields pub resource_override_path: Option<PathBuf>, pub use_optimized_shaders: bool, pub enable_aa: bool, pub enable_dithering: bool, pub max_recorded_profiles: usize, pub precache_flags: ShaderPrecacheFlags, pub enable_subpixel_aa: bool, pub clear_color: ColorF, pub enable_clear_scissor: Option<bool>, pub max_internal_texture_size: Option<i32>, pub image_tiling_threshold: i32, pub upload_method: UploadMethod, pub upload_pbo_default_size: usize, pub batched_upload_threshold: i32, pub workers: Option<Arc<ThreadPool>>, pub dedicated_glyph_raster_thread: Option<GlyphRasterThread>, pub enable_multithreading: bool, pub blob_image_handler: Option<Box<dyn BlobImageHandler>>, pub crash_annotator: Option<Box<dyn CrashAnnotator>>, pub size_of_op: Option<VoidPtrToSizeFn>, pub enclosing_size_of_op: Option<VoidPtrToSizeFn>, pub cached_programs: Option<Rc<ProgramCache>>, pub debug_flags: DebugFlags, pub renderer_id: Option<u64>, pub scene_builder_hooks: Option<Box<dyn SceneBuilderHooks + Send>>, pub sampler: Option<Box<dyn AsyncPropertySampler + Send>>, pub support_low_priority_transactions: bool, pub namespace_alloc_by_client: bool, pub shared_font_namespace: Option<IdNamespace>, pub testing: bool, pub gpu_supports_fast_clears: bool, pub allow_dual_source_blending: bool, pub allow_advanced_blend_equation: bool, pub allow_texture_storage_support: bool, pub allow_texture_swizzling: bool, pub clear_caches_with_quads: bool, pub dump_shader_source: Option<String>, pub surface_origin_is_top_left: bool, pub compositor_config: CompositorConfig, pub enable_gpu_markers: bool, pub panic_on_gl_error: bool, pub picture_tile_size: Option<DeviceIntSize>, pub texture_cache_config: TextureCacheConfig, pub enable_instancing: bool, pub reject_software_rasterizer: bool, pub low_quality_pinch_zoom: bool, pub max_shared_surface_size: i32,
}

Fields§

§resource_override_path: Option<PathBuf>§use_optimized_shaders: bool

Whether to use shaders that have been optimized at build time.

§enable_aa: bool§enable_dithering: bool§max_recorded_profiles: usize§precache_flags: ShaderPrecacheFlags§enable_subpixel_aa: bool

Enable sub-pixel anti-aliasing if a fast implementation is available.

§clear_color: ColorF§enable_clear_scissor: Option<bool>§max_internal_texture_size: Option<i32>§image_tiling_threshold: i32§upload_method: UploadMethod§upload_pbo_default_size: usize

The default size in bytes for PBOs used to upload texture data.

§batched_upload_threshold: i32§workers: Option<Arc<ThreadPool>>§dedicated_glyph_raster_thread: Option<GlyphRasterThread>§enable_multithreading: bool§blob_image_handler: Option<Box<dyn BlobImageHandler>>§crash_annotator: Option<Box<dyn CrashAnnotator>>§size_of_op: Option<VoidPtrToSizeFn>§enclosing_size_of_op: Option<VoidPtrToSizeFn>§cached_programs: Option<Rc<ProgramCache>>§debug_flags: DebugFlags§renderer_id: Option<u64>§scene_builder_hooks: Option<Box<dyn SceneBuilderHooks + Send>>§sampler: Option<Box<dyn AsyncPropertySampler + Send>>§support_low_priority_transactions: bool§namespace_alloc_by_client: bool§shared_font_namespace: Option<IdNamespace>

If namespaces are allocated by the client, then the namespace for fonts must also be allocated by the client to avoid namespace collisions with the backend.

§testing: bool§gpu_supports_fast_clears: bool

Set to true if this GPU supports hardware fast clears as a performance optimization. Likely requires benchmarking on various GPUs to see if it is a performance win. The default is false, which tends to be best performance on lower end / integrated GPUs.

§allow_dual_source_blending: bool§allow_advanced_blend_equation: bool§allow_texture_storage_support: bool

If true, allow textures to be initialized with glTexStorage. This affects VRAM consumption and data upload paths.

§allow_texture_swizzling: bool

If true, we allow the data uploaded in a different format from the one expected by the driver, pretending the format is matching, and swizzling the components on all the shader sampling.

§clear_caches_with_quads: bool

Use ps_clear shader with batched quad rendering to clear the rects in texture cache and picture cache tasks. This helps to work around some Intel drivers that incorrectly synchronize clears to following draws.

§dump_shader_source: Option<String>

Output the source of the shader with the given name.

§surface_origin_is_top_left: bool§compositor_config: CompositorConfig

The configuration options defining how WR composites the final scene.

§enable_gpu_markers: bool§panic_on_gl_error: bool

If true, panic whenever a GL error occurs. This has a significant performance impact, so only use when debugging specific problems!

§picture_tile_size: Option<DeviceIntSize>§texture_cache_config: TextureCacheConfig§enable_instancing: bool

If true, we’ll use instanced vertex attributes. Each instace is a quad. If false, we’ll duplicate the instance attributes per vertex and issue regular indexed draws instead.

§reject_software_rasterizer: bool

If true, we’ll reject contexts backed by a software rasterizer, except Software WebRender.

§low_quality_pinch_zoom: bool

If enabled, pinch-zoom will apply the zoom factor during compositing of picture cache tiles. This is higher performance (tiles are not re-rasterized during zoom) but lower quality result. For most display items, if the zoom factor is relatively small, bilinear filtering should make the result look quite close to the high-quality zoom, except for glyphs.

§max_shared_surface_size: i32

Implementations§

source§

impl WebRenderOptions

source

const BATCH_LOOKBACK_COUNT: usize = 10usize

Number of batches to look back in history for adding the current transparent instance into.

source

const MAX_INSTANCE_BUFFER_SIZE: usize = 131_072usize

Since we are re-initializing the instance buffers on every draw call, the driver has to internally manage PBOs in flight. It’s typically done by bucketing up to a specific limit, and then just individually managing the largest buffers. Having a limit here allows the drivers to more easily manage the PBOs for us.

Trait Implementations§

source§

impl Default for WebRenderOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.