pub struct RendererOptions {
Show 44 fields pub device_pixel_ratio: f32, 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 force_subpixel_aa: bool, pub clear_color: Option<ColorF>, pub enable_clear_scissor: bool, pub max_internal_texture_size: Option<i32>, pub image_tiling_threshold: i32, pub upload_method: UploadMethod, pub upload_pbo_default_size: usize, pub workers: Option<Arc<ThreadPool>>, 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 chase_primitive: ChasePrimitive, pub support_low_priority_transactions: bool, pub namespace_alloc_by_client: bool, 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,


§device_pixel_ratio: f32§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.

§force_subpixel_aa: bool

Enable sub-pixel anti-aliasing if it requires a slow implementation.

§clear_color: Option<ColorF>§enable_clear_scissor: 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.

§workers: Option<Arc<ThreadPool>>§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>>§chase_primitive: ChasePrimitive§support_low_priority_transactions: bool§namespace_alloc_by_client: bool§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.



impl RendererOptions


const BATCH_LOOKBACK_COUNT: usize = 10usize

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


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§


impl Default for RendererOptions


fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§


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


fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more

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


fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

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


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

Mutably borrows from an owned value. Read more

impl<T> From<T> for T


fn from(t: T) -> T

Returns the argument unchanged.


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


fn into(self) -> U

Calls U::from(self).

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


impl<T> Pointable for T


const ALIGN: usize = _

The alignment of pointer.

type Init = T

The type for initializers.

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

Initializes a with the given initializer. Read more

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

Dereferences the given pointer. Read more

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

Mutably dereferences the given pointer. Read more

unsafe fn drop(ptr: usize)

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

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


type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

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


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

The type returned in the event of a conversion error.

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

Performs the conversion.