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

Function blit_into_atlas

tools/imposter-baker/src/render.rs:357–380  ·  view source on GitHub ↗
(
    enc: &mut wgpu::CommandEncoder,
    cell: &wgpu::Texture,
    atlas: &wgpu::Texture,
    i: u32,
    j: u32,
    cell_px: u32,
)

Source from the content-addressed store, hash-verified

355}
356
357fn blit_into_atlas(
358 enc: &mut wgpu::CommandEncoder,
359 cell: &wgpu::Texture,
360 atlas: &wgpu::Texture,
361 i: u32,
362 j: u32,
363 cell_px: u32,
364) {
365 enc.copy_texture_to_texture(
366 wgpu::TexelCopyTextureInfo {
367 texture: cell,
368 mip_level: 0,
369 origin: wgpu::Origin3d::ZERO,
370 aspect: wgpu::TextureAspect::All,
371 },
372 wgpu::TexelCopyTextureInfo {
373 texture: atlas,
374 mip_level: 0,
375 origin: wgpu::Origin3d { x: i * cell_px, y: j * cell_px, z: 0 },
376 aspect: wgpu::TextureAspect::All,
377 },
378 wgpu::Extent3d { width: cell_px, height: cell_px, depth_or_array_layers: 1 },
379 );
380}
381
382/// Copy texture to a CPU-mappable buffer, handling wgpu's 256-byte
383/// row-pitch alignment, and return the unpadded pixel bytes.

Callers 1

bake_asyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected