MCPcopy Create free account
hub / github.com/PerroEngine/Perro / prepare

Method prepare

perro_source/render_stack/perro_graphics/src/ui/gpu.rs:336–434  ·  view source on GitHub ↗
(
        &mut self,
        device: &wgpu::Device,
        queue: &wgpu::Queue,
        input: UiPrepareInput<'_>,
    )

Source from the content-addressed store, hash-verified

334 immediate_size: 0,
335 });
336 let pipeline = crate::pipeline_cache::create_render_pipeline(
337 device,
338 wgpu::RenderPipelineDescriptor {
339 label: Some("perro_ui_pipeline"),
340 layout: Some(&pipeline_layout),
341 vertex: wgpu::VertexState {
342 module: &shader,
343 entry_point: Some("vs_main"),
344 buffers: &[Some(wgpu::VertexBufferLayout {
345 array_stride: std::mem::size_of::<UiVertexGpu>() as u64,
346 step_mode: wgpu::VertexStepMode::Vertex,
347 attributes: &[
348 wgpu::VertexAttribute {
349 format: wgpu::VertexFormat::Float32x2,
350 offset: 0,
351 shader_location: 0,
352 },
353 wgpu::VertexAttribute {
354 format: wgpu::VertexFormat::Float32x2,
355 offset: 8,
356 shader_location: 1,
357 },
358 wgpu::VertexAttribute {
359 format: wgpu::VertexFormat::Float32x2,
360 offset: 16,
361 shader_location: 2,
362 },
363 wgpu::VertexAttribute {
364 format: wgpu::VertexFormat::Unorm8x4,
365 offset: 24,
366 shader_location: 3,
367 },
368 ],
369 })],
370 compilation_options: wgpu::PipelineCompilationOptions::default(),
371 },
372 fragment: Some(wgpu::FragmentState {
373 module: &shader,
374 entry_point: Some("fs_main_linear_framebuffer"),
375 targets: &[Some(wgpu::ColorTargetState {
376 format: UI_SUPERSAMPLE_FORMAT,
377 blend: Some(wgpu::BlendState {
378 color: wgpu::BlendComponent {
379 src_factor: wgpu::BlendFactor::One,
380 dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
381 operation: wgpu::BlendOperation::Add,
382 },
383 alpha: wgpu::BlendComponent {
384 src_factor: wgpu::BlendFactor::One,
385 dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
386 operation: wgpu::BlendOperation::Add,
387 },
388 }),
389 write_mask: wgpu::ColorWrites::ALL,
390 })],
391 compilation_options: wgpu::PipelineCompilationOptions::default(),
392 }),
393 primitive: wgpu::PrimitiveState {

Callers 1

renderMethod · 0.45

Calls 15

supersampled_sizeFunction · 0.85
viewport_scaleFunction · 0.85
clip_rect_scaledFunction · 0.85
push_ui_meshFunction · 0.85
apply_font_deltaMethod · 0.80
ensure_image_textureMethod · 0.80
extendMethod · 0.80
upload_mesh_buffersMethod · 0.80
maxMethod · 0.45
is_emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected