MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ arm_graphics_read()

void MayaFlux::Kriya::detail::arm_graphics_read ( Buffers::DataReadProcessor &  reader,
const std::shared_ptr< Buffers::VKBuffer > &  buffer 
)

Arm the read that suits what the buffer is.

A texture buffer that retains host pixels, such as a video or camera buffer, reads them without touching the GPU; a texture buffer without them and a node texture read their GPU image, which blocks the graphics cycle for the transfer. Mesh and geometry sources read their mesh, network geometry reads its declared vertices, and any other buffer reads its primary storage.

Definition at line 38 of file PipelineGraphicsData.cpp.

39{
40 if (const auto texture = std::dynamic_pointer_cast<Buffers::TextureBuffer>(buffer)) {
41 if (texture->get_pixel_data().empty()) {
42 reader.read_texture_pixels();
43 } else {
44 reader.read_host_pixels();
45 }
46 return;
47 }
48
49 if (std::dynamic_pointer_cast<Buffers::NodeTextureBuffer>(buffer)) {
50 reader.read_texture_pixels();
51 return;
52 }
53
54 if (std::dynamic_pointer_cast<Buffers::MeshBuffer>(buffer)
55 || std::dynamic_pointer_cast<Buffers::MeshNetworkBuffer>(buffer)
56 || std::dynamic_pointer_cast<Buffers::ComputeMeshBuffer>(buffer)
57 || std::dynamic_pointer_cast<Buffers::VolumeGridBuffer>(buffer)) {
58 reader.read_mesh();
59 return;
60 }
61
62 if (const auto geometry = std::dynamic_pointer_cast<Buffers::GeometryBuffer>(buffer)) {
63 if (std::dynamic_pointer_cast<Nodes::GpuSync::MeshWriterNode>(geometry->get_geometry_node())) {
64 reader.read_mesh();
65 } else {
66 reader.read_vertices();
67 }
68 return;
69 }
70
71 if (std::dynamic_pointer_cast<Buffers::NetworkGeometryBuffer>(buffer)) {
72 reader.read_vertices();
73 return;
74 }
75
76 reader.read_bytes();
77}
std::shared_ptr< NetworkGeometryBuffer > buffer
void read_bytes(size_t byte_count=0)
Read the attached buffer's primary storage.
void read_texture_pixels()
Download the base level of a TextureBuffer or NodeTextureBuffer image.
void read_host_pixels()
Read the host pixel data a TextureBuffer retains.
void read_vertices()
Read the attached buffer's declared vertices; the layout count may represent capacity.
void read_mesh()
Read the attached mesh.

References buffer, MayaFlux::Buffers::DataReadProcessor::read_bytes(), MayaFlux::Buffers::DataReadProcessor::read_host_pixels(), MayaFlux::Buffers::DataReadProcessor::read_mesh(), MayaFlux::Buffers::DataReadProcessor::read_texture_pixels(), and MayaFlux::Buffers::DataReadProcessor::read_vertices().

+ Here is the call graph for this function: