Blender V5.3
extract_mesh_corner_gpu.cc File Reference
#include "BLI_math_base_c.hh"
#include "GPU_capabilities.hh"
#include "GPU_compute.hh"
#include "GPU_shader.hh"
#include "GPU_state.hh"
#include "draw_defines.hh"
#include "draw_shader.hh"
#include "extract_mesh.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::draw

Functions

template<typename GetIndex>
static gpu::VertBufPtr blender::draw::bm_corner_indices_create (const BMesh &bm, const GetIndex get_index)
static gpu::VertBuf & blender::draw::corner_verts_ensure (const MeshRenderData &mr, MeshBufferCache &cache)
static gpu::VertBuf & blender::draw::corner_edges_ensure (const MeshRenderData &mr, MeshBufferCache &cache)
static gpu::VertBuf & blender::draw::face_offsets_ensure (const MeshRenderData &mr, MeshBufferCache &cache)
static void blender::draw::dispatch_batched (gpu::Shader *shader, const int size)
static int blender::draw::element_size (const gpu::VertBuf &src, const gpu::VertBuf &dst)
static void blender::draw::gather_to_corner_gpu (const MeshRenderData &mr, gpu::VertBuf &src, gpu::VertBuf &indices, gpu::VertBuf &dst)
Copy to Face Corners on the GPU

Vertex, edge, and face data is copied to face corners on the GPU to reduce the size of data uploads. For example, on a typical quad mesh there are four times as many corners as faces and vertices. Topology data used for the copy (see #MeshBufferCache::corner_verts, etc.) is only uploaded once and is shared by all buffers.

In each function, src has a value for every element of the source domain, and dst is a device-only buffer with the same format and a value for every face corner, optionally followed by values for loose geometry. These GPU tasks can only be submitted from the thread with the GPU context.

void blender::draw::gather_vert_to_corner_gpu (const MeshRenderData &mr, MeshBufferCache &cache, gpu::VertBuf &src, gpu::VertBuf &dst)
void blender::draw::gather_edge_to_corner_gpu (const MeshRenderData &mr, MeshBufferCache &cache, gpu::VertBuf &src, gpu::VertBuf &dst)
void blender::draw::scatter_face_to_corner_gpu (const MeshRenderData &mr, MeshBufferCache &cache, gpu::VertBuf &src, gpu::VertBuf &dst)