MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / new

Method new

native/shared/src/renderer/mod.rs:1496–6238  ·  view source on GitHub ↗
(
        device: wgpu::Device,
        queue: wgpu::Queue,
        surface: wgpu::Surface<'static>,
        surface_config: wgpu::SurfaceConfiguration,
        logical_width: u32,
        logical_hei

Source from the content-addressed store, hash-verified

1494
1495impl Renderer {
1496 pub fn new(
1497 device: wgpu::Device,
1498 queue: wgpu::Queue,
1499 surface: wgpu::Surface<'static>,
1500 surface_config: wgpu::SurfaceConfiguration,
1501 logical_width: u32,
1502 logical_height: u32,
1503 ) -> Self {
1504 // Ticket 007b: HW ray-tracing availability is a device-feature
1505 // query, set by whichever platform crate constructed this
1506 // device. Renderer internals branch on this flag when picking
1507 // the probe-trace pipeline.
1508 let hw_rt_enabled = device
1509 .features()
1510 .contains(wgpu::Features::EXPERIMENTAL_RAY_QUERY);
1511
1512 // --- Shaders ---
1513 let shader_2d = device.create_shader_module(wgpu::ShaderModuleDescriptor {
1514 label: Some("shader_2d"),
1515 source: wgpu::ShaderSource::Wgsl(SHADER_2D.into()),
1516 });
1517 let shader_3d = device.create_shader_module(wgpu::ShaderModuleDescriptor {
1518 label: Some("shader_3d"),
1519 source: wgpu::ShaderSource::Wgsl(SHADER_3D.into()),
1520 });
1521
1522 // --- Uniform bind group layouts ---
1523 let uniform_2d_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
1524 label: Some("uniform_2d_layout"),
1525 entries: &[wgpu::BindGroupLayoutEntry {
1526 binding: 0,
1527 visibility: wgpu::ShaderStages::VERTEX,
1528 ty: wgpu::BindingType::Buffer {
1529 ty: wgpu::BufferBindingType::Uniform,
1530 has_dynamic_offset: false,
1531 min_binding_size: None,
1532 },
1533 count: None,
1534 }],
1535 });
1536
1537 let texture_bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
1538 label: Some("texture_layout"),
1539 entries: &[
1540 wgpu::BindGroupLayoutEntry {
1541 binding: 0,
1542 visibility: wgpu::ShaderStages::FRAGMENT,
1543 ty: wgpu::BindingType::Texture {
1544 sample_type: wgpu::TextureSampleType::Float { filterable: true },
1545 view_dimension: wgpu::TextureViewDimension::D2,
1546 multisampled: false,
1547 },
1548 count: None,
1549 },
1550 wgpu::BindGroupLayoutEntry {
1551 binding: 1,
1552 visibility: wgpu::ShaderStages::FRAGMENT,
1553 ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),

Callers

nothing calls this directly

Calls 15

build_brdf_lutFunction · 0.85
build_transmittance_lutFunction · 0.85
descFunction · 0.85
create_depth_textureFunction · 0.85
create_hdr_rtFunction · 0.85
create_material_rtFunction · 0.85
create_albedo_rtFunction · 0.85
create_composed_rtFunction · 0.85
create_bloom_chainFunction · 0.85
create_ssao_rtFunction · 0.85

Tested by

no test coverage detected